| OLD | NEW |
| 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 "ui/base/material_design/material_design_controller.h" | 5 #include "ui/base/material_design/material_design_controller.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 switches::kExtendMdToSecondaryUi); | 59 switches::kExtendMdToSecondaryUi); |
| 60 } | 60 } |
| 61 | 61 |
| 62 // static | 62 // static |
| 63 MaterialDesignController::Mode MaterialDesignController::GetMode() { | 63 MaterialDesignController::Mode MaterialDesignController::GetMode() { |
| 64 CHECK(is_mode_initialized_); | 64 CHECK(is_mode_initialized_); |
| 65 return mode_; | 65 return mode_; |
| 66 } | 66 } |
| 67 | 67 |
| 68 // static | 68 // static |
| 69 bool MaterialDesignController::IsModeMaterial() { | |
| 70 return true; | |
| 71 } | |
| 72 | |
| 73 // static | |
| 74 bool MaterialDesignController::IsSecondaryUiMaterial() { | 69 bool MaterialDesignController::IsSecondaryUiMaterial() { |
| 75 return IsModeMaterial() && include_secondary_ui_; | 70 return include_secondary_ui_; |
| 76 } | 71 } |
| 77 | 72 |
| 78 // static | 73 // static |
| 79 MaterialDesignController::Mode MaterialDesignController::DefaultMode() { | 74 MaterialDesignController::Mode MaterialDesignController::DefaultMode() { |
| 80 #if defined(OS_CHROMEOS) | 75 #if defined(OS_CHROMEOS) |
| 81 // If a scan of available devices has already completed, use material-hybrid | 76 // If a scan of available devices has already completed, use material-hybrid |
| 82 // if a touchscreen is present. | 77 // if a touchscreen is present. |
| 83 if (DeviceDataManager::HasInstance() && | 78 if (DeviceDataManager::HasInstance() && |
| 84 DeviceDataManager::GetInstance()->AreDeviceListsComplete()) { | 79 DeviceDataManager::GetInstance()->AreDeviceListsComplete()) { |
| 85 return GetTouchScreensAvailability() == TouchScreensAvailability::ENABLED | 80 return GetTouchScreensAvailability() == TouchScreensAvailability::ENABLED |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 is_mode_initialized_ = false; | 112 is_mode_initialized_ = false; |
| 118 } | 113 } |
| 119 | 114 |
| 120 // static | 115 // static |
| 121 void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) { | 116 void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) { |
| 122 mode_ = mode; | 117 mode_ = mode; |
| 123 is_mode_initialized_ = true; | 118 is_mode_initialized_ = true; |
| 124 } | 119 } |
| 125 | 120 |
| 126 } // namespace ui | 121 } // namespace ui |
| OLD | NEW |