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

Side by Side Diff: chrome/browser/ui/views/frame/minimize_button_metrics_win.h

Issue 2881563004: Clear the cached avatar button offset when the DPI scaling changes (Closed)
Patch Set: Created 3 years, 7 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
OLDNEW
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 14 matching lines...) Expand all
25 25
26 // Obtain the X offset of the native minimize button. Since Windows can lie 26 // Obtain the X offset of the native minimize button. Since Windows can lie
27 // to us if we call this at the wrong moment, this might come from a cached 27 // to us if we call this at the wrong moment, this might come from a cached
28 // value rather than read when called. 28 // value rather than read when called.
29 int GetMinimizeButtonOffsetX() const; 29 int GetMinimizeButtonOffsetX() const;
30 30
31 // Must be called when hwnd_ is activated to update the minimize button 31 // Must be called when hwnd_ is activated to update the minimize button
32 // position cache. 32 // position cache.
33 void OnHWNDActivated(); 33 void OnHWNDActivated();
34 34
35 // Must be called when WM_DPICHANGED message is received.
36 void OnDpiChanged();
37
35 private: 38 private:
36 // Gets the value for GetMinimizeButtonOffsetX(), caching if found. 39 // Gets the value for GetMinimizeButtonOffsetX(), caching if found.
37 int GetAndCacheMinimizeButtonOffsetX() const; 40 int GetAndCacheMinimizeButtonOffsetX() const;
38 41
39 int GetButtonBoundsPositionOffset(const RECT& button_bounds, 42 int GetButtonBoundsPositionOffset(const RECT& button_bounds,
40 const RECT& window_bounds) const; 43 const RECT& window_bounds) const;
41 44
42 int GetMinimizeButtonOffsetForWindow() const; 45 int GetMinimizeButtonOffsetForWindow() const;
43 46
44 HWND hwnd_; 47 HWND hwnd_;
(...skipping 10 matching lines...) Expand all
55 // DWMWA_CAPTION_BUTTON_BOUNDS and WM_GETTITLEBARINFOEX 58 // DWMWA_CAPTION_BUTTON_BOUNDS and WM_GETTITLEBARINFOEX
56 static int button_bounds_position_offset_; 59 static int button_bounds_position_offset_;
57 60
58 // Has OnHWNDActivated() been invoked? 61 // Has OnHWNDActivated() been invoked?
59 bool was_activated_; 62 bool was_activated_;
60 63
61 DISALLOW_COPY_AND_ASSIGN(MinimizeButtonMetrics); 64 DISALLOW_COPY_AND_ASSIGN(MinimizeButtonMetrics);
62 }; 65 };
63 66
64 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_MINIMIZE_BUTTON_METRICS_WIN_H_ 67 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_MINIMIZE_BUTTON_METRICS_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698