@@ -55,17 +55,17 @@ BrowserWindow* GetBrowserWindow(HWND hwnd) {
5555 }
5656 // GetBrowserWindow() may fail during window creation, so log
5757 // severity is only DEBUG.
58- LOGGER_DEBUG << " GetBrowserWindow(): not found, hwnd = " << (uintptr_t ) hwnd;
58+ LOGGER_DEBUG << " Browser window not found, hwnd = " << (uintptr_t ) hwnd;
5959 return NULL ;
6060}
6161void StoreBrowserWindow (HWND hwnd, BrowserWindow* browser) {
62- LOGGER_DEBUG << " StoreBrowserWindow(): hwnd = " << (uintptr_t ) hwnd;
62+ LOGGER_DEBUG << " Store browser window, hwnd = " << (uintptr_t ) hwnd;
6363 std::map<HWND, BrowserWindow*>::iterator it;
6464 it = g_browserWindows.find (hwnd);
6565 if (it == g_browserWindows.end ()) {
6666 g_browserWindows[hwnd] = browser;
6767 } else {
68- LOGGER_WARNING << " StoreBrowserWindow() failed: already stored" ;
68+ LOGGER_WARNING << " Storing browser window failed: already stored" ;
6969 }
7070}
7171void RemoveBrowserWindow (HWND hwnd) {
@@ -147,20 +147,30 @@ void BrowserWindow::SetCefBrowser(CefRefPtr<CefBrowser> cefBrowser) {
147147 this ->OnSize ();
148148}
149149bool BrowserWindow::CreateBrowserControl (const wchar_t * navigateUrl) {
150- LOGGER_DEBUG << " BrowserWindow::CreateBrowserControl() " ;
150+ LOGGER_DEBUG << " Create main browser " ;
151151 // This is called only for the main window.
152152 // Popup cef browsers are created internally by CEF,
153153 // see OnBeforePopup, OnAfterCreated.
154154 RECT rect;
155155 BOOL b = GetWindowRect (windowHandle_, &rect);
156156 if (!b) {
157- LOGGER_ERROR << " GetWindowRect() failed in "
158- " BrowserWindow::CreateBrowserControl()" ;
157+ LOGGER_ERROR << " GetWindowRect() failed while creating browser" ;
159158 }
160159
161160 // Information used when creating the native window.
161+ json_value* settings = GetApplicationSettings ();
162+ std::string runtime_style = (*settings)[" chrome" ][" runtime_style" ];
162163 CefWindowInfo window_info;
163- window_info.runtime_style = CEF_RUNTIME_STYLE_ALLOY;
164+ if (runtime_style == " alloy" ) {
165+ LOGGER_INFO << " Runtime style: alloy" ;
166+ window_info.runtime_style = CEF_RUNTIME_STYLE_ALLOY;
167+ } else if (runtime_style == " chrome" ) {
168+ LOGGER_INFO << " Runtime style: chrome" ;
169+ window_info.runtime_style = CEF_RUNTIME_STYLE_CHROME;
170+ } else {
171+ LOGGER_INFO << " Invalid runtime style in settings.json: " << runtime_style;
172+ window_info.runtime_style = CEF_RUNTIME_STYLE_ALLOY;
173+ }
164174 int width = rect.right - rect.left ;
165175 int height = rect.bottom - rect.top ;
166176 CefRect cef_rect (rect.left , rect.top , width, height);
@@ -169,7 +179,7 @@ bool BrowserWindow::CreateBrowserControl(const wchar_t* navigateUrl) {
169179 CefRefPtr<ClientHandler> handler (new ClientHandler ());
170180 // Specify CEF browser settings here.
171181 CefBrowserSettings browser_settings;
172- // Create the first browser window .
182+ // Create the first browser.
173183 CefBrowserHost::CreateBrowser (
174184 window_info, handler.get (),
175185 GetWebServerUrl (), browser_settings, nullptr , nullptr );
0 commit comments