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 "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
8 #include "base/profiler/scoped_profile.h" | |
9 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" | 8 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" |
10 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
12 | 11 |
13 #if defined(OS_CHROMEOS) | 12 #if defined(OS_CHROMEOS) |
14 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 13 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
15 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 14 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
16 #endif | 15 #endif |
17 | 16 |
18 namespace OnDisplayStateChanged = | 17 namespace OnDisplayStateChanged = |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 #endif | 96 #endif |
98 } | 97 } |
99 | 98 |
100 void BrailleDisplayPrivateAPI::SetEventDelegateForTest( | 99 void BrailleDisplayPrivateAPI::SetEventDelegateForTest( |
101 scoped_ptr<EventDelegate> delegate) { | 100 scoped_ptr<EventDelegate> delegate) { |
102 event_delegate_ = delegate.Pass(); | 101 event_delegate_ = delegate.Pass(); |
103 } | 102 } |
104 | 103 |
105 void BrailleDisplayPrivateAPI::OnListenerAdded( | 104 void BrailleDisplayPrivateAPI::OnListenerAdded( |
106 const EventListenerInfo& details) { | 105 const EventListenerInfo& details) { |
107 // TODO(vadimt): Remove ScopedProfile below once crbug.com/417106 is fixed. | |
108 tracked_objects::ScopedProfile tracking_profile( | |
109 FROM_HERE_WITH_EXPLICIT_FUNCTION( | |
110 "BrailleDisplayPrivateAPI::OnListenerAdded")); | |
111 | |
112 BrailleController* braille_controller = BrailleController::GetInstance(); | 106 BrailleController* braille_controller = BrailleController::GetInstance(); |
113 if (!scoped_observer_.IsObserving(braille_controller)) | 107 if (!scoped_observer_.IsObserving(braille_controller)) |
114 scoped_observer_.Add(braille_controller); | 108 scoped_observer_.Add(braille_controller); |
115 } | 109 } |
116 | 110 |
117 void BrailleDisplayPrivateAPI::OnListenerRemoved( | 111 void BrailleDisplayPrivateAPI::OnListenerRemoved( |
118 const EventListenerInfo& details) { | 112 const EventListenerInfo& details) { |
119 BrailleController* braille_controller = BrailleController::GetInstance(); | 113 BrailleController* braille_controller = BrailleController::GetInstance(); |
120 if (!event_delegate_->HasListener() && | 114 if (!event_delegate_->HasListener() && |
121 scoped_observer_.IsObserving(braille_controller)) { | 115 scoped_observer_.IsObserving(braille_controller)) { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 170 |
177 void BrailleDisplayPrivateWriteDotsFunction::Work() { | 171 void BrailleDisplayPrivateWriteDotsFunction::Work() { |
178 BrailleController::GetInstance()->WriteDots(params_->cells); | 172 BrailleController::GetInstance()->WriteDots(params_->cells); |
179 } | 173 } |
180 | 174 |
181 bool BrailleDisplayPrivateWriteDotsFunction::Respond() { | 175 bool BrailleDisplayPrivateWriteDotsFunction::Respond() { |
182 return true; | 176 return true; |
183 } | 177 } |
184 } // namespace api | 178 } // namespace api |
185 } // namespace extensions | 179 } // namespace extensions |
OLD | NEW |