summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 23:14:02 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-29 23:14:02 +0000
commit9adb9693e8a90bb63be325dbb5d3391f47f839ba (patch)
tree555765afd7bc851de6f3a2bf4a35151435d58d77 /chrome/browser/dom_ui
parent5b5a5c976aead85a87ced0847c068012d3979cae (diff)
downloadchromium_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')
-rw-r--r--chrome/browser/dom_ui/app_launcher_handler.cc14
-rw-r--r--chrome/browser/dom_ui/app_launcher_handler.h4
2 files changed, 9 insertions, 9 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;
diff --git a/chrome/browser/dom_ui/app_launcher_handler.h b/chrome/browser/dom_ui/app_launcher_handler.h
index c3ca622..5a3478e 100644
--- a/chrome/browser/dom_ui/app_launcher_handler.h
+++ b/chrome/browser/dom_ui/app_launcher_handler.h
@@ -42,7 +42,7 @@ class AppLauncherHandler
const NotificationDetails& details);
// Populate a dictionary with the information from an extension.
- static void CreateAppInfo(Extension* extension,
+ static void CreateAppInfo(const Extension* extension,
ExtensionPrefs* extension_prefs,
DictionaryValue* value);
@@ -75,7 +75,7 @@ class AppLauncherHandler
ExtensionInstallUI* GetExtensionInstallUI();
// Starts the animation of the app icon.
- void AnimateAppIcon(Extension* extension, const gfx::Rect& rect);
+ void AnimateAppIcon(const Extension* extension, const gfx::Rect& rect);
// The apps are represented in the extensions model.
scoped_refptr<ExtensionsService> extensions_service_;