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

Side by Side Diff: chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc

Issue 405323002: [Win Aero] Correctly set the minimum window size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h" 5 #include "chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h"
6 6
7 #include "apps/ui/native_app_window.h" 7 #include "apps/ui/native_app_window.h"
8 #include "ui/base/hit_test.h" 8 #include "ui/base/hit_test.h"
9 #include "ui/gfx/win/dpi.h" 9 #include "ui/gfx/win/dpi.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 .size(); 108 .size();
109 } 109 }
110 110
111 const char* GlassAppWindowFrameViewWin::GetClassName() const { 111 const char* GlassAppWindowFrameViewWin::GetClassName() const {
112 return kViewClassName; 112 return kViewClassName;
113 } 113 }
114 114
115 gfx::Size GlassAppWindowFrameViewWin::GetMinimumSize() const { 115 gfx::Size GlassAppWindowFrameViewWin::GetMinimumSize() const {
116 gfx::Size min_size = widget_->client_view()->GetMinimumSize(); 116 gfx::Size min_size = widget_->client_view()->GetMinimumSize();
117 gfx::Rect client_bounds = GetBoundsForClientView(); 117 gfx::Rect client_bounds = GetBoundsForClientView();
118 min_size.Enlarge(0, client_bounds.y()); 118 min_size.Enlarge(width() - client_bounds.width(),
119 height() - client_bounds.height());
benwells1 2014/07/22 05:37:52 This looks right. Are there tests which should hav
jackhou1 2014/07/23 03:36:04 The API is covered in platform_apps/window_api/tes
119 return min_size; 120 return min_size;
120 } 121 }
121 122
122 gfx::Size GlassAppWindowFrameViewWin::GetMaximumSize() const { 123 gfx::Size GlassAppWindowFrameViewWin::GetMaximumSize() const {
123 gfx::Size max_size = widget_->client_view()->GetMaximumSize(); 124 gfx::Size max_size = widget_->client_view()->GetMaximumSize();
124 125
125 // Add to the client maximum size the height of any title bar and borders. 126 // Add to the client maximum size the height of any title bar and borders.
126 gfx::Size client_size = GetBoundsForClientView().size(); 127 gfx::Size client_size = GetBoundsForClientView().size();
127 if (max_size.width()) 128 if (max_size.width())
128 max_size.Enlarge(width() - client_size.width(), 0); 129 max_size.Enlarge(width() - client_size.width(), 0);
129 if (max_size.height()) 130 if (max_size.height())
130 max_size.Enlarge(0, height() - client_size.height()); 131 max_size.Enlarge(0, height() - client_size.height());
131 132
132 return max_size; 133 return max_size;
133 } 134 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698