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

Side by Side Diff: chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.cc

Issue 1438513003: [MD] Implement incognito colors as a NativeTheme (for Aura). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: init param, pkasting feedback Created 5 years, 1 month 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 | chrome/browser/ui/views/frame/browser_frame.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 (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/aura/chrome_browser_main_extra_parts_aura.h" 5 #include "chrome/browser/ui/aura/chrome_browser_main_extra_parts_aura.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/ui/aura/active_desktop_monitor.h" 10 #include "chrome/browser/ui/aura/active_desktop_monitor.h"
11 #include "chrome/browser/ui/host_desktop.h" 11 #include "chrome/browser/ui/host_desktop.h"
12 #include "chrome/browser/ui/simple_message_box.h" 12 #include "chrome/browser/ui/simple_message_box.h"
13 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
14 #include "chrome/grit/chromium_strings.h" 14 #include "chrome/grit/chromium_strings.h"
15 #include "chrome/grit/generated_resources.h" 15 #include "chrome/grit/generated_resources.h"
16 #include "ui/aura/env.h" 16 #include "ui/aura/env.h"
17 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
18 #include "ui/base/ui_base_switches.h" 18 #include "ui/base/ui_base_switches.h"
19 #include "ui/gfx/screen.h" 19 #include "ui/gfx/screen.h"
20 #include "ui/views/widget/native_widget_aura.h" 20 #include "ui/views/widget/native_widget_aura.h"
21 21
22 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 22 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
23 #include "base/prefs/pref_service.h" 23 #include "base/prefs/pref_service.h"
24 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
25 #include "chrome/common/pref_names.h" 25 #include "chrome/common/pref_names.h"
26 #include "ui/aura/window.h" 26 #include "ui/aura/window.h"
27 #include "ui/base/ime/input_method_initializer.h" 27 #include "ui/base/ime/input_method_initializer.h"
28 #include "ui/native_theme/native_theme_aura.h" 28 #include "ui/native_theme/native_theme_aura.h"
29 #include "ui/native_theme/native_theme_dark_aura.h"
29 #include "ui/views/linux_ui/linux_ui.h" 30 #include "ui/views/linux_ui/linux_ui.h"
30 #endif 31 #endif
31 32
32 #if defined(USE_X11) && !defined(OS_CHROMEOS) 33 #if defined(USE_X11) && !defined(OS_CHROMEOS)
33 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" 34 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
34 #endif 35 #endif
35 36
36 #if defined(USE_ASH) 37 #if defined(USE_ASH)
37 #include "chrome/browser/ui/ash/ash_util.h" 38 #include "chrome/browser/ui/ash/ash_util.h"
38 #endif // defined(USE_ASH) 39 #endif // defined(USE_ASH)
(...skipping 10 matching lines...) Expand all
49 return nullptr; 50 return nullptr;
50 51
51 Profile* profile = nullptr; 52 Profile* profile = nullptr;
52 if (window->type() == ui::wm::WINDOW_TYPE_NORMAL || 53 if (window->type() == ui::wm::WINDOW_TYPE_NORMAL ||
53 window->type() == ui::wm::WINDOW_TYPE_POPUP || 54 window->type() == ui::wm::WINDOW_TYPE_POPUP ||
54 window->type() == ui::wm::WINDOW_TYPE_CONTROL) { 55 window->type() == ui::wm::WINDOW_TYPE_CONTROL) {
55 profile = reinterpret_cast<Profile*>( 56 profile = reinterpret_cast<Profile*>(
56 window->GetNativeWindowProperty(Profile::kProfileKey)); 57 window->GetNativeWindowProperty(Profile::kProfileKey));
57 } 58 }
58 59
59 if (profile && !profile->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme)) 60 if (profile && !profile->GetPrefs()->GetBoolean(prefs::kUsesSystemTheme)) {
60 return ui::NativeThemeAura::instance(); 61 return profile->IsOffTheRecord() ? ui::NativeThemeDarkAura::instance()
62 : ui::NativeThemeAura::instance();
63 }
61 64
62 return nullptr; 65 return nullptr;
63 } 66 }
64 #endif 67 #endif
65 68
66 #if !defined(OS_CHROMEOS) && defined(USE_ASH) 69 #if !defined(OS_CHROMEOS) && defined(USE_ASH)
67 // Returns the desktop this process was initially launched in. 70 // Returns the desktop this process was initially launched in.
68 chrome::HostDesktopType GetInitialDesktop() { 71 chrome::HostDesktopType GetInitialDesktop() {
69 #if defined(OS_WIN) && defined(USE_ASH) 72 #if defined(OS_WIN) && defined(USE_ASH)
70 const base::CommandLine* command_line = 73 const base::CommandLine* command_line =
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 chrome::MESSAGE_BOX_TYPE_WARNING); 178 chrome::MESSAGE_BOX_TYPE_WARNING);
176 179
177 // Avoids gpu_process_transport_factory.cc(153)] Check failed: 180 // Avoids gpu_process_transport_factory.cc(153)] Check failed:
178 // per_compositor_data_.empty() when quit is chosen. 181 // per_compositor_data_.empty() when quit is chosen.
179 base::RunLoop().RunUntilIdle(); 182 base::RunLoop().RunUntilIdle();
180 183
181 exit(EXIT_FAILURE); 184 exit(EXIT_FAILURE);
182 } 185 }
183 } 186 }
184 #endif 187 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698