OLD | NEW |
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 #include "ash/test/test_screenshot_delegate.h" | 5 #include "ash/test/test_screenshot_delegate.h" |
6 | 6 |
7 namespace ash { | 7 namespace ash { |
8 namespace test { | 8 namespace test { |
9 | 9 |
10 TestScreenshotDelegate::TestScreenshotDelegate() | 10 TestScreenshotDelegate::TestScreenshotDelegate() |
11 : handle_take_screenshot_count_(0), | 11 : handle_take_screenshot_count_(0), |
12 handle_take_partial_screenshot_count_(0), | 12 handle_take_partial_screenshot_count_(0), |
13 can_take_screenshot_(true), | 13 can_take_screenshot_(true), |
14 selected_window_(nullptr) { | 14 selected_window_(nullptr) {} |
15 } | |
16 | 15 |
17 TestScreenshotDelegate::~TestScreenshotDelegate() { | 16 TestScreenshotDelegate::~TestScreenshotDelegate() {} |
18 } | |
19 | 17 |
20 void TestScreenshotDelegate::HandleTakeScreenshotForAllRootWindows() { | 18 void TestScreenshotDelegate::HandleTakeScreenshotForAllRootWindows() { |
21 handle_take_screenshot_count_++; | 19 handle_take_screenshot_count_++; |
22 } | 20 } |
23 | 21 |
24 void TestScreenshotDelegate::HandleTakePartialScreenshot( | 22 void TestScreenshotDelegate::HandleTakePartialScreenshot( |
25 aura::Window* window, const gfx::Rect& rect) { | 23 aura::Window* window, |
| 24 const gfx::Rect& rect) { |
26 handle_take_partial_screenshot_count_++; | 25 handle_take_partial_screenshot_count_++; |
27 last_rect_ = rect; | 26 last_rect_ = rect; |
28 } | 27 } |
29 | 28 |
30 void TestScreenshotDelegate::HandleTakeWindowScreenshot(aura::Window* window) { | 29 void TestScreenshotDelegate::HandleTakeWindowScreenshot(aura::Window* window) { |
31 selected_window_ = window; | 30 selected_window_ = window; |
32 } | 31 } |
33 | 32 |
34 bool TestScreenshotDelegate::CanTakeScreenshot() { | 33 bool TestScreenshotDelegate::CanTakeScreenshot() { |
35 return can_take_screenshot_; | 34 return can_take_screenshot_; |
36 } | 35 } |
37 | 36 |
38 const aura::Window* TestScreenshotDelegate::GetSelectedWindowAndReset() { | 37 const aura::Window* TestScreenshotDelegate::GetSelectedWindowAndReset() { |
39 aura::Window* result = selected_window_; | 38 aura::Window* result = selected_window_; |
40 selected_window_ = nullptr; | 39 selected_window_ = nullptr; |
41 return result; | 40 return result; |
42 } | 41 } |
43 | 42 |
44 } // namespace test | 43 } // namespace test |
45 } // namespace ash | 44 } // namespace ash |
OLD | NEW |