| 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 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_MINIMIZE_BUTTON_METRICS_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_MINIMIZE_BUTTON_METRICS_WIN_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_MINIMIZE_BUTTON_METRICS_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_MINIMIZE_BUTTON_METRICS_WIN_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 int GetMinimizeButtonOffsetX() const; | 26 int GetMinimizeButtonOffsetX() const; |
| 27 | 27 |
| 28 // Must be called when hwnd_ is activated to update the minimize button | 28 // Must be called when hwnd_ is activated to update the minimize button |
| 29 // position cache. | 29 // position cache. |
| 30 void OnHWNDActivated(); | 30 void OnHWNDActivated(); |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 // Gets the value for GetMinimizeButtonOffsetX(), caching if found. | 33 // Gets the value for GetMinimizeButtonOffsetX(), caching if found. |
| 34 int GetAndCacheMinimizeButtonOffsetX() const; | 34 int GetAndCacheMinimizeButtonOffsetX() const; |
| 35 | 35 |
| 36 int GetButtonBoundsPositionOffset(const RECT& button_bounds, |
| 37 const RECT& window_bounds) const; |
| 38 |
| 39 int GetMinimizeButtonOffsetForWindow() const; |
| 40 |
| 36 HWND hwnd_; | 41 HWND hwnd_; |
| 37 | 42 |
| 38 // Cached offset of the minimize button. If RTL this is the location of the | 43 // Cached offset of the minimize button. If RTL this is the location of the |
| 39 // minimize button, if LTR this is the offset from the right edge of the | 44 // minimize button, if LTR this is the offset from the right edge of the |
| 40 // client area to the minimize button. | 45 // client area to the minimize button. |
| 41 mutable int cached_minimize_button_x_delta_; | 46 mutable int cached_minimize_button_x_delta_; |
| 42 | 47 |
| 43 // Static cache of |cached_minimize_button_x_delta_|. | 48 // Static cache of |cached_minimize_button_x_delta_|. |
| 44 static int last_cached_minimize_button_x_delta_; | 49 static int last_cached_minimize_button_x_delta_; |
| 45 | 50 |
| 51 // Static cache of offset value representing the different between |
| 52 // DWMWA_CAPTION_BUTTON_BOUNDS and WM_GETTITLEBARINFOEX |
| 53 static int button_bounds_position_offset_; |
| 54 |
| 46 // Has OnHWNDActivated() been invoked? | 55 // Has OnHWNDActivated() been invoked? |
| 47 bool was_activated_; | 56 bool was_activated_; |
| 48 | 57 |
| 49 DISALLOW_COPY_AND_ASSIGN(MinimizeButtonMetrics); | 58 DISALLOW_COPY_AND_ASSIGN(MinimizeButtonMetrics); |
| 50 }; | 59 }; |
| 51 | 60 |
| 52 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_MINIMIZE_BUTTON_METRICS_WIN_H_ | 61 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_MINIMIZE_BUTTON_METRICS_WIN_H_ |
| OLD | NEW |