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 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 } else { | 803 } else { |
804 #if defined(TOOLKIT_GTK) | 804 #if defined(TOOLKIT_GTK) |
805 // Setting the time of the last action on the window here allows us to steal | 805 // Setting the time of the last action on the window here allows us to steal |
806 // focus, which is what the user wants when opening a new tab in an existing | 806 // focus, which is what the user wants when opening a new tab in an existing |
807 // browser window. | 807 // browser window. |
808 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow()); | 808 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeWindow()); |
809 #endif | 809 #endif |
810 } | 810 } |
811 | 811 |
812 #if defined(USE_ASH) | 812 #if defined(USE_ASH) |
813 // Set the browser's root window to be an active root window now so | 813 if (ash::Shell::HasInstance()) { |
814 // that that web contents can determine correct scale factor for the | 814 // Set the browser's root window to be an active root window now so |
815 // renderer. This is a short term fix for crbug.com/155201. Without | 815 // that that web contents can determine correct scale factor for the |
816 // this, the renderer may use wrong scale factor first, then | 816 // renderer. This is a short term fix for crbug.com/155201. Without |
817 // switched to the correct scale factor, which can cause race | 817 // this, the renderer may use wrong scale factor first, then |
818 // condition and lead to the results rendered at wrong scale factor. | 818 // switched to the correct scale factor, which can cause race |
819 // Long term fix is tracked in crbug.com/15543. | 819 // condition and lead to the results rendered at wrong scale factor. |
820 ash::Shell::GetInstance()->set_active_root_window( | 820 // Long term fix is tracked in crbug.com/15543. |
821 browser->window()->GetNativeWindow()->GetRootWindow()); | 821 ash::Shell::GetInstance()->set_active_root_window( |
| 822 browser->window()->GetNativeWindow()->GetRootWindow()); |
| 823 } |
822 #endif | 824 #endif |
823 | 825 |
824 // In kiosk mode, we want to always be fullscreen, so switch to that now. | 826 // In kiosk mode, we want to always be fullscreen, so switch to that now. |
825 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 827 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
826 chrome::ToggleFullscreenMode(browser); | 828 chrome::ToggleFullscreenMode(browser); |
827 | 829 |
828 bool first_tab = true; | 830 bool first_tab = true; |
829 for (size_t i = 0; i < tabs.size(); ++i) { | 831 for (size_t i = 0; i < tabs.size(); ++i) { |
830 // We skip URLs that we'd have to launch an external protocol handler for. | 832 // We skip URLs that we'd have to launch an external protocol handler for. |
831 // This avoids us getting into an infinite loop asking ourselves to open | 833 // This avoids us getting into an infinite loop asking ourselves to open |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 // New: | 1032 // New: |
1031 prefs->GetString(prefs::kHomePage), | 1033 prefs->GetString(prefs::kHomePage), |
1032 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), | 1034 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), |
1033 prefs->GetBoolean(prefs::kShowHomeButton), | 1035 prefs->GetBoolean(prefs::kShowHomeButton), |
1034 // Backup: | 1036 // Backup: |
1035 backup_homepage, | 1037 backup_homepage, |
1036 backup_homepage_is_ntp, | 1038 backup_homepage_is_ntp, |
1037 backup_show_home_button)); | 1039 backup_show_home_button)); |
1038 } | 1040 } |
1039 } | 1041 } |
OLD | NEW |