diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 21:22:03 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 21:22:03 +0000 |
commit | 85ff2c48df0789ae2476cd85738e07cecae9b3e3 (patch) | |
tree | d5a15f916376146d8626b92d97556c80627c9d0c /chrome/browser/extensions | |
parent | e2eb43115440dc442b92c5842274290caedb146f (diff) | |
download | chromium_src-85ff2c48df0789ae2476cd85738e07cecae9b3e3.zip chromium_src-85ff2c48df0789ae2476cd85738e07cecae9b3e3.tar.gz chromium_src-85ff2c48df0789ae2476cd85738e07cecae9b3e3.tar.bz2 |
Revert the Omnibox when changing tabs while its contents have been deleted.
To do this, I needed to add a new TabStripModelObserver call that fired before the tab had been changed, since when the Omnibox asks for the current permanent_text_ it gets it from the selected tab's navigation controller.
BUG=6850
Review URL: http://codereview.chromium.org/113983
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17241 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extension_browser_event_router.cc | 19 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_browser_event_router.h | 4 |
2 files changed, 12 insertions, 11 deletions
diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc index b3f81ca..e0848c2 100644 --- a/chrome/browser/extensions/extension_browser_event_router.cc +++ b/chrome/browser/extensions/extension_browser_event_router.cc @@ -81,14 +81,15 @@ ExtensionBrowserEventRouter* ExtensionBrowserEventRouter::GetInstance() { return Singleton<ExtensionBrowserEventRouter>::get(); } -static void DispatchEvent(Profile *profile, +static void DispatchEvent(Profile* profile, const char* event_name, const std::string json_args) { ExtensionMessageService::GetInstance(profile->GetRequestContext())-> DispatchEventToRenderers(event_name, json_args); } -static void DispatchSimpleBrowserEvent(Profile *profile, const int window_id, +static void DispatchSimpleBrowserEvent(Profile* profile, + const int window_id, const char* event_name) { ListValue args; args.Append(Value::CreateIntegerValue(window_id)); @@ -165,7 +166,7 @@ void ExtensionBrowserEventRouter::TabInsertedAt(TabContents* contents, ListValue args; args.Append(Value::CreateIntegerValue(tab_id)); - DictionaryValue *object_args = new DictionaryValue(); + DictionaryValue* object_args = new DictionaryValue(); object_args->Set(tab_keys::kNewWindowIdKey, Value::CreateIntegerValue( ExtensionTabUtil::GetWindowIdOfTab(contents))); object_args->Set(tab_keys::kNewPositionKey, Value::CreateIntegerValue( @@ -189,7 +190,7 @@ void ExtensionBrowserEventRouter::TabDetachedAt(TabContents* contents, ListValue args; args.Append(Value::CreateIntegerValue(tab_id)); - DictionaryValue *object_args = new DictionaryValue(); + DictionaryValue* object_args = new DictionaryValue(); object_args->Set(tab_keys::kOldWindowIdKey, Value::CreateIntegerValue( ExtensionTabUtil::GetWindowIdOfTab(contents))); object_args->Set(tab_keys::kOldPositionKey, Value::CreateIntegerValue( @@ -229,7 +230,7 @@ void ExtensionBrowserEventRouter::TabSelectedAt(TabContents* old_contents, args.Append(Value::CreateIntegerValue( ExtensionTabUtil::GetTabId(new_contents))); - DictionaryValue *object_args = new DictionaryValue(); + DictionaryValue* object_args = new DictionaryValue(); object_args->Set(tab_keys::kWindowIdKey, Value::CreateIntegerValue( ExtensionTabUtil::GetWindowIdOfTab(new_contents))); args.Append(object_args); @@ -247,7 +248,7 @@ void ExtensionBrowserEventRouter::TabMoved(TabContents* contents, ListValue args; args.Append(Value::CreateIntegerValue(ExtensionTabUtil::GetTabId(contents))); - DictionaryValue *object_args = new DictionaryValue(); + DictionaryValue* object_args = new DictionaryValue(); object_args->Set(tab_keys::kWindowIdKey, Value::CreateIntegerValue( ExtensionTabUtil::GetWindowIdOfTab(contents))); object_args->Set(tab_keys::kFromIndexKey, Value::CreateIntegerValue( @@ -309,15 +310,15 @@ void ExtensionBrowserEventRouter::TabChangedAt(TabContents* contents, void ExtensionBrowserEventRouter::TabStripEmpty() { } -void ExtensionBrowserEventRouter::PageActionExecuted(Profile *profile, +void ExtensionBrowserEventRouter::PageActionExecuted(Profile* profile, std::string page_action_id, int tab_id, std::string url) { ListValue args; - DictionaryValue *object_args = new DictionaryValue(); + DictionaryValue* object_args = new DictionaryValue(); object_args->Set(tab_keys::kPageActionIdKey, Value::CreateStringValue(page_action_id)); - DictionaryValue *data = new DictionaryValue(); + DictionaryValue* data = new DictionaryValue(); data->Set(tab_keys::kTabIdKey, Value::CreateIntegerValue(tab_id)); data->Set(tab_keys::kTabUrlKey, Value::CreateStringValue(url)); object_args->Set(tab_keys::kDataKey, data); diff --git a/chrome/browser/extensions/extension_browser_event_router.h b/chrome/browser/extensions/extension_browser_event_router.h index a818d32..034b2fd 100644 --- a/chrome/browser/extensions/extension_browser_event_router.h +++ b/chrome/browser/extensions/extension_browser_event_router.h @@ -49,7 +49,7 @@ class ExtensionBrowserEventRouter : public TabStripModelObserver, void TabStripEmpty(); // PageActions. - void PageActionExecuted(Profile *profile, + void PageActionExecuted(Profile* profile, std::string page_action_id, int tab_id, std::string url); @@ -64,7 +64,7 @@ class ExtensionBrowserEventRouter : public TabStripModelObserver, // Internal processing of tab updated events. Is called by both TabChangedAt // and Observe/NAV_ENTRY_COMMITTED. - void TabUpdated(TabContents *contents, bool did_navigate); + void TabUpdated(TabContents* contents, bool did_navigate); ExtensionBrowserEventRouter(); friend struct DefaultSingletonTraits<ExtensionBrowserEventRouter>; |