| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 int fd = open(path.value().c_str(), O_RDWR | O_NONBLOCK | O_CLOEXEC); | 101 int fd = open(path.value().c_str(), O_RDWR | O_NONBLOCK | O_CLOEXEC); |
| 102 if (fd >= 0) { | 102 if (fd >= 0) { |
| 103 if (devinfo.Initialize(fd, path) && devinfo.HasTouchscreen()) { | 103 if (devinfo.Initialize(fd, path) && devinfo.HasTouchscreen()) { |
| 104 close(fd); | 104 close(fd); |
| 105 return MATERIAL_HYBRID; | 105 return MATERIAL_HYBRID; |
| 106 } | 106 } |
| 107 close(fd); | 107 close(fd); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 #endif // defined(USE_OZONE) | 110 #endif // defined(USE_OZONE) |
| 111 #endif // defined(OS_CHROMEOS) |
| 112 |
| 111 return MATERIAL_NORMAL; | 113 return MATERIAL_NORMAL; |
| 112 #elif defined(OS_LINUX) || defined(OS_MACOSX) | |
| 113 return MATERIAL_NORMAL; | |
| 114 #else | |
| 115 return NON_MATERIAL; | |
| 116 #endif // defined(OS_CHROMEOS) | |
| 117 } | 114 } |
| 118 | 115 |
| 119 // static | 116 // static |
| 120 void MaterialDesignController::Uninitialize() { | 117 void MaterialDesignController::Uninitialize() { |
| 121 is_mode_initialized_ = false; | 118 is_mode_initialized_ = false; |
| 122 } | 119 } |
| 123 | 120 |
| 124 // static | 121 // static |
| 125 void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) { | 122 void MaterialDesignController::SetMode(MaterialDesignController::Mode mode) { |
| 126 mode_ = mode; | 123 mode_ = mode; |
| 127 is_mode_initialized_ = true; | 124 is_mode_initialized_ = true; |
| 128 } | 125 } |
| 129 | 126 |
| 130 } // namespace ui | 127 } // namespace ui |
| OLD | NEW |