summaryrefslogtreecommitdiffstats
path: root/ash/test/test_screenshot_delegate.h
blob: 9c25920c36b4afb60a24020b49194153ff996348 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_
#define ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_

#include "ash/screenshot_delegate.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ui/gfx/rect.h"

namespace ash {
namespace test {

class TestScreenshotDelegate : public ScreenshotDelegate {
 public:
  TestScreenshotDelegate();
  ~TestScreenshotDelegate() override;

  // Overridden from ScreenshotDelegate:
  void HandleTakeScreenshotForAllRootWindows() override;
  void HandleTakePartialScreenshot(aura::Window* window,
                                   const gfx::Rect& rect) override;
  bool CanTakeScreenshot() override;

  int handle_take_screenshot_count() const {
    return handle_take_screenshot_count_;
  }

  int handle_take_partial_screenshot_count() const {
    return handle_take_partial_screenshot_count_;
  }

  const gfx::Rect& last_rect() const { return last_rect_; }

  void set_can_take_screenshot(bool can_take_screenshot) {
    can_take_screenshot_ = can_take_screenshot;
  }

 private:
  int handle_take_screenshot_count_;
  int handle_take_partial_screenshot_count_;
  gfx::Rect last_rect_;
  bool can_take_screenshot_;

  DISALLOW_COPY_AND_ASSIGN(TestScreenshotDelegate);
};

}  // namespace test
}  // namespace ash

#endif  // ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_