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

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

Issue 10699057: Move application creation and extension install prompt showing off Browser and onto ExtensionTabHel… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
===================================================================
--- chrome/browser/ui/browser.cc (revision 145357)
+++ chrome/browser/ui/browser.cc (working copy)
@@ -49,7 +49,6 @@
#include "chrome/browser/download/download_started_animation.h"
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/extensions/browser_extension_window_controller.h"
-#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/default_apps_trial.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_service.h"
@@ -308,7 +307,6 @@
initial_show_state_(ui::SHOW_STATE_DEFAULT),
is_session_restore_(false),
weak_factory_(this),
- pending_web_app_action_(NONE),
ALLOW_THIS_IN_INITIALIZER_LIST(
content_setting_bubble_model_delegate_(
new BrowserContentSettingBubbleModelDelegate(this))),
@@ -817,31 +815,6 @@
parent_window, NULL);
}
-void Browser::OpenCreateShortcutsDialog() {
- content::RecordAction(UserMetricsAction("CreateShortcut"));
-#if !defined(OS_MACOSX)
- TabContents* current_tab = chrome::GetActiveTabContents(this);
- DCHECK(current_tab &&
- web_app::IsValidUrl(current_tab->web_contents()->GetURL())) <<
- "Menu item should be disabled.";
-
- NavigationEntry* entry =
- current_tab->web_contents()->GetController().GetLastCommittedEntry();
- if (!entry)
- return;
-
- // RVH's GetApplicationInfo should not be called before it returns.
- DCHECK(pending_web_app_action_ == NONE);
- pending_web_app_action_ = CREATE_SHORTCUT;
-
- // Start fetching web app info for CreateApplicationShortcut dialog and show
- // the dialog when the data is available in OnDidGetApplicationInfo.
- current_tab->extension_tab_helper()->GetApplicationInfo(entry->GetPageID());
-#else
- NOTIMPLEMENTED();
-#endif
-}
-
void Browser::UpdateDownloadShelfVisibility(bool visible) {
if (GetStatusBubble())
GetStatusBubble()->UpdateDownloadShelfVisibility(visible);
@@ -1535,20 +1508,6 @@
chrome::GetActiveTabContents(this)->core_tab_helper()->
GetStatusText());
}
-
- if (!is_loading && pending_web_app_action_ == UPDATE_SHORTCUT) {
- // Schedule a shortcut update when web application info is available if
- // last committed entry is not NULL. Last committed entry could be NULL
- // when an interstitial page is injected (e.g. bad https certificate,
- // malware site etc). When this happens, we abort the shortcut update.
- NavigationEntry* entry = source->GetController().GetLastCommittedEntry();
- if (entry) {
- TabContents::FromWebContents(source)->
- extension_tab_helper()->GetApplicationInfo(entry->GetPageID());
- } else {
- pending_web_app_action_ = NONE;
- }
- }
}
}
@@ -2057,49 +2016,6 @@
}
///////////////////////////////////////////////////////////////////////////////
-// Browser, ExtensionTabHelperDelegate implementation:
-
-void Browser::OnDidGetApplicationInfo(TabContents* source,
- int32 page_id) {
- if (chrome::GetActiveTabContents(this) != source)
- return;
-
- NavigationEntry* entry =
- source->web_contents()->GetController().GetLastCommittedEntry();
- if (!entry || (entry->GetPageID() != page_id))
- return;
-
- switch (pending_web_app_action_) {
- case CREATE_SHORTCUT: {
- window()->ShowCreateWebAppShortcutsDialog(source);
- break;
- }
- case UPDATE_SHORTCUT: {
- web_app::UpdateShortcutForTabContents(source);
- break;
- }
- default:
- NOTREACHED();
- break;
- }
-
- pending_web_app_action_ = NONE;
-}
-
-void Browser::OnInstallApplication(TabContents* source,
- const WebApplicationInfo& web_app) {
- ExtensionService* extension_service = profile()->GetExtensionService();
- if (!extension_service)
- return;
-
- scoped_refptr<CrxInstaller> installer(CrxInstaller::Create(
- extension_service,
- extension_service->show_extensions_prompts() ?
- new ExtensionInstallPrompt(this) : NULL));
- installer->InstallWebApp(web_app);
-}
-
-///////////////////////////////////////////////////////////////////////////////
// Browser, SelectFileDialog::Listener implementation:
void Browser::FileSelected(const FilePath& path, int index, void* params) {
@@ -2612,7 +2528,6 @@
tab->zoom_controller()->set_observer(delegate);
tab->constrained_window_tab_helper()->set_delegate(delegate);
tab->core_tab_helper()->set_delegate(delegate);
- tab->extension_tab_helper()->set_delegate(delegate);
tab->search_engine_tab_helper()->set_delegate(delegate);
}
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698