diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-29 23:14:02 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-29 23:14:02 +0000 |
commit | 9adb9693e8a90bb63be325dbb5d3391f47f839ba (patch) | |
tree | 555765afd7bc851de6f3a2bf4a35151435d58d77 /chrome/browser/dom_ui/app_launcher_handler.cc | |
parent | 5b5a5c976aead85a87ced0847c068012d3979cae (diff) | |
download | chromium_src-9adb9693e8a90bb63be325dbb5d3391f47f839ba.zip chromium_src-9adb9693e8a90bb63be325dbb5d3391f47f839ba.tar.gz chromium_src-9adb9693e8a90bb63be325dbb5d3391f47f839ba.tar.bz2 |
Part 3 of immutable Extension refactor.
Make ExtensionsService hold const Extension pointers only. This ensures that
extensions can't be modified after they're created, and lets us share them
between threads.
BUG=56558
TEST=no functional change
Review URL: http://codereview.chromium.org/4138006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64517 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/app_launcher_handler.cc')
-rw-r--r-- | chrome/browser/dom_ui/app_launcher_handler.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc index f3309c92..9bc27d2 100644 --- a/chrome/browser/dom_ui/app_launcher_handler.cc +++ b/chrome/browser/dom_ui/app_launcher_handler.cc @@ -44,7 +44,7 @@ bool ExtractInt(const ListValue* list, size_t index, int* out_int) { return false; } -std::string GetIconURL(Extension* extension, Extension::Icons icon, +std::string GetIconURL(const Extension* extension, Extension::Icons icon, const std::string& default_val) { GURL url = extension->GetIconURL(icon, ExtensionIconSet::MATCH_EXACTLY); if (!url.is_empty()) @@ -103,7 +103,7 @@ void AppLauncherHandler::Observe(NotificationType type, } // static -void AppLauncherHandler::CreateAppInfo(Extension* extension, +void AppLauncherHandler::CreateAppInfo(const Extension* extension, ExtensionPrefs* extension_prefs, DictionaryValue* value) { value->Clear(); @@ -202,7 +202,7 @@ void AppLauncherHandler::HandleLaunchApp(const ListValue* args) { dom_ui_->tab_contents()->GetContainerBounds(&tab_contents_bounds); rect.Offset(tab_contents_bounds.origin()); - Extension* extension = + const Extension* extension = extensions_service_->GetExtensionById(extension_id, false); DCHECK(extension); Profile* profile = extensions_service_->profile(); @@ -231,7 +231,7 @@ void AppLauncherHandler::HandleSetLaunchType(const ListValue* args) { return; } - Extension* extension = + const Extension* extension = extensions_service_->GetExtensionById(extension_id, false); DCHECK(extension); @@ -240,7 +240,7 @@ void AppLauncherHandler::HandleSetLaunchType(const ListValue* args) { static_cast<ExtensionPrefs::LaunchType>(launch_type)); } -void AppLauncherHandler::AnimateAppIcon(Extension* extension, +void AppLauncherHandler::AnimateAppIcon(const Extension* extension, const gfx::Rect& rect) { // We make this check for the case of minimized windows, unit tests, etc. if (platform_util::IsVisible(dom_ui_->tab_contents()->GetNativeView()) && @@ -255,7 +255,7 @@ void AppLauncherHandler::AnimateAppIcon(Extension* extension, void AppLauncherHandler::HandleUninstallApp(const ListValue* args) { std::string extension_id = WideToUTF8(ExtractStringValue(args)); - Extension* extension = extensions_service_->GetExtensionById( + const Extension* extension = extensions_service_->GetExtensionById( extension_id, false); if (!extension) return; @@ -295,7 +295,7 @@ void AppLauncherHandler::InstallUIProceed() { // The extension can be uninstalled in another window while the UI was // showing. Do nothing in that case. - Extension* extension = + const Extension* extension = extensions_service_->GetExtensionById(extension_id_prompting_, true); if (!extension) return; |