test_web_contents_modal_dialog_host.h revision 8bcbed890bc3ce4d7a057a8f32cab53fa534672e
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 COMPONENTS_WEB_MODAL_TEST_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
6#define COMPONENTS_WEB_MODAL_TEST_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
7
8#include "components/web_modal/web_contents_modal_dialog_host.h"
9
10#include "base/basictypes.h"
11#include "base/compiler_specific.h"
12#include "ui/gfx/native_widget_types.h"
13#include "ui/gfx/size.h"
14
15namespace web_modal {
16
17class TestWebContentsModalDialogHost : public WebContentsModalDialogHost {
18 public:
19  explicit TestWebContentsModalDialogHost(gfx::NativeView host_view);
20  virtual ~TestWebContentsModalDialogHost();
21
22  // WebContentsModalDialogHost:
23  virtual gfx::Size GetMaximumDialogSize() OVERRIDE;
24  virtual gfx::NativeView GetHostView() const OVERRIDE;
25  virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE;
26  virtual void AddObserver(ModalDialogHostObserver* observer) OVERRIDE;
27  virtual void RemoveObserver(ModalDialogHostObserver* observer) OVERRIDE;
28
29  void set_max_dialog_size(const gfx::Size& max_dialog_size) {
30    max_dialog_size_ = max_dialog_size;
31  }
32
33 private:
34  gfx::NativeView host_view_;
35  gfx::Size max_dialog_size_;
36
37  DISALLOW_COPY_AND_ASSIGN(TestWebContentsModalDialogHost);
38};
39
40}  // namespace web_modal
41
42#endif  // COMPONENTS_WEB_MODAL_TEST_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
43