OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/extensions/api/braille_display_private/braille_display_
private_api.h" | 5 #include "chrome/browser/extensions/api/braille_display_private/braille_display_
private_api.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 return (event_router->HasEventListener(OnDisplayStateChanged::kEventName) || | 144 return (event_router->HasEventListener(OnDisplayStateChanged::kEventName) || |
145 event_router->HasEventListener(OnKeyEvent::kEventName)); | 145 event_router->HasEventListener(OnKeyEvent::kEventName)); |
146 } | 146 } |
147 | 147 |
148 namespace api { | 148 namespace api { |
149 bool BrailleDisplayPrivateGetDisplayStateFunction::Prepare() { | 149 bool BrailleDisplayPrivateGetDisplayStateFunction::Prepare() { |
150 return true; | 150 return true; |
151 } | 151 } |
152 | 152 |
153 void BrailleDisplayPrivateGetDisplayStateFunction::Work() { | 153 void BrailleDisplayPrivateGetDisplayStateFunction::Work() { |
154 SetResult( | 154 SetResult(BrailleController::GetInstance()->GetDisplayState()->ToValue()); |
155 BrailleController::GetInstance()->GetDisplayState()->ToValue().release()); | |
156 } | 155 } |
157 | 156 |
158 bool BrailleDisplayPrivateGetDisplayStateFunction::Respond() { | 157 bool BrailleDisplayPrivateGetDisplayStateFunction::Respond() { |
159 return true; | 158 return true; |
160 } | 159 } |
161 | 160 |
162 BrailleDisplayPrivateWriteDotsFunction:: | 161 BrailleDisplayPrivateWriteDotsFunction:: |
163 BrailleDisplayPrivateWriteDotsFunction() { | 162 BrailleDisplayPrivateWriteDotsFunction() { |
164 } | 163 } |
165 | 164 |
166 BrailleDisplayPrivateWriteDotsFunction:: | 165 BrailleDisplayPrivateWriteDotsFunction:: |
167 ~BrailleDisplayPrivateWriteDotsFunction() { | 166 ~BrailleDisplayPrivateWriteDotsFunction() { |
168 } | 167 } |
169 | 168 |
170 bool BrailleDisplayPrivateWriteDotsFunction::Prepare() { | 169 bool BrailleDisplayPrivateWriteDotsFunction::Prepare() { |
171 params_ = WriteDots::Params::Create(*args_); | 170 params_ = WriteDots::Params::Create(*args_); |
172 EXTENSION_FUNCTION_VALIDATE(params_); | 171 EXTENSION_FUNCTION_VALIDATE(params_); |
173 return true; | 172 return true; |
174 } | 173 } |
175 | 174 |
176 void BrailleDisplayPrivateWriteDotsFunction::Work() { | 175 void BrailleDisplayPrivateWriteDotsFunction::Work() { |
177 BrailleController::GetInstance()->WriteDots(params_->cells); | 176 BrailleController::GetInstance()->WriteDots(params_->cells); |
178 } | 177 } |
179 | 178 |
180 bool BrailleDisplayPrivateWriteDotsFunction::Respond() { | 179 bool BrailleDisplayPrivateWriteDotsFunction::Respond() { |
181 return true; | 180 return true; |
182 } | 181 } |
183 } // namespace api | 182 } // namespace api |
184 } // namespace extensions | 183 } // namespace extensions |
OLD | NEW |