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

Unified Diff: chrome/browser/browser.cc

Issue 42571: Reverting r12383, caused a build breakage on all platforms. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/location_bar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 12384)
+++ chrome/browser/browser.cc (working copy)
@@ -551,7 +551,7 @@
///////////////////////////////////////////////////////////////////////////////
// Browser, Assorted browser commands:
-void Browser::GoBack(WindowOpenDisposition disposition) {
+void Browser::GoBack() {
UserMetrics::RecordAction(L"Back", profile_);
// If we are showing an interstitial, just hide it.
@@ -565,37 +565,14 @@
web_contents->interstitial_page()->DontProceed();
return;
}
-
- if (current_tab->controller()->CanGoBack()) {
- NavigationController* controller = 0;
- if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB){
- controller = GetSelectedTabContents()->controller()->Clone();
- tabstrip_model_.AddTabContents(
- controller->active_contents(), -1,
- PageTransition::LINK, disposition == NEW_FOREGROUND_TAB);
- } else {
- // Default disposition is CURRENT_TAB.
- controller = current_tab->controller();
- }
- controller->GoBack();
- }
+ if (current_tab->controller()->CanGoBack())
+ current_tab->controller()->GoBack();
}
-void Browser::GoForward(WindowOpenDisposition disp) {
+void Browser::GoForward() {
UserMetrics::RecordAction(L"Forward", profile_);
- if (GetSelectedTabContents()->controller()->CanGoForward()) {
- NavigationController* controller = 0;
- if (disp == NEW_FOREGROUND_TAB || disp == NEW_BACKGROUND_TAB) {
- controller = GetSelectedTabContents()->controller()->Clone();
- tabstrip_model_.AddTabContents(
- controller->active_contents(), -1,
- PageTransition::LINK, disp == NEW_FOREGROUND_TAB);
- } else {
- // Default disposition is CURRENT_TAB.
- controller = GetSelectedTabContents()->controller();
- }
- controller->GoForward();
- }
+ if (GetSelectedTabContents()->controller()->CanGoForward())
+ GetSelectedTabContents()->controller()->GoForward();
}
void Browser::Reload() {
@@ -620,9 +597,11 @@
}
}
-void Browser::Home(WindowOpenDisposition disposition) {
+void Browser::Home() {
UserMetrics::RecordAction(L"Home", profile_);
- OpenURL(GetHomePage(), GURL(), disposition, PageTransition::AUTO_BOOKMARK);
+ GURL homepage_url = GetHomePage();
+ GetSelectedTabContents()->controller()->LoadURL(
+ homepage_url, GURL(), PageTransition::AUTO_BOOKMARK);
}
void Browser::OpenCurrentURL() {
@@ -633,9 +612,9 @@
location_bar->GetPageTransition());
}
-void Browser::Go(WindowOpenDisposition disposition) {
+void Browser::Go() {
UserMetrics::RecordAction(L"Go", profile_);
- window_->GetLocationBar()->AcceptInputWithDisposition(disposition);
+ window_->GetLocationBar()->AcceptInput();
}
void Browser::Stop() {
@@ -1116,8 +1095,10 @@
return NULL;
}
-void Browser::ExecuteCommandWithDisposition(
- int id, WindowOpenDisposition disposition) {
+///////////////////////////////////////////////////////////////////////////////
+// Browser, CommandUpdater::CommandUpdaterDelegate implementation:
+
+void Browser::ExecuteCommand(int id) {
// No commands are enabled if there is not yet any selected tab.
// TODO(pkasting): It seems like we should not need this, because either
// most/all commands should not have been enabled yet anyway or the ones that
@@ -1134,12 +1115,12 @@
// declaration order in browser.h!
switch (id) {
// Navigation commands
- case IDC_BACK: GoBack(disposition); break;
- case IDC_FORWARD: GoForward(disposition); break;
+ case IDC_BACK: GoBack(); break;
+ case IDC_FORWARD: GoForward(); break;
case IDC_RELOAD: Reload(); break;
- case IDC_HOME: Home(disposition); break;
+ case IDC_HOME: Home(); break;
case IDC_OPEN_CURRENT_URL: OpenCurrentURL(); break;
- case IDC_GO: Go(disposition); break;
+ case IDC_GO: Go(); break;
case IDC_STOP: Stop(); break;
// Window management commands
@@ -1294,13 +1275,6 @@
}
///////////////////////////////////////////////////////////////////////////////
-// Browser, CommandUpdater::CommandUpdaterDelegate implementation:
-
-void Browser::ExecuteCommand(int id) {
- ExecuteCommandWithDisposition(id, CURRENT_TAB);
-}
-
-///////////////////////////////////////////////////////////////////////////////
// Browser, TabStripModelDelegate implementation:
GURL Browser::GetBlankTabURL() const {
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/location_bar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698