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

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: 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 | « no previous file | ui/base/material_design/material_design_controller.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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 ~ChromeBrowserMainExtraPartsViewsLinux() {} 70 ~ChromeBrowserMainExtraPartsViewsLinux() {}
71 71
72 void ChromeBrowserMainExtraPartsViewsLinux::PreEarlyInitialization() { 72 void ChromeBrowserMainExtraPartsViewsLinux::PreEarlyInitialization() {
73 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port. 73 // TODO(erg): Refactor this into a dlopen call when we add a GTK3 port.
74 views::LinuxUI* gtk2_ui = BuildGtk2UI(); 74 views::LinuxUI* gtk2_ui = BuildGtk2UI();
75 gtk2_ui->SetNativeThemeOverride(base::Bind(&GetNativeThemeForWindow)); 75 gtk2_ui->SetNativeThemeOverride(base::Bind(&GetNativeThemeForWindow));
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();
Evan Stade 2016/04/01 17:03:20 do you still need this?
varkha 2016/04/01 18:36:22 No, it is a NOP.
81 views::LinuxUI::instance()->Initialize();
82 } 81 }
83 82
84 void ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() { 83 void ChromeBrowserMainExtraPartsViewsLinux::PreCreateThreads() {
84 views::LinuxUI::instance()->Initialize();
Evan Stade 2016/04/01 17:03:20 This seems wrong. According to documentation, this
varkha 2016/04/01 18:36:22 Yes, this is probably a non-starter although I cou
varkha 2016/04/01 19:09:03 PTAL at the last patch set if you think that this
85 ChromeBrowserMainExtraPartsViews::PreCreateThreads(); 85 ChromeBrowserMainExtraPartsViews::PreCreateThreads();
86 views::LinuxUI::instance()->UpdateDeviceScaleFactor( 86 views::LinuxUI::instance()->UpdateDeviceScaleFactor(
87 gfx::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor()); 87 gfx::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor());
88 } 88 }
89 89
90 void ChromeBrowserMainExtraPartsViewsLinux::PreProfileInit() { 90 void ChromeBrowserMainExtraPartsViewsLinux::PreProfileInit() {
91 // On the Linux desktop, we want to prevent the user from logging in as root, 91 // 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 92 // 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. 93 // initialized, check to see if we're running as root and bail if we are.
94 if (getuid() != 0) 94 if (getuid() != 0)
(...skipping 10 matching lines...) Expand all
105 IDS_REFUSE_TO_RUN_AS_ROOT_2, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); 105 IDS_REFUSE_TO_RUN_AS_ROOT_2, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
106 106
107 chrome::ShowWarningMessageBox(NULL, title, message); 107 chrome::ShowWarningMessageBox(NULL, title, message);
108 108
109 // Avoids gpu_process_transport_factory.cc(153)] Check failed: 109 // Avoids gpu_process_transport_factory.cc(153)] Check failed:
110 // per_compositor_data_.empty() when quit is chosen. 110 // per_compositor_data_.empty() when quit is chosen.
111 base::RunLoop().RunUntilIdle(); 111 base::RunLoop().RunUntilIdle();
112 112
113 exit(EXIT_FAILURE); 113 exit(EXIT_FAILURE);
114 } 114 }
OLDNEW
« no previous file with comments | « no previous file | ui/base/material_design/material_design_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698