summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraltimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-10 09:02:54 +0000
committeraltimofeev@chromium.org <altimofeev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-10 09:02:54 +0000
commit2894f1ccc372b13840e8d5f0f2730f985af6ad3e (patch)
treef628ba2f6e4a253c815cfc1e66b2070f8597e7b3
parent1a6178883cdedae4e417c219f133fa6a7151d59e (diff)
downloadchromium_src-2894f1ccc372b13840e8d5f0f2730f985af6ad3e.zip
chromium_src-2894f1ccc372b13840e8d5f0f2730f985af6ad3e.tar.gz
chromium_src-2894f1ccc372b13840e8d5f0f2730f985af6ad3e.tar.bz2
Do not use AppLaunchHandler after destruction.
This prevents browser from crashing. BUG=chromium-os:12374 TEST=no crashes Review URL: http://codereview.chromium.org/6650027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77615 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/webui/app_launcher_handler.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/ui/webui/app_launcher_handler.cc b/chrome/browser/ui/webui/app_launcher_handler.cc
index afbd318..5d2155ce 100644
--- a/chrome/browser/ui/webui/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/app_launcher_handler.cc
@@ -340,6 +340,12 @@ void AppLauncherHandler::HandleLaunchApp(const ListValue* args) {
WindowOpenDisposition disposition =
disposition_utils::DispositionFromClick(middle_button, alt_key,
ctrl_key, meta_key, shift_key);
+
+ if (extension_id != extension_misc::kWebStoreAppId) {
+ RecordAppLaunchByID(promo_active_, launch_bucket);
+ extensions_service_->default_apps()->SetPromoHidden();
+ }
+
if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) {
// TODO(jamescook): Proper support for background tabs.
Browser::OpenApplication(
@@ -365,14 +371,11 @@ void AppLauncherHandler::HandleLaunchApp(const ListValue* args) {
TabContents* new_contents = Browser::OpenApplication(
profile, extension, launch_container, old_contents);
+ // This will also destroy the handler, so do not perform any actions after.
if (new_contents != old_contents && browser->tab_count() > 1)
browser->CloseTabContents(old_contents);
}
- if (extension_id != extension_misc::kWebStoreAppId) {
- RecordAppLaunchByID(promo_active_, launch_bucket);
- extensions_service_->default_apps()->SetPromoHidden();
- }
}
void AppLauncherHandler::HandleSetLaunchType(const ListValue* args) {