Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: chrome/browser/ui/web_contents_modal_dialog_host.h

Issue 14969012: components: Create web_modal component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-before-land Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 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 CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
6 #define CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
7
8 #include "ui/gfx/native_widget_types.h"
9 #include "ui/gfx/point.h"
10 #include "ui/gfx/size.h"
11
12 // Observer to be implemented to update web contents modal dialogs when the host
13 // indicates their position needs to be changed.
14 class WebContentsModalDialogHostObserver {
15 public:
16 virtual ~WebContentsModalDialogHostObserver();
17
18 virtual void OnPositionRequiresUpdate() = 0;
19
20 protected:
21 WebContentsModalDialogHostObserver();
22
23 private:
24 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHostObserver);
25 };
26
27 // Interface for supporting positioning of web contents modal dialogs over a
28 // window/widget.
29 class WebContentsModalDialogHost {
30 public:
31 virtual ~WebContentsModalDialogHost();
32
33 // Returns the view against which the dialog is positioned and parented.
34 virtual gfx::NativeView GetHostView() const = 0;
35 // Gets the position for the dialog in coordinates relative to the host
36 // view.
37 virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0;
38
39 // Add/remove observer.
40 virtual void AddObserver(WebContentsModalDialogHostObserver* observer) = 0;
41 virtual void RemoveObserver(WebContentsModalDialogHostObserver* observer) = 0;
42
43 protected:
44 WebContentsModalDialogHost();
45
46 private:
47 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHost);
48 };
49
50 #endif // CHROME_BROWSER_UI_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698