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 21 matching lines...) Expand all Loading... |
32 virtual ~DefaultEventDelegate(); | 32 virtual ~DefaultEventDelegate(); |
33 | 33 |
34 virtual void BroadcastEvent(scoped_ptr<Event> event) OVERRIDE; | 34 virtual void BroadcastEvent(scoped_ptr<Event> event) OVERRIDE; |
35 virtual bool HasListener() OVERRIDE; | 35 virtual bool HasListener() OVERRIDE; |
36 | 36 |
37 private: | 37 private: |
38 EventRouter::Observer* observer_; | 38 EventRouter::Observer* observer_; |
39 Profile* profile_; | 39 Profile* profile_; |
40 }; | 40 }; |
41 | 41 |
42 BrailleDisplayPrivateAPI::BrailleDisplayPrivateAPI(Profile* profile) | 42 BrailleDisplayPrivateAPI::BrailleDisplayPrivateAPI( |
43 : profile_(profile), scoped_observer_(this), | 43 content::BrowserContext* context) |
44 event_delegate_(new DefaultEventDelegate(this, profile_)) { | 44 : profile_(Profile::FromBrowserContext(context)), |
45 } | 45 scoped_observer_(this), |
| 46 event_delegate_(new DefaultEventDelegate(this, profile_)) {} |
46 | 47 |
47 BrailleDisplayPrivateAPI::~BrailleDisplayPrivateAPI() { | 48 BrailleDisplayPrivateAPI::~BrailleDisplayPrivateAPI() { |
48 } | 49 } |
49 | 50 |
50 void BrailleDisplayPrivateAPI::Shutdown() { | 51 void BrailleDisplayPrivateAPI::Shutdown() { |
51 } | 52 } |
52 | 53 |
53 static base::LazyInstance<ProfileKeyedAPIFactory<BrailleDisplayPrivateAPI> > | 54 static base::LazyInstance<ProfileKeyedAPIFactory<BrailleDisplayPrivateAPI> > |
54 g_factory = LAZY_INSTANCE_INITIALIZER; | 55 g_factory = LAZY_INSTANCE_INITIALIZER; |
55 | 56 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 171 |
171 void BrailleDisplayPrivateWriteDotsFunction::Work() { | 172 void BrailleDisplayPrivateWriteDotsFunction::Work() { |
172 BrailleController::GetInstance()->WriteDots(params_->cells); | 173 BrailleController::GetInstance()->WriteDots(params_->cells); |
173 } | 174 } |
174 | 175 |
175 bool BrailleDisplayPrivateWriteDotsFunction::Respond() { | 176 bool BrailleDisplayPrivateWriteDotsFunction::Respond() { |
176 return true; | 177 return true; |
177 } | 178 } |
178 } // namespace api | 179 } // namespace api |
179 } // namespace extensions | 180 } // namespace extensions |
OLD | NEW |