| 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_WM_PARTIAL_SCREENSHOT_VIEW_H_ | 5 #ifndef ASH_WM_PARTIAL_SCREENSHOT_VIEW_H_ |
| 6 #define ASH_WM_PARTIAL_SCREENSHOT_VIEW_H_ | 6 #define ASH_WM_PARTIAL_SCREENSHOT_VIEW_H_ |
| 7 | 7 |
| 8 #include <vector> |
| 9 |
| 8 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 9 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/gtest_prod_util.h" |
| 10 #include "ui/gfx/point.h" | 13 #include "ui/gfx/point.h" |
| 11 #include "ui/views/widget/widget_delegate.h" | 14 #include "ui/views/widget/widget_delegate.h" |
| 12 | 15 |
| 13 namespace aura { | 16 namespace aura { |
| 14 class RootWindow; | 17 class RootWindow; |
| 15 } | 18 } |
| 16 | 19 |
| 17 namespace ash { | 20 namespace ash { |
| 18 class ScreenshotDelegate; | 21 class ScreenshotDelegate; |
| 19 | 22 |
| 20 // The view of taking partial screenshot, i.e.: drawing region | 23 // The view of taking partial screenshot, i.e.: drawing region |
| 21 // rectangles during drag, and changing the mouse cursor to indicate | 24 // rectangles during drag, and changing the mouse cursor to indicate |
| 22 // the current mode. | 25 // the current mode. |
| 23 class ASH_EXPORT PartialScreenshotView : public views::WidgetDelegateView { | 26 class ASH_EXPORT PartialScreenshotView : public views::WidgetDelegateView { |
| 24 public: | 27 public: |
| 25 // Starts the UI for taking partial screenshot; dragging to select a region. | 28 // Starts the UI for taking partial screenshot; dragging to select a region. |
| 26 static void StartPartialScreenshot(ScreenshotDelegate* screenshot_delegate); | 29 static std::vector<PartialScreenshotView*> |
| 30 StartPartialScreenshot(ScreenshotDelegate* screenshot_delegate); |
| 27 | 31 |
| 28 private: | 32 private: |
| 33 FRIEND_TEST_ALL_PREFIXES(PartialScreenshotViewTest, BasicMouse); |
| 34 FRIEND_TEST_ALL_PREFIXES(PartialScreenshotViewTest, BasicTouch); |
| 35 |
| 29 class OverlayDelegate; | 36 class OverlayDelegate; |
| 30 | 37 |
| 31 PartialScreenshotView(OverlayDelegate* overlay_delegate, | 38 PartialScreenshotView(OverlayDelegate* overlay_delegate, |
| 32 ScreenshotDelegate* screenshot_delegate); | 39 ScreenshotDelegate* screenshot_delegate); |
| 33 virtual ~PartialScreenshotView(); | 40 virtual ~PartialScreenshotView(); |
| 34 | 41 |
| 35 // Initializes partial screenshot UI widget for |root_window|. | 42 // Initializes partial screenshot UI widget for |root_window|. |
| 36 void Init(aura::RootWindow* root_window); | 43 void Init(aura::RootWindow* root_window); |
| 37 | 44 |
| 38 // Returns the currently selected region. | 45 // Returns the currently selected region. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 61 | 68 |
| 62 // ScreenshotDelegate to take the actual screenshot. No ownership. | 69 // ScreenshotDelegate to take the actual screenshot. No ownership. |
| 63 ScreenshotDelegate* screenshot_delegate_; | 70 ScreenshotDelegate* screenshot_delegate_; |
| 64 | 71 |
| 65 DISALLOW_COPY_AND_ASSIGN(PartialScreenshotView); | 72 DISALLOW_COPY_AND_ASSIGN(PartialScreenshotView); |
| 66 }; | 73 }; |
| 67 | 74 |
| 68 } // namespace ash | 75 } // namespace ash |
| 69 | 76 |
| 70 #endif // #ifndef ASH_WM_PARTIAL_SCREENSHOT_VIEW_H_ | 77 #endif // #ifndef ASH_WM_PARTIAL_SCREENSHOT_VIEW_H_ |
| OLD | NEW |