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 "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" | 8 #include "chrome/browser/extensions/api/braille_display_private/braille_controll
er.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 : profile_(Profile::FromBrowserContext(context)), | 44 : profile_(Profile::FromBrowserContext(context)), |
45 scoped_observer_(this), | 45 scoped_observer_(this), |
46 event_delegate_(new DefaultEventDelegate(this, profile_)) {} | 46 event_delegate_(new DefaultEventDelegate(this, profile_)) {} |
47 | 47 |
48 BrailleDisplayPrivateAPI::~BrailleDisplayPrivateAPI() { | 48 BrailleDisplayPrivateAPI::~BrailleDisplayPrivateAPI() { |
49 } | 49 } |
50 | 50 |
51 void BrailleDisplayPrivateAPI::Shutdown() { | 51 void BrailleDisplayPrivateAPI::Shutdown() { |
52 } | 52 } |
53 | 53 |
54 static base::LazyInstance<ProfileKeyedAPIFactory<BrailleDisplayPrivateAPI> > | 54 static base::LazyInstance< |
55 g_factory = LAZY_INSTANCE_INITIALIZER; | 55 BrowserContextKeyedAPIFactory<BrailleDisplayPrivateAPI> > g_factory = |
| 56 LAZY_INSTANCE_INITIALIZER; |
56 | 57 |
57 // static | 58 // static |
58 ProfileKeyedAPIFactory<BrailleDisplayPrivateAPI>* | 59 BrowserContextKeyedAPIFactory<BrailleDisplayPrivateAPI>* |
59 BrailleDisplayPrivateAPI::GetFactoryInstance() { | 60 BrailleDisplayPrivateAPI::GetFactoryInstance() { |
60 return g_factory.Pointer(); | 61 return g_factory.Pointer(); |
61 } | 62 } |
62 | 63 |
63 void BrailleDisplayPrivateAPI::OnDisplayStateChanged( | 64 void BrailleDisplayPrivateAPI::OnDisplayStateChanged( |
64 const DisplayState& display_state) { | 65 const DisplayState& display_state) { |
65 scoped_ptr<Event> event(new Event( | 66 scoped_ptr<Event> event(new Event( |
66 OnDisplayStateChanged::kEventName, | 67 OnDisplayStateChanged::kEventName, |
67 OnDisplayStateChanged::Create(display_state))); | 68 OnDisplayStateChanged::Create(display_state))); |
68 event_delegate_->BroadcastEvent(event.Pass()); | 69 event_delegate_->BroadcastEvent(event.Pass()); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 172 |
172 void BrailleDisplayPrivateWriteDotsFunction::Work() { | 173 void BrailleDisplayPrivateWriteDotsFunction::Work() { |
173 BrailleController::GetInstance()->WriteDots(params_->cells); | 174 BrailleController::GetInstance()->WriteDots(params_->cells); |
174 } | 175 } |
175 | 176 |
176 bool BrailleDisplayPrivateWriteDotsFunction::Respond() { | 177 bool BrailleDisplayPrivateWriteDotsFunction::Respond() { |
177 return true; | 178 return true; |
178 } | 179 } |
179 } // namespace api | 180 } // namespace api |
180 } // namespace extensions | 181 } // namespace extensions |
OLD | NEW |