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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "ui/accessibility/ax_enums.h" | 11 #include "ui/accessibility/ax_enums.h" |
12 #include "ui/views/views_delegate.h" | 12 #include "ui/views/views_delegate.h" |
13 | 13 |
14 class ChromeViewsDelegate : public views::ViewsDelegate { | 14 class ChromeViewsDelegate : public views::ViewsDelegate { |
15 public: | 15 public: |
16 ChromeViewsDelegate(); | 16 ChromeViewsDelegate(); |
17 virtual ~ChromeViewsDelegate(); | 17 virtual ~ChromeViewsDelegate(); |
18 | 18 |
19 // views::ViewsDelegate: | 19 // views::ViewsDelegate: |
20 virtual void SaveWindowPlacement(const views::Widget* window, | 20 virtual void SaveWindowPlacement(const views::Widget* window, |
21 const std::string& window_name, | 21 const std::string& window_name, |
22 const gfx::Rect& bounds, | 22 const gfx::Rect& bounds, |
23 ui::WindowShowState show_state) OVERRIDE; | 23 ui::WindowShowState show_state) override; |
24 virtual bool GetSavedWindowPlacement( | 24 virtual bool GetSavedWindowPlacement( |
25 const views::Widget* widget, | 25 const views::Widget* widget, |
26 const std::string& window_name, | 26 const std::string& window_name, |
27 gfx::Rect* bounds, | 27 gfx::Rect* bounds, |
28 ui::WindowShowState* show_state) const OVERRIDE; | 28 ui::WindowShowState* show_state) const override; |
29 virtual void NotifyAccessibilityEvent( | 29 virtual void NotifyAccessibilityEvent( |
30 views::View* view, ui::AXEvent event_type) OVERRIDE; | 30 views::View* view, ui::AXEvent event_type) override; |
31 virtual void NotifyMenuItemFocused(const base::string16& menu_name, | 31 virtual void NotifyMenuItemFocused(const base::string16& menu_name, |
32 const base::string16& menu_item_name, | 32 const base::string16& menu_item_name, |
33 int item_index, | 33 int item_index, |
34 int item_count, | 34 int item_count, |
35 bool has_submenu) OVERRIDE; | 35 bool has_submenu) override; |
36 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
37 virtual HICON GetDefaultWindowIcon() const OVERRIDE; | 37 virtual HICON GetDefaultWindowIcon() const override; |
38 virtual bool IsWindowInMetro(gfx::NativeWindow window) const OVERRIDE; | 38 virtual bool IsWindowInMetro(gfx::NativeWindow window) const override; |
39 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) | 39 #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) |
40 virtual gfx::ImageSkia* GetDefaultWindowIcon() const OVERRIDE; | 40 virtual gfx::ImageSkia* GetDefaultWindowIcon() const override; |
41 #endif | 41 #endif |
42 | 42 |
43 #if defined(USE_ASH) | 43 #if defined(USE_ASH) |
44 virtual views::NonClientFrameView* CreateDefaultNonClientFrameView( | 44 virtual views::NonClientFrameView* CreateDefaultNonClientFrameView( |
45 views::Widget* widget) OVERRIDE; | 45 views::Widget* widget) override; |
46 #endif | 46 #endif |
47 virtual void AddRef() OVERRIDE; | 47 virtual void AddRef() override; |
48 virtual void ReleaseRef() OVERRIDE; | 48 virtual void ReleaseRef() override; |
49 virtual void OnBeforeWidgetInit( | 49 virtual void OnBeforeWidgetInit( |
50 views::Widget::InitParams* params, | 50 views::Widget::InitParams* params, |
51 views::internal::NativeWidgetDelegate* delegate) OVERRIDE; | 51 views::internal::NativeWidgetDelegate* delegate) override; |
52 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 52 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
53 virtual bool WindowManagerProvidesTitleBar(bool maximized) OVERRIDE; | 53 virtual bool WindowManagerProvidesTitleBar(bool maximized) override; |
54 #endif | 54 #endif |
55 #if defined(USE_AURA) | 55 #if defined(USE_AURA) |
56 virtual ui::ContextFactory* GetContextFactory() OVERRIDE; | 56 virtual ui::ContextFactory* GetContextFactory() override; |
57 #endif | 57 #endif |
58 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
59 virtual int GetAppbarAutohideEdges(HMONITOR monitor, | 59 virtual int GetAppbarAutohideEdges(HMONITOR monitor, |
60 const base::Closure& callback) OVERRIDE; | 60 const base::Closure& callback) override; |
61 #endif | 61 #endif |
62 | 62 |
63 private: | 63 private: |
64 #if defined(OS_WIN) | 64 #if defined(OS_WIN) |
65 typedef std::map<HMONITOR, int> AppbarAutohideEdgeMap; | 65 typedef std::map<HMONITOR, int> AppbarAutohideEdgeMap; |
66 | 66 |
67 // Callback on main thread with the edges. |returned_edges| is the value that | 67 // Callback on main thread with the edges. |returned_edges| is the value that |
68 // was returned from the call to GetAutohideEdges() that initiated the lookup. | 68 // was returned from the call to GetAutohideEdges() that initiated the lookup. |
69 void OnGotAppbarAutohideEdges(const base::Closure& callback, | 69 void OnGotAppbarAutohideEdges(const base::Closure& callback, |
70 HMONITOR monitor, | 70 HMONITOR monitor, |
(...skipping 12 matching lines...) Expand all Loading... |
83 // GetAutohideEdges().start a new query. | 83 // GetAutohideEdges().start a new query. |
84 bool in_autohide_edges_callback_; | 84 bool in_autohide_edges_callback_; |
85 | 85 |
86 base::WeakPtrFactory<ChromeViewsDelegate> weak_factory_; | 86 base::WeakPtrFactory<ChromeViewsDelegate> weak_factory_; |
87 #endif | 87 #endif |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(ChromeViewsDelegate); | 89 DISALLOW_COPY_AND_ASSIGN(ChromeViewsDelegate); |
90 }; | 90 }; |
91 | 91 |
92 #endif // CHROME_BROWSER_UI_VIEWS_CHROME_VIEWS_DELEGATE_H_ | 92 #endif // CHROME_BROWSER_UI_VIEWS_CHROME_VIEWS_DELEGATE_H_ |
OLD | NEW |