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

Side by Side Diff: ui/base/material_design/material_design_controller.cc

Issue 1943093002: [Mac][Material Design] Make Material Design the default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Disable Material Design controller tests. 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "ui/base/material_design/material_design_controller.h" 10 #include "ui/base/material_design/material_design_controller.h"
(...skipping 18 matching lines...) Expand all
29 29
30 MaterialDesignController::Mode MaterialDesignController::mode_ = 30 MaterialDesignController::Mode MaterialDesignController::mode_ =
31 MaterialDesignController::Mode::NON_MATERIAL; 31 MaterialDesignController::Mode::NON_MATERIAL;
32 32
33 // static 33 // static
34 void MaterialDesignController::Initialize() { 34 void MaterialDesignController::Initialize() {
35 TRACE_EVENT0("startup", "MaterialDesignController::InitializeMode"); 35 TRACE_EVENT0("startup", "MaterialDesignController::InitializeMode");
36 CHECK(!is_mode_initialized_); 36 CHECK(!is_mode_initialized_);
37 #if !defined(ENABLE_TOPCHROME_MD) 37 #if !defined(ENABLE_TOPCHROME_MD)
38 SetMode(Mode::NON_MATERIAL); 38 SetMode(Mode::NON_MATERIAL);
39 #elif defined(OS_MACOSX)
40 SetMode(Mode::MATERIAL_NORMAL);
tdanderson 2016/05/05 14:56:55 From my reading of the code, it looks like OSX doe
shrike 2016/05/05 16:10:51 Thank you. I felt like I had seen per-platform #de
39 #else 41 #else
40 const std::string switch_value = 42 const std::string switch_value =
41 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 43 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
42 switches::kTopChromeMD); 44 switches::kTopChromeMD);
43 45
44 if (switch_value == switches::kTopChromeMDMaterial) { 46 if (switch_value == switches::kTopChromeMDMaterial) {
45 SetMode(Mode::MATERIAL_NORMAL); 47 SetMode(Mode::MATERIAL_NORMAL);
46 } else if (switch_value == switches::kTopChromeMDMaterialHybrid) { 48 } else if (switch_value == switches::kTopChromeMDMaterialHybrid) {
47 SetMode(Mode::MATERIAL_HYBRID); 49 SetMode(Mode::MATERIAL_HYBRID);
48 } else if (switch_value == switches::kTopChromeMDNonMaterial) { 50 } else if (switch_value == switches::kTopChromeMDNonMaterial) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 is_mode_initialized_ = false; 111 is_mode_initialized_ = false;
110 } 112 }
111 113
112 // static 114 // static
113 void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) { 115 void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) {
114 mode_ = mode; 116 mode_ = mode;
115 is_mode_initialized_ = true; 117 is_mode_initialized_ = true;
116 } 118 }
117 119
118 } // namespace ui 120 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698