| 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/runtime/runtime_api.h" | 5 #include "chrome/browser/extensions/api/runtime/runtime_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 "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 std::string url_string; | 132 std::string url_string; |
| 133 prefs->ReadPrefAsString(extension_id, kUninstallUrl, &url_string); | 133 prefs->ReadPrefAsString(extension_id, kUninstallUrl, &url_string); |
| 134 return url_string; | 134 return url_string; |
| 135 } | 135 } |
| 136 #endif // defined(ENABLE_EXTENSIONS) | 136 #endif // defined(ENABLE_EXTENSIONS) |
| 137 | 137 |
| 138 } // namespace | 138 } // namespace |
| 139 | 139 |
| 140 /////////////////////////////////////////////////////////////////////////////// | 140 /////////////////////////////////////////////////////////////////////////////// |
| 141 | 141 |
| 142 static base::LazyInstance<ProfileKeyedAPIFactory<RuntimeAPI> > g_factory = | 142 static base::LazyInstance<BrowserContextKeyedAPIFactory<RuntimeAPI> > |
| 143 LAZY_INSTANCE_INITIALIZER; | 143 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 144 | 144 |
| 145 // static | 145 // static |
| 146 ProfileKeyedAPIFactory<RuntimeAPI>* RuntimeAPI::GetFactoryInstance() { | 146 BrowserContextKeyedAPIFactory<RuntimeAPI>* RuntimeAPI::GetFactoryInstance() { |
| 147 return g_factory.Pointer(); | 147 return g_factory.Pointer(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 RuntimeAPI::RuntimeAPI(content::BrowserContext* context) | 150 RuntimeAPI::RuntimeAPI(content::BrowserContext* context) |
| 151 : browser_context_(context), | 151 : browser_context_(context), |
| 152 dispatch_chrome_updated_event_(false), | 152 dispatch_chrome_updated_event_(false), |
| 153 registered_for_updates_(false) { | 153 registered_for_updates_(false) { |
| 154 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, | 154 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, |
| 155 content::Source<BrowserContext>(context)); | 155 content::Source<BrowserContext>(context)); |
| 156 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 156 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 content::ChildProcessSecurityPolicy::GetInstance(); | 591 content::ChildProcessSecurityPolicy::GetInstance(); |
| 592 policy->GrantReadFileSystem(renderer_id, filesystem_id); | 592 policy->GrantReadFileSystem(renderer_id, filesystem_id); |
| 593 base::DictionaryValue* dict = new base::DictionaryValue(); | 593 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 594 SetResult(dict); | 594 SetResult(dict); |
| 595 dict->SetString("fileSystemId", filesystem_id); | 595 dict->SetString("fileSystemId", filesystem_id); |
| 596 dict->SetString("baseName", relative_path); | 596 dict->SetString("baseName", relative_path); |
| 597 return true; | 597 return true; |
| 598 } | 598 } |
| 599 | 599 |
| 600 } // namespace extensions | 600 } // namespace extensions |
| OLD | NEW |