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

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

Issue 1395193002: Fixes BrowserViewHostedAppTest.Layout when using MD (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes BrowserViewHostedAppTest.Layout when using MD Created 5 years, 2 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 "ui/base/resource/material_design/material_design_controller.h" 9 #include "ui/base/resource/material_design/material_design_controller.h"
10 #include "ui/base/ui_base_switches.h" 10 #include "ui/base/ui_base_switches.h"
(...skipping 25 matching lines...) Expand all
36 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 36 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
37 switches::kTopChromeMD); 37 switches::kTopChromeMD);
38 38
39 if (switch_value == switches::kTopChromeMDMaterial) { 39 if (switch_value == switches::kTopChromeMDMaterial) {
40 SetMode(Mode::MATERIAL_NORMAL); 40 SetMode(Mode::MATERIAL_NORMAL);
41 } else if (switch_value == switches::kTopChromeMDMaterialHybrid) { 41 } else if (switch_value == switches::kTopChromeMDMaterialHybrid) {
42 SetMode(Mode::MATERIAL_HYBRID); 42 SetMode(Mode::MATERIAL_HYBRID);
43 } else if (switch_value == switches::kTopChromeMDNonMaterial) { 43 } else if (switch_value == switches::kTopChromeMDNonMaterial) {
44 SetMode(Mode::NON_MATERIAL); 44 SetMode(Mode::NON_MATERIAL);
45 } else { 45 } else {
46 LOG(ERROR) << "Invalid value='" << switch_value 46 SetMode(Mode::MATERIAL_NORMAL);
47 << "' for command line switch '" << switches::kTopChromeMD
48 << "'.";
49 SetMode(Mode::NON_MATERIAL);
50 } 47 }
51 #endif // !defined(ENABLE_TOPCHROME_MD) 48 #endif // !defined(ENABLE_TOPCHROME_MD)
52 } 49 }
53 50
54 void MaterialDesignController::UninitializeMode() { 51 void MaterialDesignController::UninitializeMode() {
55 MaterialDesignController::SetMode( 52 MaterialDesignController::SetMode(
56 MaterialDesignController::Mode::NON_MATERIAL); 53 MaterialDesignController::Mode::NON_MATERIAL);
57 is_mode_initialized_ = false; 54 is_mode_initialized_ = false;
58 } 55 }
59 56
60 void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) { 57 void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) {
61 mode_ = mode; 58 mode_ = mode;
62 is_mode_initialized_ = true; 59 is_mode_initialized_ = true;
63 } 60 }
64 61
65 } // namespace ui 62 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698