Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 11187005: Don't try to initialize ash if we're not running in ash mode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 browser = new Browser(Browser::CreateParams(profile_)); 802 browser = new Browser(Browser::CreateParams(profile_));
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 (ash::Shell::HasInstance()) {
813 // Set the browser's root window to be an active root window now so 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 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 815 // renderer. This is a short term fix for crbug.com/155201. Without
816 // this, the renderer may use wrong scale factor first, then 816 // this, the renderer may use wrong scale factor first, then
817 // switched to the correct scale factor, which can cause race 817 // switched to the correct scale factor, which can cause race
818 // condition and lead to the results rendered at wrong scale factor. 818 // condition and lead to the results rendered at wrong scale factor.
819 // Long term fix is tracked in crbug.com/15543. 819 // Long term fix is tracked in crbug.com/15543.
820 ash::Shell::GetInstance()->set_active_root_window( 820 ash::Shell::GetInstance()->set_active_root_window(
821 browser->window()->GetNativeWindow()->GetRootWindow()); 821 browser->window()->GetNativeWindow()->GetRootWindow());
822 #endif 822 }
823 823
824 // In kiosk mode, we want to always be fullscreen, so switch to that now. 824 // In kiosk mode, we want to always be fullscreen, so switch to that now.
825 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) 825 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode))
826 chrome::ToggleFullscreenMode(browser); 826 chrome::ToggleFullscreenMode(browser);
827 827
828 bool first_tab = true; 828 bool first_tab = true;
829 for (size_t i = 0; i < tabs.size(); ++i) { 829 for (size_t i = 0; i < tabs.size(); ++i) {
830 // We skip URLs that we'd have to launch an external protocol handler for. 830 // 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 831 // This avoids us getting into an infinite loop asking ourselves to open
832 // a URL, should the handler be (incorrectly) configured to be us. Anyone 832 // a URL, should the handler be (incorrectly) configured to be us. Anyone
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 // New: 1030 // New:
1031 prefs->GetString(prefs::kHomePage), 1031 prefs->GetString(prefs::kHomePage),
1032 prefs->GetBoolean(prefs::kHomePageIsNewTabPage), 1032 prefs->GetBoolean(prefs::kHomePageIsNewTabPage),
1033 prefs->GetBoolean(prefs::kShowHomeButton), 1033 prefs->GetBoolean(prefs::kShowHomeButton),
1034 // Backup: 1034 // Backup:
1035 backup_homepage, 1035 backup_homepage,
1036 backup_homepage_is_ntp, 1036 backup_homepage_is_ntp,
1037 backup_show_home_button)); 1037 backup_show_home_button));
1038 } 1038 }
1039 } 1039 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698