summaryrefslogtreecommitdiffstats
path: root/views/test/test_views_delegate.cc
blob: d25e729e7685cc11cdd4a4dcacb9c3253943abdd (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
// 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.

#include "views/test/test_views_delegate.h"

#include "base/logging.h"
#include "ui/base/clipboard/clipboard.h"

namespace views {

TestViewsDelegate::TestViewsDelegate()
    : default_parent_view_(NULL) {
  DCHECK(!ViewsDelegate::views_delegate);
  ViewsDelegate::views_delegate = this;
}

TestViewsDelegate::~TestViewsDelegate() {
  ViewsDelegate::views_delegate = NULL;
}

ui::Clipboard* TestViewsDelegate::GetClipboard() const {
  if (!clipboard_.get()) {
    // Note that we need a MessageLoop for the next call to work.
    clipboard_.reset(new ui::Clipboard);
  }
  return clipboard_.get();
}

View* TestViewsDelegate::GetDefaultParentView() {
  return default_parent_view_;
}

bool TestViewsDelegate::GetSavedWindowBounds(const std::wstring& window_name,
                                             gfx::Rect* bounds) const {
  return false;
}

bool TestViewsDelegate::GetSavedMaximizedState(const std::wstring& window_name,
                                               bool* maximized) const {
  return false;
}

int TestViewsDelegate::GetDispositionForEvent(int event_flags) {
  return 0;
}

}  // namespace views