Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(966)

Unified Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.h

Issue 10641017: make "reload" on chrome://extensions automatically relaunch running apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: restrict to platform apps Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/extensions/extension_settings_handler.h
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.h b/chrome/browser/ui/webui/extensions/extension_settings_handler.h
index 3c6da670a86703bd23eaeb90881e873d1a6103ef..030f9b3186b0da408ff64a1b97f0f94e9b460ecd 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.h
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.h
@@ -11,6 +11,7 @@
#include <vector>
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/extensions/extension_install_ui.h"
#include "chrome/browser/extensions/extension_uninstall_dialog.h"
#include "chrome/browser/extensions/extension_warning_set.h"
@@ -105,6 +106,9 @@ class ExtensionSettingsHandler : public content::WebUIMessageHandler,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // Launches the application described by |extension_id|.
+ void LaunchApplication(const std::string& extension_id);
+
// ExtensionUninstallDialog::Delegate implementation, used for receiving
// notification about uninstall confirmation dialog selections.
virtual void ExtensionUninstallAccepted() OVERRIDE;
@@ -113,6 +117,9 @@ class ExtensionSettingsHandler : public content::WebUIMessageHandler,
// Helper method that reloads all unpacked extensions.
void ReloadUnpackedExtensions();
+ // Reloads the given extension.
+ void ReloadExtension(const extensions::Extension* extension);
+
// Callback for "requestExtensionsData" message.
void HandleRequestExtensionsData(const base::ListValue* args);
@@ -213,10 +220,16 @@ class ExtensionSettingsHandler : public content::WebUIMessageHandler,
// we do so only once.
bool registered_for_notifications_;
+ // A list of apps for which we have triggered reload. They will be re-launched
+ // when loaded again.
+ std::list<std::string> relaunch_app_ids_;
+
content::NotificationRegistrar registrar_;
PrefChangeRegistrar pref_registrar_;
+ base::WeakPtrFactory<ExtensionSettingsHandler> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsHandler);
};

Powered by Google App Engine
This is Rietveld 408576698