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