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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 243703003: Removes win8_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar Created 6 years, 8 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/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index ae5737e60ba2c22f55b238cb0f0e1904dd559fde..0c12b674779321fb445f2618f5ecc060e294bc4b 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -155,7 +155,6 @@
#include "base/win/windows_version.h"
#include "chrome/browser/jumplist_win.h"
#include "ui/views/win/scoped_fullscreen_visibility.h"
-#include "win8/util/win8_util.h"
#endif
#if defined(ENABLE_ONE_CLICK_SIGNIN)
@@ -245,20 +244,6 @@ void PaintAttachedBookmarkBar(gfx::Canvas* canvas,
// static
const char BrowserView::kViewClassName[] = "BrowserView";
-namespace {
-
-bool ShouldSaveOrRestoreWindowPos() {
-#if defined(OS_WIN)
- // In Windows 8's single window Metro mode the window is always maximized
- // (without the WS_MAXIMIZE style).
- if (win8::IsSingleWindowMetroMode())
- return false;
-#endif
- return true;
-}
-
-} // namespace
-
///////////////////////////////////////////////////////////////////////////////
// Delegate implementation for BrowserViewLayout. Usually just forwards calls
@@ -571,17 +556,9 @@ bool BrowserView::IsRegularOrGuestSession() const {
}
int BrowserView::GetOTRIconResourceID() const {
- int otr_resource_id = IDR_OTR_ICON;
- if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) {
- if (IsFullscreen())
- otr_resource_id = IDR_OTR_ICON_FULLSCREEN;
-#if defined(OS_WIN)
- if (win8::IsSingleWindowMetroMode())
- otr_resource_id = IDR_OTR_ICON_FULLSCREEN;
-#endif
- }
-
- return otr_resource_id;
+ if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH && IsFullscreen())
+ return IDR_OTR_ICON_FULLSCREEN;
+ return IDR_OTR_ICON;
}
int BrowserView::GetGuestIconResourceID() const {
@@ -1428,12 +1405,7 @@ void BrowserView::Paste() {
WindowOpenDisposition BrowserView::GetDispositionForPopupBounds(
const gfx::Rect& bounds) {
-#if defined(OS_WIN)
- // If we are in Win8's single window Metro mode, we can't allow popup windows.
- return win8::IsSingleWindowMetroMode() ? NEW_BACKGROUND_TAB : NEW_POPUP;
-#else
return NEW_POPUP;
-#endif
}
FindBar* BrowserView::CreateFindBar() {
@@ -1632,17 +1604,6 @@ bool BrowserView::ExecuteWindowsCommand(int command_id) {
#if defined(OS_WIN)
if (command_id == IDC_DEBUG_FRAME_TOGGLE)
GetWidget()->DebugToggleFrameType();
-
- // In Windows 8 metro mode prevent sizing and moving.
- if (win8::IsSingleWindowMetroMode()) {
- // Windows uses the 4 lower order bits of |notification_code| for type-
- // specific information so we must exclude this when comparing.
- static const int sc_mask = 0xFFF0;
- if (((command_id & sc_mask) == SC_MOVE) ||
- ((command_id & sc_mask) == SC_SIZE) ||
- ((command_id & sc_mask) == SC_MAXIMIZE))
- return true;
- }
#endif
// Translate WM_APPCOMMAND command ids into a command id that the browser
// knows how to handle.
@@ -1662,9 +1623,6 @@ void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds,
// If IsFullscreen() is true, we've just changed into fullscreen mode, and
// we're catching the going-into-fullscreen sizing and positioning calls,
// which we want to ignore.
- if (!ShouldSaveOrRestoreWindowPos())
- return;
-
if (!IsFullscreen() && chrome::ShouldSaveWindowPlacement(browser_.get())) {
WidgetDelegate::SaveWindowPlacement(bounds, show_state);
chrome::SaveWindowPlacement(browser_.get(), bounds, show_state);
@@ -1675,8 +1633,6 @@ bool BrowserView::GetSavedWindowPlacement(
const views::Widget* widget,
gfx::Rect* bounds,
ui::WindowShowState* show_state) const {
- if (!ShouldSaveOrRestoreWindowPos())
- return false;
chrome::GetSavedWindowBoundsAndShowState(browser_.get(), bounds, show_state);
if (browser_->is_type_popup() &&

Powered by Google App Engine
This is Rietveld 408576698