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

Side by Side Diff: components/web_modal/web_contents_modal_dialog_host.h

Issue 22903022: Limit constrained windows to the size of the parent view. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: No initializer Created 7 years, 3 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
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | ui/views/bubble/bubble_frame_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_HOST_H_ 5 #ifndef COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
6 #define COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_HOST_H_ 6 #define COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
7 7
8 #include "ui/gfx/native_widget_types.h" 8 #include "ui/gfx/native_widget_types.h"
9 #include "ui/gfx/point.h" 9
10 #include "ui/gfx/size.h" 10 namespace gfx {
11 class Point;
12 class Size;
13 }
11 14
12 namespace web_modal { 15 namespace web_modal {
13 16
14 // Observer to be implemented to update web contents modal dialogs when the host 17 // Observer to be implemented to update web contents modal dialogs when the host
15 // indicates their position needs to be changed. 18 // indicates their position needs to be changed.
16 class WebContentsModalDialogHostObserver { 19 class WebContentsModalDialogHostObserver {
17 public: 20 public:
18 virtual ~WebContentsModalDialogHostObserver(); 21 virtual ~WebContentsModalDialogHostObserver();
19 22
20 virtual void OnPositionRequiresUpdate() = 0; 23 virtual void OnPositionRequiresUpdate() = 0;
(...skipping 11 matching lines...) Expand all
32 class WebContentsModalDialogHost { 35 class WebContentsModalDialogHost {
33 public: 36 public:
34 virtual ~WebContentsModalDialogHost(); 37 virtual ~WebContentsModalDialogHost();
35 38
36 // Returns the view against which the dialog is positioned and parented. 39 // Returns the view against which the dialog is positioned and parented.
37 virtual gfx::NativeView GetHostView() const = 0; 40 virtual gfx::NativeView GetHostView() const = 0;
38 // Gets the position for the dialog in coordinates relative to the host 41 // Gets the position for the dialog in coordinates relative to the host
39 // view. 42 // view.
40 virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0; 43 virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0;
41 44
45 // Returns the maximum dimensions a dialog can have.
46 virtual gfx::Size GetMaximumDialogSize() = 0;
47
42 // Add/remove observer. 48 // Add/remove observer.
43 virtual void AddObserver(WebContentsModalDialogHostObserver* observer) = 0; 49 virtual void AddObserver(WebContentsModalDialogHostObserver* observer) = 0;
44 virtual void RemoveObserver(WebContentsModalDialogHostObserver* observer) = 0; 50 virtual void RemoveObserver(WebContentsModalDialogHostObserver* observer) = 0;
45 51
46 protected: 52 protected:
47 WebContentsModalDialogHost(); 53 WebContentsModalDialogHost();
48 54
49 private: 55 private:
50 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHost); 56 DISALLOW_COPY_AND_ASSIGN(WebContentsModalDialogHost);
51 }; 57 };
52 58
53 } // namespace web_modal 59 } // namespace web_modal
54 60
55 #endif // COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_HOST_H_ 61 #endif // COMPONENTS_WEB_MODAL_WEB_CONTENTS_MODAL_DIALOG_HOST_H_
OLDNEW
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | ui/views/bubble/bubble_frame_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698