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 ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_VIEW_H_ | 5 #ifndef ASH_WALLPAPER_WALLPAPER_VIEW_H_ |
6 #define ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_VIEW_H_ | 6 #define ASH_WALLPAPER_WALLPAPER_VIEW_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ui/views/context_menu_controller.h" | 10 #include "ui/views/context_menu_controller.h" |
11 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 | 14 |
15 class PreEventDispatchHandler; | 15 class PreEventDispatchHandler; |
16 class WmWindow; | 16 class WmWindow; |
17 | 17 |
18 class DesktopBackgroundView : public views::View, | 18 class WallpaperView : public views::View, public views::ContextMenuController { |
19 public views::ContextMenuController { | |
20 public: | 19 public: |
21 DesktopBackgroundView(); | 20 WallpaperView(); |
22 ~DesktopBackgroundView() override; | 21 ~WallpaperView() override; |
23 | 22 |
24 private: | 23 private: |
25 friend class DesktopBackgroundControllerTest; | 24 friend class WallpaperControllerTest; |
26 | 25 |
27 // Overridden from views::View: | 26 // Overridden from views::View: |
28 void OnPaint(gfx::Canvas* canvas) override; | 27 void OnPaint(gfx::Canvas* canvas) override; |
29 bool OnMousePressed(const ui::MouseEvent& event) override; | 28 bool OnMousePressed(const ui::MouseEvent& event) override; |
30 | 29 |
31 // Overridden from views::ContextMenuController: | 30 // Overridden from views::ContextMenuController: |
32 void ShowContextMenuForView(views::View* source, | 31 void ShowContextMenuForView(views::View* source, |
33 const gfx::Point& point, | 32 const gfx::Point& point, |
34 ui::MenuSourceType source_type) override; | 33 ui::MenuSourceType source_type) override; |
35 std::unique_ptr<PreEventDispatchHandler> pre_dispatch_handler_; | 34 std::unique_ptr<PreEventDispatchHandler> pre_dispatch_handler_; |
36 | 35 |
37 DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundView); | 36 DISALLOW_COPY_AND_ASSIGN(WallpaperView); |
38 }; | 37 }; |
39 | 38 |
40 views::Widget* CreateDesktopBackground(WmWindow* root_window, int container_id); | 39 views::Widget* CreateWallpaper(WmWindow* root_window, int container_id); |
41 | 40 |
42 } // namespace ash | 41 } // namespace ash |
43 | 42 |
44 #endif // ASH_DESKTOP_BACKGROUND_DESKTOP_BACKGROUND_VIEW_H_ | 43 #endif // ASH_WALLPAPER_WALLPAPER_VIEW_H_ |
OLD | NEW |