Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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; | |
|
Mike Wittman
2013/08/22 17:46:10
Probably needs to be implemented for chromeos::Web
Rune Fevang
2013/08/23 02:57:43
Done.
| |
| 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_ |
| OLD | NEW |