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

Side by Side Diff: ash/common/material_design/material_design_controller.cc

Issue 2435903002: Move tray code from ui/chromeos/network/ (Closed)
Patch Set: Rebase Created 4 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 | « ash/ash_chromeos_strings.grdp ('k') | ash/common/system/chromeos/network/DEPS » ('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 <string> 5 #include <string>
6 6
7 #include "ash/common/ash_switches.h" 7 #include "ash/common/ash_switches.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/trace_event/trace_event.h" 11 #include "base/trace_event/trace_event.h"
12 12
13 #if defined(OS_CHROMEOS)
14 #include "ui/chromeos/material_design_icon_controller.h"
15 #endif // OS_CHROMEOS
16
17 namespace ash { 13 namespace ash {
18 14
19 namespace { 15 namespace {
20 MaterialDesignController::Mode mode_ = 16 MaterialDesignController::Mode mode_ =
21 MaterialDesignController::Mode::UNINITIALIZED; 17 MaterialDesignController::Mode::UNINITIALIZED;
22 } // namespace 18 } // namespace
23 19
24 // static 20 // static
25 void MaterialDesignController::Initialize() { 21 void MaterialDesignController::Initialize() {
26 TRACE_EVENT0("startup", "ash::MaterialDesignController::InitializeMode"); 22 TRACE_EVENT0("startup", "ash::MaterialDesignController::InitializeMode");
(...skipping 10 matching lines...) Expand all
37 } else if (switch_value == ash::switches::kAshMaterialDesignDisabled) { 33 } else if (switch_value == ash::switches::kAshMaterialDesignDisabled) {
38 SetMode(Mode::NON_MATERIAL); 34 SetMode(Mode::NON_MATERIAL);
39 } else { 35 } else {
40 if (!switch_value.empty()) { 36 if (!switch_value.empty()) {
41 LOG(ERROR) << "Invalid value='" << switch_value 37 LOG(ERROR) << "Invalid value='" << switch_value
42 << "' for command line switch '" 38 << "' for command line switch '"
43 << ash::switches::kAshMaterialDesign << "'."; 39 << ash::switches::kAshMaterialDesign << "'.";
44 } 40 }
45 SetMode(DefaultMode()); 41 SetMode(DefaultMode());
46 } 42 }
47
48 #if defined(OS_CHROMEOS)
49 ui::md_icon_controller::SetUseMaterialDesignNetworkIcons(
50 UseMaterialDesignSystemIcons());
51 #endif // OS_CHROMEOS
52 } 43 }
53 44
54 // static 45 // static
55 MaterialDesignController::Mode MaterialDesignController::GetMode() { 46 MaterialDesignController::Mode MaterialDesignController::GetMode() {
56 DCHECK_NE(mode_, Mode::UNINITIALIZED); 47 DCHECK_NE(mode_, Mode::UNINITIALIZED);
57 return mode_; 48 return mode_;
58 } 49 }
59 50
60 // static 51 // static
61 bool MaterialDesignController::IsShelfMaterial() { 52 bool MaterialDesignController::IsShelfMaterial() {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 void MaterialDesignController::SetMode(Mode mode) { 97 void MaterialDesignController::SetMode(Mode mode) {
107 mode_ = mode; 98 mode_ = mode;
108 } 99 }
109 100
110 // static 101 // static
111 void MaterialDesignController::Uninitialize() { 102 void MaterialDesignController::Uninitialize() {
112 mode_ = Mode::UNINITIALIZED; 103 mode_ = Mode::UNINITIALIZED;
113 } 104 }
114 105
115 } // namespace ash 106 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_chromeos_strings.grdp ('k') | ash/common/system/chromeos/network/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698