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

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 138073004: Fix omnibox height when less than 64 pixels tall. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 60a7dc2193cdf5ee5463cb2bd0762d07833c596d..ce3c08bcc58ac2e18ae5b2f32f1b6eac22a9ec3a 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -497,6 +497,14 @@ gfx::Rect HWNDMessageHandler::GetRestoredBounds() const {
return bounds;
}
+gfx::Rect HWNDMessageHandler::GetClientAreaBounds() const {
+ if (IsMinimized())
+ return gfx::Rect();
+ if (delegate_->WidgetSizeIsClientSize())
+ return GetClientAreaBoundsInScreen();
+ return GetWindowBoundsInScreen();
+}
+
void HWNDMessageHandler::GetWindowPlacement(
gfx::Rect* bounds,
ui::WindowShowState* show_state) const {
@@ -1071,17 +1079,7 @@ void HWNDMessageHandler::TrackMouseEvents(DWORD mouse_tracking_flags) {
}
void HWNDMessageHandler::ClientAreaSizeChanged() {
- RECT r = {0, 0, 0, 0};
- // In case of minimized window GetWindowRect can return normally unexpected
- // coordinates.
- if (!IsMinimized()) {
- if (delegate_->WidgetSizeIsClientSize())
- GetClientRect(hwnd(), &r);
- else
- GetWindowRect(hwnd(), &r);
- }
- gfx::Size s(std::max(0, static_cast<int>(r.right - r.left)),
- std::max(0, static_cast<int>(r.bottom - r.top)));
+ gfx::Size s = GetClientAreaBounds().size();
delegate_->HandleClientSizeChanged(s);
if (use_layered_buffer_)
layered_window_contents_.reset(new gfx::Canvas(s, 1.0f, false));
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698