| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |