Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: ash/test/test_screenshot_delegate.h

Issue 1827323002: Take screenshot of active window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_TEST_TEST_SCREENSHOT_DELEGATE_H_ 5 #ifndef ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_
6 #define ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_ 6 #define ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_
7 7
8 #include "ash/screenshot_delegate.h" 8 #include "ash/screenshot_delegate.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "ui/gfx/geometry/rect.h" 11 #include "ui/gfx/geometry/rect.h"
12 12
13 namespace ash { 13 namespace ash {
14 namespace test { 14 namespace test {
15 15
16 class TestScreenshotDelegate : public ScreenshotDelegate { 16 class TestScreenshotDelegate : public ScreenshotDelegate {
17 public: 17 public:
18 TestScreenshotDelegate(); 18 TestScreenshotDelegate();
19 ~TestScreenshotDelegate() override; 19 ~TestScreenshotDelegate() override;
20 20
21 // Overridden from ScreenshotDelegate: 21 // Overridden from ScreenshotDelegate:
22 void HandleTakeScreenshotForAllRootWindows() override; 22 void HandleTakeScreenshotForAllRootWindows() override;
23 void HandleTakePartialScreenshot(aura::Window* window, 23 void HandleTakePartialScreenshot(aura::Window* window,
24 const gfx::Rect& rect) override; 24 const gfx::Rect& rect) override;
25 void HandleTakeWindowScreenshot(aura::Window* window) override;
25 bool CanTakeScreenshot() override; 26 bool CanTakeScreenshot() override;
26 27
27 int handle_take_screenshot_count() const { 28 int handle_take_screenshot_count() const {
28 return handle_take_screenshot_count_; 29 return handle_take_screenshot_count_;
29 } 30 }
30 31
31 int handle_take_partial_screenshot_count() const { 32 int handle_take_partial_screenshot_count() const {
32 return handle_take_partial_screenshot_count_; 33 return handle_take_partial_screenshot_count_;
33 } 34 }
34 35
36 int handle_take_window_screenshot_count() const {
37 return handle_take_window_screenshot_count_;
38 }
39
35 const gfx::Rect& last_rect() const { return last_rect_; } 40 const gfx::Rect& last_rect() const { return last_rect_; }
36 41
37 void set_can_take_screenshot(bool can_take_screenshot) { 42 void set_can_take_screenshot(bool can_take_screenshot) {
38 can_take_screenshot_ = can_take_screenshot; 43 can_take_screenshot_ = can_take_screenshot;
39 } 44 }
40 45
41 private: 46 private:
42 int handle_take_screenshot_count_; 47 int handle_take_screenshot_count_;
43 int handle_take_partial_screenshot_count_; 48 int handle_take_partial_screenshot_count_;
49 int handle_take_window_screenshot_count_;
44 gfx::Rect last_rect_; 50 gfx::Rect last_rect_;
45 bool can_take_screenshot_; 51 bool can_take_screenshot_;
46 52
47 DISALLOW_COPY_AND_ASSIGN(TestScreenshotDelegate); 53 DISALLOW_COPY_AND_ASSIGN(TestScreenshotDelegate);
48 }; 54 };
49 55
50 } // namespace test 56 } // namespace test
51 } // namespace ash 57 } // namespace ash
52 58
53 #endif // ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_ 59 #endif // ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698