| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 registrar_.Add(this, | 168 registrar_.Add(this, |
| 169 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, | 169 extensions::NOTIFICATION_EXTENSIONS_READY_DEPRECATED, |
| 170 content::Source<BrowserContext>(context)); | 170 content::Source<BrowserContext>(context)); |
| 171 extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_)); | 171 extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_)); |
| 172 process_manager_observer_.Add(ProcessManager::Get(browser_context_)); | 172 process_manager_observer_.Add(ProcessManager::Get(browser_context_)); |
| 173 | 173 |
| 174 delegate_ = ExtensionsBrowserClient::Get()->CreateRuntimeAPIDelegate( | 174 delegate_ = ExtensionsBrowserClient::Get()->CreateRuntimeAPIDelegate( |
| 175 browser_context_); | 175 browser_context_); |
| 176 | 176 |
| 177 // Check if registered events are up-to-date. We can only do this once | 177 // Check if registered events are up to date. We can only do this once |
| 178 // per browser context, since it updates internal state when called. | 178 // per browser context, since it updates internal state when called. |
| 179 dispatch_chrome_updated_event_ = | 179 dispatch_chrome_updated_event_ = |
| 180 ExtensionsBrowserClient::Get()->DidVersionUpdate(browser_context_); | 180 ExtensionsBrowserClient::Get()->DidVersionUpdate(browser_context_); |
| 181 } | 181 } |
| 182 | 182 |
| 183 RuntimeAPI::~RuntimeAPI() { | 183 RuntimeAPI::~RuntimeAPI() { |
| 184 } | 184 } |
| 185 | 185 |
| 186 void RuntimeAPI::Observe(int type, | 186 void RuntimeAPI::Observe(int type, |
| 187 const content::NotificationSource& source, | 187 const content::NotificationSource& source, |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 content::ChildProcessSecurityPolicy* policy = | 579 content::ChildProcessSecurityPolicy* policy = |
| 580 content::ChildProcessSecurityPolicy::GetInstance(); | 580 content::ChildProcessSecurityPolicy::GetInstance(); |
| 581 policy->GrantReadFileSystem(renderer_id, filesystem_id); | 581 policy->GrantReadFileSystem(renderer_id, filesystem_id); |
| 582 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 582 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 583 dict->SetString("fileSystemId", filesystem_id); | 583 dict->SetString("fileSystemId", filesystem_id); |
| 584 dict->SetString("baseName", relative_path); | 584 dict->SetString("baseName", relative_path); |
| 585 return RespondNow(OneArgument(std::move(dict))); | 585 return RespondNow(OneArgument(std::move(dict))); |
| 586 } | 586 } |
| 587 | 587 |
| 588 } // namespace extensions | 588 } // namespace extensions |
| OLD | NEW |