| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 void RuntimeAPI::StorePendingOnInstallInfoToPref(const Extension* extension) { | 314 void RuntimeAPI::StorePendingOnInstallInfoToPref(const Extension* extension) { |
| 315 ExtensionPrefs* prefs = ExtensionPrefs::Get(browser_context_); | 315 ExtensionPrefs* prefs = ExtensionPrefs::Get(browser_context_); |
| 316 DCHECK(prefs); | 316 DCHECK(prefs); |
| 317 | 317 |
| 318 // |pending_on_install_info| currently only contains a version string. Instead | 318 // |pending_on_install_info| currently only contains a version string. Instead |
| 319 // of making the pref hold a plain string, we store it as a dictionary value | 319 // of making the pref hold a plain string, we store it as a dictionary value |
| 320 // so that we can add more stuff to it in the future if necessary. | 320 // so that we can add more stuff to it in the future if necessary. |
| 321 std::unique_ptr<base::DictionaryValue> pending_on_install_info( | 321 std::unique_ptr<base::DictionaryValue> pending_on_install_info( |
| 322 new base::DictionaryValue()); | 322 new base::DictionaryValue()); |
| 323 base::Version previous_version = | 323 base::Version previous_version = |
| 324 delegate_->GetPreviousExtensionVersion(extension); | 324 ExtensionRegistry::Get(browser_context_)->GetVersion(extension); |
| 325 pending_on_install_info->SetString( | 325 pending_on_install_info->SetString( |
| 326 kPrefPreviousVersion, | 326 kPrefPreviousVersion, |
| 327 previous_version.IsValid() ? previous_version.GetString() : ""); | 327 previous_version.IsValid() ? previous_version.GetString() : ""); |
| 328 prefs->UpdateExtensionPref(extension->id(), | 328 prefs->UpdateExtensionPref(extension->id(), |
| 329 kPrefPendingOnInstalledEventDispatchInfo, | 329 kPrefPendingOnInstalledEventDispatchInfo, |
| 330 std::move(pending_on_install_info)); | 330 std::move(pending_on_install_info)); |
| 331 } | 331 } |
| 332 | 332 |
| 333 void RuntimeAPI::ReloadExtension(const std::string& extension_id) { | 333 void RuntimeAPI::ReloadExtension(const std::string& extension_id) { |
| 334 delegate_->ReloadExtension(extension_id); | 334 delegate_->ReloadExtension(extension_id); |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 content::ChildProcessSecurityPolicy* policy = | 782 content::ChildProcessSecurityPolicy* policy = |
| 783 content::ChildProcessSecurityPolicy::GetInstance(); | 783 content::ChildProcessSecurityPolicy::GetInstance(); |
| 784 policy->GrantReadFileSystem(renderer_id, filesystem_id); | 784 policy->GrantReadFileSystem(renderer_id, filesystem_id); |
| 785 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 785 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 786 dict->SetString("fileSystemId", filesystem_id); | 786 dict->SetString("fileSystemId", filesystem_id); |
| 787 dict->SetString("baseName", relative_path); | 787 dict->SetString("baseName", relative_path); |
| 788 return RespondNow(OneArgument(std::move(dict))); | 788 return RespondNow(OneArgument(std::move(dict))); |
| 789 } | 789 } |
| 790 | 790 |
| 791 } // namespace extensions | 791 } // namespace extensions |
| OLD | NEW |