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

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

Issue 1921133002: Adds ash::MaterialDesignController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
(Empty)
1 // Copyright 2015 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)) {
oshima 2016/04/26 05:56:37 By the way, I personally prefer not to have two fl
varkha 2016/04/26 15:06:02 oshima@, how strongly do you feel about it? I can
oshima 2016/04/26 16:06:57 I don't have strong feeling about this. This is ju
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698