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