Home | History | Annotate | Download | only in test
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_
      6 #define ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_
      7 
      8 #include "ash/screenshot_delegate.h"
      9 #include "base/basictypes.h"
     10 #include "base/compiler_specific.h"
     11 #include "ui/gfx/rect.h"
     12 
     13 namespace ash {
     14 namespace test {
     15 
     16 class TestScreenshotDelegate : public ScreenshotDelegate {
     17  public:
     18   TestScreenshotDelegate();
     19   virtual ~TestScreenshotDelegate();
     20 
     21   // Overridden from ScreenshotDelegate:
     22   virtual void HandleTakeScreenshotForAllRootWindows() OVERRIDE;
     23   virtual void HandleTakePartialScreenshot(
     24       aura::Window* window, const gfx::Rect& rect) OVERRIDE;
     25   virtual bool CanTakeScreenshot() OVERRIDE;
     26 
     27   int handle_take_screenshot_count() const {
     28     return handle_take_screenshot_count_;
     29   }
     30 
     31   int handle_take_partial_screenshot_count() const {
     32     return handle_take_partial_screenshot_count_;
     33   }
     34 
     35   const gfx::Rect& last_rect() const { return last_rect_; }
     36 
     37   void set_can_take_screenshot(bool can_take_screenshot) {
     38     can_take_screenshot_ = can_take_screenshot;
     39   }
     40 
     41  private:
     42   int handle_take_screenshot_count_;
     43   int handle_take_partial_screenshot_count_;
     44   gfx::Rect last_rect_;
     45   bool can_take_screenshot_;
     46 
     47   DISALLOW_COPY_AND_ASSIGN(TestScreenshotDelegate);
     48 };
     49 
     50 }  // namespace test
     51 }  // namespace ash
     52 
     53 #endif  // ASH_TEST_TEST_SCREENSHOT_DELEGATE_H_
     54