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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 BrailleDisplayPrivateAPI::BrailleDisplayPrivateAPI( | 44 BrailleDisplayPrivateAPI::BrailleDisplayPrivateAPI( |
45 content::BrowserContext* context) | 45 content::BrowserContext* context) |
46 : profile_(Profile::FromBrowserContext(context)), | 46 : profile_(Profile::FromBrowserContext(context)), |
47 scoped_observer_(this), | 47 scoped_observer_(this), |
48 event_delegate_(new DefaultEventDelegate(this, profile_)) {} | 48 event_delegate_(new DefaultEventDelegate(this, profile_)) {} |
49 | 49 |
50 BrailleDisplayPrivateAPI::~BrailleDisplayPrivateAPI() { | 50 BrailleDisplayPrivateAPI::~BrailleDisplayPrivateAPI() { |
51 } | 51 } |
52 | 52 |
53 void BrailleDisplayPrivateAPI::Shutdown() { | 53 void BrailleDisplayPrivateAPI::Shutdown() { |
| 54 event_delegate_.reset(); |
54 } | 55 } |
55 | 56 |
56 static base::LazyInstance< | 57 static base::LazyInstance< |
57 BrowserContextKeyedAPIFactory<BrailleDisplayPrivateAPI>>::DestructorAtExit | 58 BrowserContextKeyedAPIFactory<BrailleDisplayPrivateAPI>>::DestructorAtExit |
58 g_factory = LAZY_INSTANCE_INITIALIZER; | 59 g_factory = LAZY_INSTANCE_INITIALIZER; |
59 | 60 |
60 // static | 61 // static |
61 BrowserContextKeyedAPIFactory<BrailleDisplayPrivateAPI>* | 62 BrowserContextKeyedAPIFactory<BrailleDisplayPrivateAPI>* |
62 BrailleDisplayPrivateAPI::GetFactoryInstance() { | 63 BrailleDisplayPrivateAPI::GetFactoryInstance() { |
63 return g_factory.Pointer(); | 64 return g_factory.Pointer(); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 void BrailleDisplayPrivateWriteDotsFunction::Work() { | 179 void BrailleDisplayPrivateWriteDotsFunction::Work() { |
179 BrailleController::GetInstance()->WriteDots(params_->cells, params_->columns, | 180 BrailleController::GetInstance()->WriteDots(params_->cells, params_->columns, |
180 params_->rows); | 181 params_->rows); |
181 } | 182 } |
182 | 183 |
183 bool BrailleDisplayPrivateWriteDotsFunction::Respond() { | 184 bool BrailleDisplayPrivateWriteDotsFunction::Respond() { |
184 return true; | 185 return true; |
185 } | 186 } |
186 } // namespace api | 187 } // namespace api |
187 } // namespace extensions | 188 } // namespace extensions |
OLD | NEW |