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

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

Issue 7748036: Restoring a session should restore window minimization state on Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: GetSavedWindowPlacement consolidation, Test, and All case. Created 9 years, 4 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 59c87a70eecd133d919c5d0e87d76979872478c9..98dd3f582243e365887104586c21bf01c4db338f 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -790,9 +790,7 @@ bool BrowserView::IsMaximized() const {
}
bool BrowserView::IsMinimized() const {
- // TODO(dhollowa): Add support for session restore of minimized state.
- // http://crbug.com/43274
- return false;
+ return frame_->IsMinimized();
}
void BrowserView::SetFullscreen(bool fullscreen) {
@@ -1634,23 +1632,22 @@ std::wstring BrowserView::GetWindowName() const {
}
void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds,
- bool maximized) {
- // TODO(dhollowa): Add support for session restore of minimized state.
- // http://crbug.com/43274
-
+ ui::WindowShowState show_state) {
// 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 (!IsFullscreen() && browser_->ShouldSaveWindowPlacement()) {
- WidgetDelegate::SaveWindowPlacement(bounds, maximized);
- browser_->SaveWindowPlacement(bounds,
- maximized ? ui::SHOW_STATE_MAXIMIZED :
- ui::SHOW_STATE_NORMAL);
+ WidgetDelegate::SaveWindowPlacement(bounds, show_state);
+ browser_->SaveWindowPlacement(bounds, show_state);
}
}
-bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const {
+bool BrowserView::GetSavedWindowPlacement(
+ gfx::Rect* bounds,
+ ui::WindowShowState* show_state) const {
*bounds = browser_->GetSavedWindowBounds();
+ *show_state = browser_->GetSavedWindowShowState();
+
if (browser_->is_type_popup() || browser_->is_type_panel()) {
// We are a popup window. The value passed in |bounds| represents two
// pieces of information:
@@ -1688,13 +1685,6 @@ bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const {
return true;
}
-bool BrowserView::GetSavedMaximizedState(bool* maximized) const {
- // TODO(dhollowa): Add support for session restore of minimized state.
- // http://crbug.com/43274
- *maximized = browser_->GetSavedWindowShowState() == ui::SHOW_STATE_MAXIMIZED;
- return true;
-}
-
views::View* BrowserView::GetContentsView() {
return contents_container_;
}

Powered by Google App Engine
This is Rietveld 408576698