OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extension_action/extension_action_api.h" | 5 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 void ExtensionActionAPI::Observer::OnExtensionActionAPIShuttingDown() { | 84 void ExtensionActionAPI::Observer::OnExtensionActionAPIShuttingDown() { |
85 } | 85 } |
86 | 86 |
87 ExtensionActionAPI::Observer::~Observer() { | 87 ExtensionActionAPI::Observer::~Observer() { |
88 } | 88 } |
89 | 89 |
90 // | 90 // |
91 // ExtensionActionAPI | 91 // ExtensionActionAPI |
92 // | 92 // |
93 | 93 |
94 static base::LazyInstance<BrowserContextKeyedAPIFactory<ExtensionActionAPI> > | 94 static base::LazyInstance<BrowserContextKeyedAPIFactory<ExtensionActionAPI>>:: |
95 g_factory = LAZY_INSTANCE_INITIALIZER; | 95 DestructorAtExit g_factory = LAZY_INSTANCE_INITIALIZER; |
96 | 96 |
97 ExtensionActionAPI::ExtensionActionAPI(content::BrowserContext* context) | 97 ExtensionActionAPI::ExtensionActionAPI(content::BrowserContext* context) |
98 : browser_context_(context), | 98 : browser_context_(context), |
99 extension_prefs_(nullptr) { | 99 extension_prefs_(nullptr) { |
100 ExtensionFunctionRegistry* registry = | 100 ExtensionFunctionRegistry* registry = |
101 ExtensionFunctionRegistry::GetInstance(); | 101 ExtensionFunctionRegistry::GetInstance(); |
102 | 102 |
103 // Browser Actions | 103 // Browser Actions |
104 registry->RegisterFunction<BrowserActionSetIconFunction>(); | 104 registry->RegisterFunction<BrowserActionSetIconFunction>(); |
105 registry->RegisterFunction<BrowserActionSetTitleFunction>(); | 105 registry->RegisterFunction<BrowserActionSetTitleFunction>(); |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 if (host->extension_host_type() != VIEW_TYPE_EXTENSION_POPUP || | 626 if (host->extension_host_type() != VIEW_TYPE_EXTENSION_POPUP || |
627 host->extension()->id() != extension_->id()) | 627 host->extension()->id() != extension_->id()) |
628 return; | 628 return; |
629 | 629 |
630 SendResponse(true); | 630 SendResponse(true); |
631 response_sent_ = true; | 631 response_sent_ = true; |
632 registrar_.RemoveAll(); | 632 registrar_.RemoveAll(); |
633 } | 633 } |
634 | 634 |
635 } // namespace extensions | 635 } // namespace extensions |
OLD | NEW |