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 <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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 bool MaterialDesignController::IsSecondaryUiMaterial() { | 75 bool MaterialDesignController::IsSecondaryUiMaterial() { |
76 return IsModeMaterial() && include_secondary_ui_; | 76 return IsModeMaterial() && include_secondary_ui_; |
77 } | 77 } |
78 | 78 |
79 // static | 79 // static |
80 MaterialDesignController::Mode MaterialDesignController::DefaultMode() { | 80 MaterialDesignController::Mode MaterialDesignController::DefaultMode() { |
81 #if defined(OS_CHROMEOS) | 81 #if defined(OS_CHROMEOS) |
82 // If a scan of available devices has already completed, use material-hybrid | 82 // If a scan of available devices has already completed, use material-hybrid |
83 // if a touchscreen is present. | 83 // if a touchscreen is present. |
84 if (DeviceDataManager::HasInstance() && | 84 if (DeviceDataManager::HasInstance() && |
85 DeviceDataManager::GetInstance()->device_lists_complete()) { | 85 DeviceDataManager::GetInstance()->AreDeviceListsComplete()) { |
86 return GetTouchScreensAvailability() == TouchScreensAvailability::ENABLED | 86 return GetTouchScreensAvailability() == TouchScreensAvailability::ENABLED |
87 ? MATERIAL_HYBRID | 87 ? MATERIAL_HYBRID |
88 : MATERIAL_NORMAL; | 88 : MATERIAL_NORMAL; |
89 } | 89 } |
90 | 90 |
91 #if defined(USE_OZONE) | 91 #if defined(USE_OZONE) |
92 // Otherwise perform our own scan to determine the presence of a touchscreen. | 92 // Otherwise perform our own scan to determine the presence of a touchscreen. |
93 // Note this is a one-time call that occurs during device startup or restart. | 93 // Note this is a one-time call that occurs during device startup or restart. |
94 base::ThreadRestrictions::ScopedAllowIO allow_io; | 94 base::ThreadRestrictions::ScopedAllowIO allow_io; |
95 base::FileEnumerator file_enum( | 95 base::FileEnumerator file_enum( |
(...skipping 22 matching lines...) Expand all Loading... |
118 is_mode_initialized_ = false; | 118 is_mode_initialized_ = false; |
119 } | 119 } |
120 | 120 |
121 // static | 121 // static |
122 void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) { | 122 void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) { |
123 mode_ = mode; | 123 mode_ = mode; |
124 is_mode_initialized_ = true; | 124 is_mode_initialized_ = true; |
125 } | 125 } |
126 | 126 |
127 } // namespace ui | 127 } // namespace ui |
OLD | NEW |