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

Side by Side Diff: chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.cc

Issue 1845343005: Makes MaterialDesignController initialization explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 8 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
« no previous file with comments | « chrome/browser/ui/startup/bad_flags_prompt.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/views/chrome_browser_main_extra_parts_views_linux.h" 5 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views_linux.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/chrome_browser_main.h" 9 #include "chrome/browser/chrome_browser_main.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 views::LinuxUI::SetInstance(gtk2_ui); 76 views::LinuxUI::SetInstance(gtk2_ui);
77 } 77 }
78 78
79 void ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized() { 79 void ChromeBrowserMainExtraPartsViewsLinux::ToolkitInitialized() {
80 ChromeBrowserMainExtraPartsViews::ToolkitInitialized(); 80 ChromeBrowserMainExtraPartsViews::ToolkitInitialized();
81 views::LinuxUI::instance()->Initialize(); 81 views::LinuxUI::instance()->Initialize();
82 } 82 }
83 83
84 void ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() { 84 void ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() {
85 ChromeBrowserMainExtraPartsViews::PreCreateThreads(); 85 ChromeBrowserMainExtraPartsViews::PreCreateThreads();
86 // TODO(varkha): The next call should not be necessary once Material Design is
87 // on unconditionally.
88 views::LinuxUI::instance()->MaterialDesignControllerReady();
86 views::LinuxUI::instance()->UpdateDeviceScaleFactor( 89 views::LinuxUI::instance()->UpdateDeviceScaleFactor(
87 gfx::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor()); 90 gfx::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor());
88 } 91 }
89 92
90 void ChromeBrowserMainExtraPartsViewsLinux::PreProfileInit() { 93 void ChromeBrowserMainExtraPartsViewsLinux::PreProfileInit() {
91 // On the Linux desktop, we want to prevent the user from logging in as root, 94 // On the Linux desktop, we want to prevent the user from logging in as root,
92 // so that we don't destroy the profile. Now that we have some minimal ui 95 // so that we don't destroy the profile. Now that we have some minimal ui
93 // initialized, check to see if we're running as root and bail if we are. 96 // initialized, check to see if we're running as root and bail if we are.
94 if (getuid() != 0) 97 if (getuid() != 0)
95 return; 98 return;
96 99
97 const base::CommandLine& command_line = 100 const base::CommandLine& command_line =
98 *base::CommandLine::ForCurrentProcess(); 101 *base::CommandLine::ForCurrentProcess();
99 if (command_line.HasSwitch(switches::kUserDataDir)) 102 if (command_line.HasSwitch(switches::kUserDataDir))
100 return; 103 return;
101 104
102 base::string16 title = l10n_util::GetStringFUTF16( 105 base::string16 title = l10n_util::GetStringFUTF16(
103 IDS_REFUSE_TO_RUN_AS_ROOT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 106 IDS_REFUSE_TO_RUN_AS_ROOT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
104 base::string16 message = l10n_util::GetStringFUTF16( 107 base::string16 message = l10n_util::GetStringFUTF16(
105 IDS_REFUSE_TO_RUN_AS_ROOT_2, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 108 IDS_REFUSE_TO_RUN_AS_ROOT_2, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
106 109
107 chrome::ShowWarningMessageBox(NULL, title, message); 110 chrome::ShowWarningMessageBox(NULL, title, message);
108 111
109 // Avoids gpu_process_transport_factory.cc(153)] Check failed: 112 // Avoids gpu_process_transport_factory.cc(153)] Check failed:
110 // per_compositor_data_.empty() when quit is chosen. 113 // per_compositor_data_.empty() when quit is chosen.
111 base::RunLoop().RunUntilIdle(); 114 base::RunLoop().RunUntilIdle();
112 115
113 exit(EXIT_FAILURE); 116 exit(EXIT_FAILURE);
114 } 117 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/bad_flags_prompt.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698