Update source files for bracket style

This commit is contained in:
Marshall Greenblatt
2023-01-02 17:59:03 -05:00
parent d84b07a5cb
commit 3af3eab3e4
366 changed files with 7275 additions and 3834 deletions

View File

@ -21,16 +21,17 @@ const char kDefaultUrl[] = "http://www.google.com";
// Returns the ARGB value for |color|.
cef_color_t ParseColor(const std::string& color) {
const std::string& colorToLower = AsciiStrToLower(color);
if (colorToLower == "black")
if (colorToLower == "black") {
return CefColorSetARGB(255, 0, 0, 0);
else if (colorToLower == "blue")
} else if (colorToLower == "blue") {
return CefColorSetARGB(255, 0, 0, 255);
else if (colorToLower == "green")
} else if (colorToLower == "green") {
return CefColorSetARGB(255, 0, 255, 0);
else if (colorToLower == "red")
} else if (colorToLower == "red") {
return CefColorSetARGB(255, 255, 0, 0);
else if (colorToLower == "white")
} else if (colorToLower == "white") {
return CefColorSetARGB(255, 255, 255, 255);
}
// Use the default color.
return 0;
@ -45,10 +46,12 @@ MainContextImpl::MainContextImpl(CefRefPtr<CefCommandLine> command_line,
DCHECK(command_line_.get());
// Set the main URL.
if (command_line_->HasSwitch(switches::kUrl))
if (command_line_->HasSwitch(switches::kUrl)) {
main_url_ = command_line_->GetSwitchValue(switches::kUrl);
if (main_url_.empty())
}
if (main_url_.empty()) {
main_url_ = kDefaultUrl;
}
// Whether windowless (off-screen) rendering will be used.
use_windowless_rendering_ =
@ -187,17 +190,20 @@ bool MainContextImpl::UseDefaultPopup() {
void MainContextImpl::PopulateSettings(CefSettings* settings) {
client::ClientAppBrowser::PopulateSettings(command_line_, *settings);
if (use_chrome_runtime_)
if (use_chrome_runtime_) {
settings->chrome_runtime = true;
}
CefString(&settings->cache_path) =
command_line_->GetSwitchValue(switches::kCachePath);
if (use_windowless_rendering_)
if (use_windowless_rendering_) {
settings->windowless_rendering_enabled = true;
}
if (browser_background_color_ != 0)
if (browser_background_color_ != 0) {
settings->background_color = browser_background_color_;
}
if (command_line_->HasSwitch("lang")) {
// Use the same locale for the Accept-Language HTTP request header.
@ -209,8 +215,9 @@ void MainContextImpl::PopulateSettings(CefSettings* settings) {
void MainContextImpl::PopulateBrowserSettings(CefBrowserSettings* settings) {
settings->windowless_frame_rate = windowless_frame_rate_;
if (browser_background_color_ != 0)
if (browser_background_color_ != 0) {
settings->background_color = browser_background_color_;
}
if (use_chrome_runtime_ &&
command_line_->HasSwitch(switches::kHideChromeStatusBubble)) {
@ -228,8 +235,9 @@ void MainContextImpl::PopulateOsrSettings(OsrRendererSettings* settings) {
settings->external_begin_frame_enabled = external_begin_frame_enabled_;
settings->begin_frame_rate = windowless_frame_rate_;
if (browser_background_color_ != 0)
if (browser_background_color_ != 0) {
settings->background_color = browser_background_color_;
}
}
RootWindowManager* MainContextImpl::GetRootWindowManager() {
@ -245,8 +253,9 @@ bool MainContextImpl::Initialize(const CefMainArgs& args,
DCHECK(!initialized_);
DCHECK(!shutdown_);
if (!CefInitialize(args, settings, application, windows_sandbox_info))
if (!CefInitialize(args, settings, application, windows_sandbox_info)) {
return false;
}
// Need to create the RootWindowManager after calling CefInitialize because
// TempWindowX11 uses cef_get_xdisplay().