diff options
Diffstat (limited to 'chrome/browser/ui/browser.cc')
-rw-r--r-- | chrome/browser/ui/browser.cc | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 938605a..c0bdf7b 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -1803,7 +1803,7 @@ void Browser::OpenCreateShortcutsDialog() { // 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 @@ -2940,7 +2940,8 @@ void Browser::LoadingStateChanged(TabContents* source) { // 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; } @@ -3241,23 +3242,42 @@ bool Browser::ShouldAddNavigationToHistory( 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: @@ -3268,7 +3288,7 @@ void Browser::OnDidGetApplicationInfo(TabContents* tab_contents, 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) @@ -3281,26 +3301,6 @@ void Browser::OnInstallApplication(TabContents* source, 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: |