summaryrefslogtreecommitdiffstats
path: root/views/test/test_views_delegate.h
blob: 7f5496786d11a1f17bf6fafa4dd9d6e83ffe794f (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
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (c) 2011 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 VIEWS_TEST_TEST_VIEWS_DELEGATE_H_
#define VIEWS_TEST_TEST_VIEWS_DELEGATE_H_

#include "base/memory/scoped_ptr.h"
#include "ui/base/accessibility/accessibility_types.h"
#include "ui/base/clipboard/clipboard.h"
#include "views/views_delegate.h"

// TODO(beng): this whole file should be in the views namespace.
namespace views {
class View;
class Widget;
}

class TestViewsDelegate : public views::ViewsDelegate {
 public:
  TestViewsDelegate();
  virtual ~TestViewsDelegate();

  // Overridden from views::ViewsDelegate:
  virtual ui::Clipboard* GetClipboard() const OVERRIDE;
  virtual views::View* GetDefaultParentView() OVERRIDE { return NULL; }
  virtual void SaveWindowPlacement(const views::Widget* window,
                                   const std::wstring& window_name,
                                   const gfx::Rect& bounds,
                                   bool maximized) OVERRIDE { }
  virtual bool GetSavedWindowBounds(const views::Widget* window,
                                    const std::wstring& window_name,
                                    gfx::Rect* bounds) const OVERRIDE;

  virtual bool GetSavedMaximizedState(const views::Widget* window,
                                      const std::wstring& window_name,
                                      bool* maximized) const OVERRIDE;

  virtual void NotifyAccessibilityEvent(
      views::View* view, ui::AccessibilityTypes::Event event_type) OVERRIDE {}

  virtual void NotifyMenuItemFocused(
      const std::wstring& menu_name,
      const std::wstring& menu_item_name,
      int item_index,
      int item_count,
      bool has_submenu) OVERRIDE {}
#if defined(OS_WIN)
  virtual HICON GetDefaultWindowIcon() const OVERRIDE {
    return NULL;
  }
#endif

  virtual void AddRef() OVERRIDE {}
  virtual void ReleaseRef() OVERRIDE {}

  virtual int GetDispositionForEvent(int event_flags) OVERRIDE;

 private:
  mutable scoped_ptr<ui::Clipboard> clipboard_;

  DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate);
};

#endif  // VIEWS_TEST_TEST_VIEWS_DELEGATE_H_