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

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

Issue 617543002: Disable overscroll on Windows machines w/o touchscreen (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unwanted changes. Created 6 years, 3 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
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 63c0e8c8fe2c1c5fe51228ad5318f7b250ad5e9d..16efd7e3a1c6bca69e6fcf2bf75cd3c4955e4ba2 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -106,6 +106,7 @@
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_toolbar_model_delegate.h"
#include "chrome/browser/ui/browser_ui_prefs.h"
+#include "chrome/browser/ui/browser_util.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
@@ -577,7 +578,7 @@ base::string16 Browser::GetWindowTitleForCurrentTab() const {
return base::UTF8ToUTF16(contents->GetURL().host());
title = contents->GetTitle();
- FormatTitleForDisplay(&title);
+ BrowserUtil::FormatTitleForDisplay(&title);
}
if (title.empty())
title = CoreTabHelper::GetDefaultTitle();
@@ -599,17 +600,6 @@ base::string16 Browser::GetWindowTitleForCurrentTab() const {
l10n_util::GetStringFUTF16(IDS_BROWSER_WINDOW_TITLE_FORMAT, title);
}
-// static
-void Browser::FormatTitleForDisplay(base::string16* title) {
- size_t current_index = 0;
- size_t match_index;
- while ((match_index = title->find(L'\n', current_index)) !=
- base::string16::npos) {
- title->replace(match_index, 1, base::string16());
- current_index = match_index;
- }
-}
-
///////////////////////////////////////////////////////////////////////////////
// Browser, OnBeforeUnload handling:
@@ -1127,7 +1117,9 @@ void Browser::TabStripEmpty() {
}
bool Browser::CanOverscrollContent() const {
-#if defined(USE_AURA)
+ if (!BrowserUtil::IsOverscrollEnabledOnPlatform())
+ return false;
+
const std::string value = CommandLine::ForCurrentProcess()->
GetSwitchValueASCII(switches::kOverscrollHistoryNavigation);
bool overscroll_enabled = value != "0";
@@ -1143,9 +1135,6 @@ bool Browser::CanOverscrollContent() const {
if (value == "1" && bookmark_bar_state_ == BookmarkBar::DETACHED)
return false;
return true;
-#else
- return false;
-#endif
}
bool Browser::ShouldPreserveAbortedURLs(WebContents* source) {

Powered by Google App Engine
This is Rietveld 408576698