Chromium Code Reviews| Index: chrome/browser/ui/views/chrome_views_delegate_win.cc |
| diff --git a/chrome/browser/ui/views/chrome_views_delegate_win.cc b/chrome/browser/ui/views/chrome_views_delegate_win.cc |
| index 342e1391cac54a2b465e5cd0a15ff5c5bb3c0b04..475bede05671fadfe664cec16993512238ca9b2b 100644 |
| --- a/chrome/browser/ui/views/chrome_views_delegate_win.cc |
| +++ b/chrome/browser/ui/views/chrome_views_delegate_win.cc |
| @@ -104,10 +104,26 @@ int GetAppbarAutohideEdgesOnWorkerThread(HMONITOR monitor) { |
| return edges; |
| } |
| +ChromeViewsDelegate* views_delegate = nullptr; |
| + |
| } // namespace |
| ChromeViewsDelegate::ChromeViewsDelegate() |
| - : in_autohide_edges_callback_(false), weak_factory_(this) {} |
| + : in_autohide_edges_callback_(false), weak_factory_(this) { |
|
Peter Kasting
2017/03/09 05:52:11
For this function, it looks like the only reason i
kylix_rd
2017/03/09 15:02:31
Can weak_factory_ be initialized with "this" using
Peter Kasting
2017/03/09 18:26:48
It should be able to, AFAIK. Such initializers ar
kylix_rd
2017/03/10 15:10:40
weak_factory_ takes "this" as a constructor parame
Peter Kasting
2017/03/10 20:44:54
Oh, due to the constructor being marked explicit?
|
| + DCHECK(!views_delegate); |
| + views_delegate = this; |
| +} |
| + |
| +ChromeViewsDelegate::~ChromeViewsDelegate() { |
|
Peter Kasting
2017/03/09 05:52:11
For these two functions, the implementations look
kylix_rd
2017/03/09 15:02:31
Since views_delegate is also defined in chrome_vie
|
| + DCHECK_EQ(0u, ref_count_); |
| + |
| + DCHECK_EQ(this, views_delegate); |
| + views_delegate = nullptr; |
| +} |
| + |
| +ChromeViewsDelegate* ChromeViewsDelegate::GetInstance() { |
| + return views_delegate; |
| +} |
| HICON ChromeViewsDelegate::GetDefaultWindowIcon() const { |
| return GetAppIcon(); |