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

Unified Diff: chrome/browser/browser.cc

Issue 18507: More scaffolding for back/forward, start of WebContents (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 8452)
+++ chrome/browser/browser.cc (working copy)
@@ -8,6 +8,9 @@
#include "base/string_util.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/browser_list.h"
+#include "chrome/browser/metrics/user_metrics.h"
+#include "chrome/browser/tab_contents/tab_contents_type.h"
+#include "chrome/common/page_transition_types.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "net/base/cookie_monster.h"
@@ -15,6 +18,7 @@
#include "net/base/net_util.h"
#include "net/base/registry_controlled_domain.h"
#include "net/url_request/url_request_context.h"
+#include "webkit/glue/window_open_disposition.h"
#if defined(OS_WIN)
@@ -36,7 +40,6 @@
#include "chrome/browser/dom_ui/new_tab_ui.h"
#include "chrome/browser/download/save_package.h"
#include "chrome/browser/history_tab_ui.h"
-#include "chrome/browser/metrics/user_metrics.h"
#include "chrome/browser/options_window.h"
#include "chrome/browser/net/url_fixer_upper.h"
#include "chrome/browser/plugin_process_host.h"
@@ -547,6 +550,8 @@
AddNewContents(NULL, contents, NEW_FOREGROUND_TAB, gfx::Rect(), true);
}
+#endif // OS_WIN
+
///////////////////////////////////////////////////////////////////////////////
// Browser, Assorted browser commands:
@@ -574,6 +579,7 @@
GetSelectedTabContents()->controller()->GoForward();
}
+
void Browser::Reload() {
UserMetrics::RecordAction(L"Reload", profile_);
@@ -596,6 +602,7 @@
}
}
+
void Browser::Home() {
UserMetrics::RecordAction(L"Home", profile_);
GURL homepage_url = GetHomePage();
@@ -603,6 +610,7 @@
homepage_url, GURL(), PageTransition::AUTO_BOOKMARK);
}
+#if defined(OS_WIN)
void Browser::OpenCurrentURL() {
UserMetrics::RecordAction(L"LoadURL", profile_);
LocationBarView* lbv = GetLocationBarView();
@@ -1091,10 +1099,10 @@
// The order of commands in this switch statement must match the function
// declaration order in browser.h!
switch (id) {
-#if defined(OS_WIN)
// Navigation commands
case IDC_BACK: GoBack(); break;
case IDC_FORWARD: GoForward(); break;
+#if defined(OS_WIN)
case IDC_RELOAD: Reload(); break;
case IDC_HOME: Home(); break;
case IDC_OPEN_CURRENT_URL: OpenCurrentURL(); break;
@@ -1300,6 +1308,8 @@
return contents;
}
+#endif // OS_WIN
+
bool Browser::CanDuplicateContentsAt(int index) {
TabContents* contents = GetTabContentsAt(index);
DCHECK(contents);
@@ -1308,6 +1318,8 @@
return nc ? (nc->active_contents() && nc->GetLastCommittedEntry()) : false;
}
+#if defined(OS_WIN)
+
void Browser::DuplicateContentsAt(int index) {
TabContents* contents = GetTabContentsAt(index);
TabContents* new_contents = NULL;
@@ -2034,8 +2046,6 @@
}
}
-#if defined(OS_WIN)
-
void Browser::UpdateCommandsForTabState() {
TabContents* current_tab = GetSelectedTabContents();
if (!current_tab) // May be NULL during tab restore.
@@ -2104,6 +2114,8 @@
star_button->SetToggled(starred);
}
+#if defined(OS_WIN)
+
///////////////////////////////////////////////////////////////////////////////
// Browser, UI update coalescing and handling (private):
@@ -2232,6 +2244,8 @@
}
}
+#endif // OS_WIN
+
///////////////////////////////////////////////////////////////////////////////
// Browser, Getters for UI (private):
@@ -2247,6 +2261,7 @@
return window_->GetStatusBubble();
}
+#if defined(OS_WIN)
///////////////////////////////////////////////////////////////////////////////
// Browser, Session restore functions (private):

Powered by Google App Engine
This is Rietveld 408576698