OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 #include "content/public/browser/web_contents.h" | 88 #include "content/public/browser/web_contents.h" |
89 #include "content/public/browser/web_contents_view.h" | 89 #include "content/public/browser/web_contents_view.h" |
90 #include "grit/locale_settings.h" | 90 #include "grit/locale_settings.h" |
91 #include "ui/base/l10n/l10n_util.h" | 91 #include "ui/base/l10n/l10n_util.h" |
92 #include "ui/base/resource/resource_bundle.h" | 92 #include "ui/base/resource/resource_bundle.h" |
93 #include "ui/gfx/rect.h" | 93 #include "ui/gfx/rect.h" |
94 #include "ui/gfx/screen.h" | 94 #include "ui/gfx/screen.h" |
95 | 95 |
96 #if defined(USE_ASH) | 96 #if defined(USE_ASH) |
97 #include "ash/launcher/launcher_types.h" | 97 #include "ash/launcher/launcher_types.h" |
98 #include "ash/shell.h" | |
99 #include "ui/aura/window.h" | |
98 #endif | 100 #endif |
99 | 101 |
100 #if defined(OS_MACOSX) | 102 #if defined(OS_MACOSX) |
101 #include "base/mac/mac_util.h" | 103 #include "base/mac/mac_util.h" |
102 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" | 104 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" |
103 #endif | 105 #endif |
104 | 106 |
105 #if defined(TOOLKIT_GTK) | 107 #if defined(TOOLKIT_GTK) |
106 #include "chrome/browser/ui/gtk/gtk_util.h" | 108 #include "chrome/browser/ui/gtk/gtk_util.h" |
107 #endif | 109 #endif |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
799 browser = new Browser(Browser::CreateParams(profile_)); | 801 browser = new Browser(Browser::CreateParams(profile_)); |
800 } else { | 802 } else { |
801 #if defined(TOOLKIT_GTK) | 803 #if defined(TOOLKIT_GTK) |
802 // Setting the time of the last action on the window here allows us to steal | 804 // Setting the time of the last action on the window here allows us to steal |
803 // focus, which is what the user wants when opening a new tab in an existing | 805 // focus, which is what the user wants when opening a new tab in an existing |
804 // browser window. | 806 // browser window. |
805 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow()); | 807 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow()); |
806 #endif | 808 #endif |
807 } | 809 } |
808 | 810 |
811 #if defined(USE_ASH) | |
812 // Set the browser's root window to be an active root window now | |
813 // so that that web contents can determine correct scale factor for | |
814 // the renderer. crbug.com/155201. | |
815 ash::Shell::GetInstance()->set_active_root_window( | |
sky
2012/10/12 14:31:40
I don't understand why this is necessary. Why is t
oshima
2012/10/12 16:04:46
We're not passing enough information for WebConten
| |
816 browser->window()->GetNativeWindow()->GetRootWindow()); | |
817 #endif | |
818 | |
809 // In kiosk mode, we want to always be fullscreen, so switch to that now. | 819 // In kiosk mode, we want to always be fullscreen, so switch to that now. |
810 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 820 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
811 chrome::ToggleFullscreenMode(browser); | 821 chrome::ToggleFullscreenMode(browser); |
812 | 822 |
813 bool first_tab = true; | 823 bool first_tab = true; |
814 for (size_t i = 0; i < tabs.size(); ++i) { | 824 for (size_t i = 0; i < tabs.size(); ++i) { |
815 // We skip URLs that we'd have to launch an external protocol handler for. | 825 // We skip URLs that we'd have to launch an external protocol handler for. |
816 // This avoids us getting into an infinite loop asking ourselves to open | 826 // This avoids us getting into an infinite loop asking ourselves to open |
817 // a URL, should the handler be (incorrectly) configured to be us. Anyone | 827 // a URL, should the handler be (incorrectly) configured to be us. Anyone |
818 // asking us to open such a URL should really ask the handler directly. | 828 // asking us to open such a URL should really ask the handler directly. |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1001 // New: | 1011 // New: |
1002 prefs->GetString(prefs::kHomePage), | 1012 prefs->GetString(prefs::kHomePage), |
1003 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 1013 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
1004 prefs->GetBoolean(prefs::kShowHomeButton), | 1014 prefs->GetBoolean(prefs::kShowHomeButton), |
1005 // Backup: | 1015 // Backup: |
1006 backup_homepage, | 1016 backup_homepage, |
1007 backup_homepage_is_ntp, | 1017 backup_homepage_is_ntp, |
1008 backup_show_home_button)); | 1018 backup_show_home_button)); |
1009 } | 1019 } |
1010 } | 1020 } |
OLD | NEW |