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

Unified Diff: chrome/browser/ui/browser.cc

Issue 6794035: Move dispatching and sending of the last extension specific messages out of TabContents and Rende... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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/browser.cc
===================================================================
--- chrome/browser/ui/browser.cc (revision 80315)
+++ chrome/browser/ui/browser.cc (working copy)
@@ -1803,7 +1803,7 @@
// Start fetching web app info for CreateApplicationShortcut dialog and show
// the dialog when the data is available in OnDidGetApplicationInfo.
- current_tab->render_view_host()->GetApplicationInfo(entry->page_id());
+ current_tab->extension_tab_helper()->GetApplicationInfo(entry->page_id());
#else
NOTIMPLEMENTED();
#endif
@@ -2935,7 +2935,8 @@
// malware site etc). When this happens, we abort the shortcut update.
NavigationEntry* entry = source->controller().GetLastCommittedEntry();
if (entry) {
- source->render_view_host()->GetApplicationInfo(entry->page_id());
+ TabContentsWrapper::GetCurrentWrapperForContents(source)->
+ extension_tab_helper()->GetApplicationInfo(entry->page_id());
} else {
pending_web_app_action_ = NONE;
}
@@ -3236,23 +3237,42 @@
return !IsApplication();
}
-void Browser::OnDidGetApplicationInfo(TabContents* tab_contents,
+void Browser::ContentRestrictionsChanged(TabContents* source) {
+ UpdateCommandsForContentRestrictionState();
+}
+
+void Browser::WorkerCrashed() {
+ TabContents* tab_contents = GetSelectedTabContents();
+ if (!tab_contents)
+ return;
+ tab_contents->AddInfoBar(new SimpleAlertInfoBarDelegate(tab_contents, NULL,
+ l10n_util::GetStringUTF16(IDS_WEBWORKER_CRASHED_PROMPT), true));
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// Browser, TabContentsWrapperDelegate implementation:
+
+void Browser::URLStarredChanged(TabContentsWrapper* source, bool starred) {
+ if (source == GetSelectedTabContentsWrapper())
+ window_->SetStarredState(starred);
+}
+
+void Browser::OnDidGetApplicationInfo(TabContentsWrapper* source,
int32 page_id) {
- TabContentsWrapper* current_tab = GetSelectedTabContentsWrapper();
- if (current_tab->tab_contents() != tab_contents)
+ if (GetSelectedTabContentsWrapper() != source)
return;
- NavigationEntry* entry = current_tab->controller().GetLastCommittedEntry();
+ NavigationEntry* entry = source->controller().GetLastCommittedEntry();
if (!entry || (entry->page_id() != page_id))
return;
switch (pending_web_app_action_) {
case CREATE_SHORTCUT: {
- window()->ShowCreateWebAppShortcutsDialog(current_tab);
+ window()->ShowCreateWebAppShortcutsDialog(source);
break;
}
case UPDATE_SHORTCUT: {
- web_app::UpdateShortcutForTabContents(current_tab);
+ web_app::UpdateShortcutForTabContents(source);
break;
}
default:
@@ -3263,7 +3283,7 @@
pending_web_app_action_ = NONE;
}
-void Browser::OnInstallApplication(TabContents* source,
+void Browser::OnInstallApplication(TabContentsWrapper* source,
const WebApplicationInfo& web_app) {
ExtensionService* extensions_service = profile()->GetExtensionService();
if (!extensions_service)
@@ -3276,27 +3296,7 @@
installer->InstallWebApp(web_app);
}
-void Browser::ContentRestrictionsChanged(TabContents* source) {
- UpdateCommandsForContentRestrictionState();
-}
-
-void Browser::WorkerCrashed() {
- TabContents* tab_contents = GetSelectedTabContents();
- if (!tab_contents)
- return;
- tab_contents->AddInfoBar(new SimpleAlertInfoBarDelegate(tab_contents, NULL,
- l10n_util::GetStringUTF16(IDS_WEBWORKER_CRASHED_PROMPT), true));
-}
-
///////////////////////////////////////////////////////////////////////////////
-// Browser, TabContentsWrapperDelegate implementation:
-
-void Browser::URLStarredChanged(TabContentsWrapper* source, bool starred) {
- if (source == GetSelectedTabContentsWrapper())
- window_->SetStarredState(starred);
-}
-
-///////////////////////////////////////////////////////////////////////////////
// Browser, SearchEngineTabHelperDelegate implementation:
void Browser::ConfirmSetDefaultSearchProvider(

Powered by Google App Engine
This is Rietveld 408576698