OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <string> |
| 6 |
| 7 #include "ash/ash_switches.h" |
| 8 #include "ash/material_design/material_design_controller.h" |
| 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" |
| 11 #include "base/trace_event/trace_event.h" |
| 12 |
| 13 namespace ash { |
| 14 |
| 15 bool MaterialDesignController::is_mode_initialized_ = false; |
| 16 bool MaterialDesignController::mode_ = false; |
| 17 |
| 18 // static |
| 19 void MaterialDesignController::Initialize() { |
| 20 TRACE_EVENT0("startup", "ash::MaterialDesignController::InitializeMode"); |
| 21 CHECK(!is_mode_initialized_); |
| 22 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 23 switches::kAshDisableMaterialDesign)) { |
| 24 SetMode(false); |
| 25 } else if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 26 switches::kAshEnableMaterialDesign)) { |
| 27 SetMode(true); |
| 28 } else { |
| 29 SetMode(DefaultMode()); |
| 30 } |
| 31 } |
| 32 |
| 33 // static |
| 34 bool MaterialDesignController::IsMaterial() { |
| 35 CHECK(is_mode_initialized_); |
| 36 return mode_; |
| 37 } |
| 38 |
| 39 // static |
| 40 bool MaterialDesignController::DefaultMode() { |
| 41 return false; |
| 42 } |
| 43 |
| 44 // static |
| 45 void MaterialDesignController::SetMode(bool mode) { |
| 46 mode_ = mode; |
| 47 is_mode_initialized_ = true; |
| 48 } |
| 49 |
| 50 // static |
| 51 void MaterialDesignController::Uninitialize() { |
| 52 is_mode_initialized_ = false; |
| 53 } |
| 54 |
| 55 } // namespace ui |
OLD | NEW |