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_CHROME_VIEWS_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_CHROME_VIEWS_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_CHROME_VIEWS_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_CHROME_VIEWS_DELEGATE_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "ui/accessibility/ax_enums.h" | 13 #include "ui/accessibility/ax_enums.h" |
14 #include "ui/views/views_delegate.h" | 14 #include "ui/views/views_delegate.h" |
15 | 15 |
16 class ScopedKeepAlive; | 16 class ScopedKeepAlive; |
17 | 17 |
18 class ChromeViewsDelegate : public views::ViewsDelegate { | 18 class ChromeViewsDelegate : public views::ViewsDelegate { |
19 public: | 19 public: |
20 ChromeViewsDelegate(); | 20 ChromeViewsDelegate(); |
21 ~ChromeViewsDelegate() override; | 21 ~ChromeViewsDelegate() override; |
22 | 22 |
| 23 static ChromeViewsDelegate* GetInstance(); |
| 24 |
23 // views::ViewsDelegate: | 25 // views::ViewsDelegate: |
24 void SaveWindowPlacement(const views::Widget* window, | 26 void SaveWindowPlacement(const views::Widget* window, |
25 const std::string& window_name, | 27 const std::string& window_name, |
26 const gfx::Rect& bounds, | 28 const gfx::Rect& bounds, |
27 ui::WindowShowState show_state) override; | 29 ui::WindowShowState show_state) override; |
28 bool GetSavedWindowPlacement(const views::Widget* widget, | 30 bool GetSavedWindowPlacement(const views::Widget* widget, |
29 const std::string& window_name, | 31 const std::string& window_name, |
30 gfx::Rect* bounds, | 32 gfx::Rect* bounds, |
31 ui::WindowShowState* show_state) const override; | 33 ui::WindowShowState* show_state) const override; |
32 void NotifyAccessibilityEvent(views::View* view, | 34 void NotifyAccessibilityEvent(views::View* view, |
(...skipping 22 matching lines...) Expand all Loading... |
55 #endif | 57 #endif |
56 ui::ContextFactory* GetContextFactory() override; | 58 ui::ContextFactory* GetContextFactory() override; |
57 ui::ContextFactoryPrivate* GetContextFactoryPrivate() override; | 59 ui::ContextFactoryPrivate* GetContextFactoryPrivate() override; |
58 std::string GetApplicationName() override; | 60 std::string GetApplicationName() override; |
59 #if defined(OS_WIN) | 61 #if defined(OS_WIN) |
60 int GetAppbarAutohideEdges(HMONITOR monitor, | 62 int GetAppbarAutohideEdges(HMONITOR monitor, |
61 const base::Closure& callback) override; | 63 const base::Closure& callback) override; |
62 #endif | 64 #endif |
63 scoped_refptr<base::TaskRunner> GetBlockingPoolTaskRunner() override; | 65 scoped_refptr<base::TaskRunner> GetBlockingPoolTaskRunner() override; |
64 | 66 |
65 gfx::Insets GetDialogButtonInsets() const override; | 67 gfx::Insets GetInsetsMetric(views::InsetsMetric metric) const override; |
66 int GetDialogCloseButtonMargin() const override; | 68 int GetSpacingMetric(views::SpacingMetric metric) const override; |
67 int GetDialogRelatedButtonHorizontalSpacing() const override; | |
68 int GetDialogRelatedControlVerticalSpacing() const override; | |
69 gfx::Insets GetDialogFrameViewInsets() const override; | |
70 gfx::Insets GetBubbleDialogMargins() const override; | |
71 int GetButtonMinimumWidth() const override; | |
72 int GetDialogButtonMinimumWidth() const override; | |
73 int GetButtonHorizontalPadding() const override; | |
74 | 69 |
75 private: | 70 private: |
76 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
77 typedef std::map<HMONITOR, int> AppbarAutohideEdgeMap; | 72 typedef std::map<HMONITOR, int> AppbarAutohideEdgeMap; |
78 | 73 |
79 // Callback on main thread with the edges. |returned_edges| is the value that | 74 // Callback on main thread with the edges. |returned_edges| is the value that |
80 // was returned from the call to GetAutohideEdges() that initiated the lookup. | 75 // was returned from the call to GetAutohideEdges() that initiated the lookup. |
81 void OnGotAppbarAutohideEdges(const base::Closure& callback, | 76 void OnGotAppbarAutohideEdges(const base::Closure& callback, |
82 HMONITOR monitor, | 77 HMONITOR monitor, |
83 int returned_edges, | 78 int returned_edges, |
(...skipping 18 matching lines...) Expand all Loading... |
102 // GetAutohideEdges().start a new query. | 97 // GetAutohideEdges().start a new query. |
103 bool in_autohide_edges_callback_; | 98 bool in_autohide_edges_callback_; |
104 | 99 |
105 base::WeakPtrFactory<ChromeViewsDelegate> weak_factory_; | 100 base::WeakPtrFactory<ChromeViewsDelegate> weak_factory_; |
106 #endif | 101 #endif |
107 | 102 |
108 DISALLOW_COPY_AND_ASSIGN(ChromeViewsDelegate); | 103 DISALLOW_COPY_AND_ASSIGN(ChromeViewsDelegate); |
109 }; | 104 }; |
110 | 105 |
111 #endif // CHROME_BROWSER_UI_VIEWS_CHROME_VIEWS_DELEGATE_H_ | 106 #endif // CHROME_BROWSER_UI_VIEWS_CHROME_VIEWS_DELEGATE_H_ |
OLD | NEW |