OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/frame/minimize_button_metrics_win.h" | 5 #include "chrome/browser/ui/views/frame/minimize_button_metrics_win.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "ui/gfx/dpi_win.h" | 9 #include "ui/gfx/win/dpi.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 int GetMinimizeButtonOffsetForWindow(HWND hwnd) { | 13 int GetMinimizeButtonOffsetForWindow(HWND hwnd) { |
14 // The WM_GETTITLEBARINFOEX message can fail if we are not active/visible. | 14 // The WM_GETTITLEBARINFOEX message can fail if we are not active/visible. |
15 TITLEBARINFOEX titlebar_info = {0}; | 15 TITLEBARINFOEX titlebar_info = {0}; |
16 titlebar_info.cbSize = sizeof(TITLEBARINFOEX); | 16 titlebar_info.cbSize = sizeof(TITLEBARINFOEX); |
17 SendMessage(hwnd, WM_GETTITLEBARINFOEX, 0, | 17 SendMessage(hwnd, WM_GETTITLEBARINFOEX, 0, |
18 reinterpret_cast<WPARAM>(&titlebar_info)); | 18 reinterpret_cast<WPARAM>(&titlebar_info)); |
19 | 19 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 DCHECK(cached_minimize_button_x_delta_); | 70 DCHECK(cached_minimize_button_x_delta_); |
71 | 71 |
72 RECT client_rect = {0}; | 72 RECT client_rect = {0}; |
73 GetClientRect(hwnd_, &client_rect); | 73 GetClientRect(hwnd_, &client_rect); |
74 | 74 |
75 if (base::i18n::IsRTL()) | 75 if (base::i18n::IsRTL()) |
76 return cached_minimize_button_x_delta_; | 76 return cached_minimize_button_x_delta_; |
77 return client_rect.right - cached_minimize_button_x_delta_; | 77 return client_rect.right - cached_minimize_button_x_delta_; |
78 } | 78 } |
79 | 79 |
OLD | NEW |