OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/runtime/runtime_api.h" | 5 #include "extensions/browser/api/runtime/runtime_api.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 const std::string& extension_id) { | 163 const std::string& extension_id) { |
164 std::string url_string; | 164 std::string url_string; |
165 prefs->ReadPrefAsString(extension_id, kUninstallUrl, &url_string); | 165 prefs->ReadPrefAsString(extension_id, kUninstallUrl, &url_string); |
166 return url_string; | 166 return url_string; |
167 } | 167 } |
168 | 168 |
169 } // namespace | 169 } // namespace |
170 | 170 |
171 /////////////////////////////////////////////////////////////////////////////// | 171 /////////////////////////////////////////////////////////////////////////////// |
172 | 172 |
173 static base::LazyInstance<BrowserContextKeyedAPIFactory<RuntimeAPI> > | 173 static base::LazyInstance< |
174 g_factory = LAZY_INSTANCE_INITIALIZER; | 174 BrowserContextKeyedAPIFactory<RuntimeAPI>>::DestructorAtExit g_factory = |
| 175 LAZY_INSTANCE_INITIALIZER; |
175 | 176 |
176 // static | 177 // static |
177 BrowserContextKeyedAPIFactory<RuntimeAPI>* RuntimeAPI::GetFactoryInstance() { | 178 BrowserContextKeyedAPIFactory<RuntimeAPI>* RuntimeAPI::GetFactoryInstance() { |
178 return g_factory.Pointer(); | 179 return g_factory.Pointer(); |
179 } | 180 } |
180 | 181 |
181 // static | 182 // static |
182 void RuntimeAPI::RegisterPrefs(PrefRegistrySimple* registry) { | 183 void RuntimeAPI::RegisterPrefs(PrefRegistrySimple* registry) { |
183 registry->RegisterBooleanPref(kPrefLastRestartWasDueToDelayedRestartApi, | 184 registry->RegisterBooleanPref(kPrefLastRestartWasDueToDelayedRestartApi, |
184 false); | 185 false); |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 content::ChildProcessSecurityPolicy* policy = | 782 content::ChildProcessSecurityPolicy* policy = |
782 content::ChildProcessSecurityPolicy::GetInstance(); | 783 content::ChildProcessSecurityPolicy::GetInstance(); |
783 policy->GrantReadFileSystem(renderer_id, filesystem_id); | 784 policy->GrantReadFileSystem(renderer_id, filesystem_id); |
784 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 785 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
785 dict->SetString("fileSystemId", filesystem_id); | 786 dict->SetString("fileSystemId", filesystem_id); |
786 dict->SetString("baseName", relative_path); | 787 dict->SetString("baseName", relative_path); |
787 return RespondNow(OneArgument(std::move(dict))); | 788 return RespondNow(OneArgument(std::move(dict))); |
788 } | 789 } |
789 | 790 |
790 } // namespace extensions | 791 } // namespace extensions |
OLD | NEW |