diff options
-rw-r--r-- | chrome/browser/browser_main.cc | 9 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 5a52734..cc39d22 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -77,7 +77,6 @@ // progress and should not be taken as an indication of a real refactoring. #if defined(OS_WIN) - #include <windows.h> #include <commctrl.h> #include <shellapi.h> @@ -93,6 +92,7 @@ #include "chrome/browser/printing/print_job_manager.h" #include "chrome/browser/profile.h" #include "chrome/browser/rlz/rlz.h" +#include "chrome/browser/views/chrome_views_delegate.h" #include "chrome/browser/views/user_data_dir_dialog.h" #include "chrome/common/env_vars.h" #include "chrome/installer/util/helper.h" @@ -105,7 +105,6 @@ #include "net/http/http_network_layer.h" #include "sandbox/src/sandbox.h" #include "views/widget/accelerator_handler.h" - #endif // defined(OS_WIN) #if defined(TOOLKIT_GTK) @@ -377,8 +376,14 @@ int BrowserMain(const MainFunctionParams& parameters) { // It is important for this to happen before the first run dialog, as it // styles the dialog as well. gtk_util::InitRCStyles(); +#elif defined(TOOLKIT_VIEWS) + // The delegate needs to be set before any UI is created so that windows + // display the correct icon. + if (!views::ViewsDelegate::views_delegate) + views::ViewsDelegate::views_delegate = new ChromeViewsDelegate; #endif + #if defined(OS_POSIX) // On Mac OS X / Linux we display the first run dialog as early as possible, // so we can get the stats enabled. diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 9088f32..5284c6c 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -1799,9 +1799,6 @@ void BrowserView::InitClass() { // static BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { - if (!views::ViewsDelegate::views_delegate) - views::ViewsDelegate::views_delegate = new ChromeViewsDelegate; - // Create the view and the frame. The frame will attach itself via the view // so we don't need to do anything with the pointer. BrowserView* view = new BrowserView(browser); |