summaryrefslogtreecommitdiffstats
path: root/components/web_modal/test_web_contents_modal_dialog_host.h
blob: 89fb4b399c6c341e82a77e2499abc9953ea84a62 (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
// 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 COMPONENTS_WEB_MODAL_TEST_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
#define COMPONENTS_WEB_MODAL_TEST_WEB_CONTENTS_MODAL_DIALOG_HOST_H_

#include "components/web_modal/web_contents_modal_dialog_host.h"

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/size.h"

namespace web_modal {

class TestWebContentsModalDialogHost : public WebContentsModalDialogHost {
 public:
  explicit TestWebContentsModalDialogHost(gfx::NativeView host_view);
  virtual ~TestWebContentsModalDialogHost();

  // WebContentsModalDialogHost:
  virtual gfx::Size GetMaximumDialogSize() OVERRIDE;
  virtual gfx::NativeView GetHostView() const OVERRIDE;
  virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE;
  virtual void AddObserver(ModalDialogHostObserver* observer) OVERRIDE;
  virtual void RemoveObserver(ModalDialogHostObserver* observer) OVERRIDE;

  void set_max_dialog_size(const gfx::Size& max_dialog_size) {
    max_dialog_size_ = max_dialog_size;
  }

 private:
  gfx::NativeView host_view_;
  gfx::Size max_dialog_size_;

  DISALLOW_COPY_AND_ASSIGN(TestWebContentsModalDialogHost);
};

}  // namespace web_modal

#endif  // COMPONENTS_WEB_MODAL_TEST_WEB_CONTENTS_MODAL_DIALOG_HOST_H_