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

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

Issue 2028593004: Add new InputDeviceManager interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_keyboard
Patch Set: Fix windows compile error. Created 4 years, 6 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/chromeos/device_keyboard_handler.cc ('k') | ui/base/touch/touch_device_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698