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" |
100 #endif | 102 #endif |
101 | 103 |
102 #if defined(OS_MACOSX) | 104 #if defined(OS_MACOSX) |
103 #include "base/mac/mac_util.h" | 105 #include "base/mac/mac_util.h" |
104 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" | 106 #include "chrome/browser/ui/cocoa/keystone_infobar_delegate.h" |
105 #endif | 107 #endif |
106 | 108 |
107 #if defined(TOOLKIT_GTK) | 109 #if defined(TOOLKIT_GTK) |
108 #include "chrome/browser/ui/gtk/gtk_util.h" | 110 #include "chrome/browser/ui/gtk/gtk_util.h" |
109 #endif | 111 #endif |
(...skipping 689 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 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 |
809 // In kiosk mode, we want to always be fullscreen, so switch to that now. | 825 // In kiosk mode, we want to always be fullscreen, so switch to that now. |
810 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 826 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
811 chrome::ToggleFullscreenMode(browser); | 827 chrome::ToggleFullscreenMode(browser); |
812 | 828 |
813 bool first_tab = true; | 829 bool first_tab = true; |
814 for (size_t i = 0; i < tabs.size(); ++i) { | 830 for (size_t i = 0; i < tabs.size(); ++i) { |
815 // We skip URLs that we'd have to launch an external protocol handler for. | 831 // 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 | 832 // 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 | 833 // 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. | 834 // 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... |
1025 | 1041 |
1026 #if !defined(OS_WIN) || defined(USE_AURA) | 1042 #if !defined(OS_WIN) || defined(USE_AURA) |
1027 // static | 1043 // static |
1028 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( | 1044 bool StartupBrowserCreatorImpl::OpenStartupURLsInExistingBrowser( |
1029 Profile* profile, | 1045 Profile* profile, |
1030 const std::vector<GURL>& startup_urls) { | 1046 const std::vector<GURL>& startup_urls) { |
1031 return false; | 1047 return false; |
1032 } | 1048 } |
1033 #endif | 1049 #endif |
1034 | 1050 |
OLD | NEW |