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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 #include "content/public/browser/web_contents.h" | 90 #include "content/public/browser/web_contents.h" |
91 #include "content/public/browser/web_contents_view.h" | 91 #include "content/public/browser/web_contents_view.h" |
92 #include "grit/locale_settings.h" | 92 #include "grit/locale_settings.h" |
93 #include "ui/base/l10n/l10n_util.h" | 93 #include "ui/base/l10n/l10n_util.h" |
94 #include "ui/base/resource/resource_bundle.h" | 94 #include "ui/base/resource/resource_bundle.h" |
95 #include "ui/gfx/rect.h" | 95 #include "ui/gfx/rect.h" |
96 #include "ui/gfx/screen.h" | 96 #include "ui/gfx/screen.h" |
97 | 97 |
98 #if defined(USE_ASH) | 98 #if defined(USE_ASH) |
99 #include "ash/launcher/launcher_types.h" | 99 #include "ash/launcher/launcher_types.h" |
100 #include "ash/shell.h" | |
101 #include "ui/aura/window.h" | |
102 #endif | 100 #endif |
103 | 101 |
104 #if defined(OS_MACOSX) | 102 #if defined(OS_MACOSX) |
105 #include "base/mac/mac_util.h" | 103 #include "base/mac/mac_util.h" |
106 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" | 104 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" |
107 #endif | 105 #endif |
108 | 106 |
109 #if defined(TOOLKIT_GTK) | 107 #if defined(TOOLKIT_GTK) |
110 #include "chrome/browser/ui/gtk/gtk_util.h" | 108 #include "chrome/browser/ui/gtk/gtk_util.h" |
111 #endif | 109 #endif |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 browser = new Browser(Browser::CreateParams(profile_)); | 799 browser = new Browser(Browser::CreateParams(profile_)); |
802 } else { | 800 } else { |
803 #if defined(TOOLKIT_GTK) | 801 #if defined(TOOLKIT_GTK) |
804 // Setting the time of the last action on the window here allows us to steal | 802 // Setting the time of the last action on the window here allows us to steal |
805 // focus, which is what the user wants when opening a new tab in an existing | 803 // focus, which is what the user wants when opening a new tab in an existing |
806 // browser window. | 804 // browser window. |
807 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow()); | 805 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow()); |
808 #endif | 806 #endif |
809 } | 807 } |
810 | 808 |
811 #if defined(USE_ASH) | |
812 if (ash::Shell::HasInstance()) { | |
813 // Set the browser's root window to be an active root window now so | |
814 // that that web contents can determine correct scale factor for the | |
815 // renderer. This is a short term fix for crbug.com/155201. Without | |
816 // this, the renderer may use wrong scale factor first, then | |
817 // switched to the correct scale factor, which can cause race | |
818 // condition and lead to the results rendered at wrong scale factor. | |
819 // Long term fix is tracked in crbug.com/15543. | |
820 ash::Shell::GetInstance()->set_active_root_window( | |
821 browser->window()->GetNativeWindow()->GetRootWindow()); | |
822 } | |
823 #endif | |
824 | |
825 // In kiosk mode, we want to always be fullscreen, so switch to that now. | 809 // In kiosk mode, we want to always be fullscreen, so switch to that now. |
826 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 810 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
827 chrome::ToggleFullscreenMode(browser); | 811 chrome::ToggleFullscreenMode(browser); |
828 | 812 |
829 bool first_tab = true; | 813 bool first_tab = true; |
830 for (size_t i = 0; i < tabs.size(); ++i) { | 814 for (size_t i = 0; i < tabs.size(); ++i) { |
831 // We skip URLs that we'd have to launch an external protocol handler for. | 815 // We skip URLs that we'd have to launch an external protocol handler for. |
832 // This avoids us getting into an infinite loop asking ourselves to open | 816 // This avoids us getting into an infinite loop asking ourselves to open |
833 // a URL, should the handler be (incorrectly) configured to be us. Anyone | 817 // a URL, should the handler be (incorrectly) configured to be us. Anyone |
834 // asking us to open such a URL should really ask the handler directly. | 818 // asking us to open such a URL should really ask the handler directly. |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1041 | 1025 |
1042 #if !defined(OS_WIN) || defined(USE_AURA) | 1026 #if !defined(OS_WIN) || defined(USE_AURA) |
1043 // static | 1027 // static |
1044 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | 1028 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |
1045 Profile* profile, | 1029 Profile* profile, |
1046 const std::vector<GURL>& startup_urls) { | 1030 const std::vector<GURL>& startup_urls) { |
1047 return false; | 1031 return false; |
1048 } | 1032 } |
1049 #endif | 1033 #endif |
1050 | 1034 |
OLD | NEW |