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

Unified Diff: chrome/browser/ui/views/constrained_window_views.h

Issue 12045037: Refactor modality-specific behavior from ConstrainedWindowViews to WebContentsModalDialogManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Android link error Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/constrained_window_views.h
diff --git a/chrome/browser/ui/views/constrained_window_views.h b/chrome/browser/ui/views/constrained_window_views.h
index 3a5afddcc40d7446c3886a97a3cb298f352a6c6b..fef4ab345a754bf2637478b68b260bdba8023c94 100644
--- a/chrome/browser/ui/views/constrained_window_views.h
+++ b/chrome/browser/ui/views/constrained_window_views.h
@@ -23,31 +23,6 @@ class NonClientFrameView;
class WidgetDelegate;
}
-class NativeConstrainedWindowDelegate {
- public:
- virtual ~NativeConstrainedWindowDelegate() {}
-
- // Called after the NativeConstrainedWindow has been destroyed and is about to
- // be deleted.
- virtual void OnNativeConstrainedWindowDestroyed() = 0;
-
- // Called when the NativeConstrainedWindow is clicked on when inactive.
- virtual void OnNativeConstrainedWindowMouseActivate() = 0;
-
- virtual views::internal::NativeWidgetDelegate* AsNativeWidgetDelegate() = 0;
-};
-
-class NativeConstrainedWindow {
- public:
- virtual ~NativeConstrainedWindow() {}
-
- // Creates a platform-specific implementation of NativeConstrainedWindow.
- static NativeConstrainedWindow* CreateNativeConstrainedWindow(
- NativeConstrainedWindowDelegate* delegate);
-
- virtual views::NativeWidget* AsNativeWidget() = 0;
-};
-
///////////////////////////////////////////////////////////////////////////////
// ConstrainedWindowViews
//
@@ -56,16 +31,13 @@ class NativeConstrainedWindow {
// itself and will be deleted soon after being closed.
//
class ConstrainedWindowViews : public views::Widget,
- public WebContentsModalDialog,
- public NativeConstrainedWindowDelegate {
+ public WebContentsModalDialog {
public:
- ConstrainedWindowViews(content::WebContents* web_contents,
+ ConstrainedWindowViews(gfx::NativeView parent,
+ bool off_the_record,
views::WidgetDelegate* widget_delegate);
virtual ~ConstrainedWindowViews();
- // Returns the WebContents that constrains this Constrained Window.
- content::WebContents* owner() const { return web_contents_; }
-
// Overridden from WebContentsModalDialog:
virtual void ShowWebContentsModalDialog() OVERRIDE;
virtual void CloseWebContentsModalDialog() OVERRIDE;
@@ -73,23 +45,15 @@ class ConstrainedWindowViews : public views::Widget,
virtual void PulseWebContentsModalDialog() OVERRIDE;
virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
- // Default insets for the dialog:
- static gfx::Insets GetDefaultInsets();
+ // Factory function for the class (temporary).
+ static ConstrainedWindowViews* Create(content::WebContents* web_contents,
+ views::WidgetDelegate* widget_delegate);
private:
// Overridden from views::Widget:
virtual views::NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
- // Overridden from NativeConstrainedWindowDelegate:
- virtual void OnNativeConstrainedWindowDestroyed() OVERRIDE;
- virtual void OnNativeConstrainedWindowMouseActivate() OVERRIDE;
- virtual views::internal::NativeWidgetDelegate*
- AsNativeWidgetDelegate() OVERRIDE;
- virtual int GetNonClientComponent(const gfx::Point& point) OVERRIDE;
-
- content::WebContents* web_contents_;
-
- NativeConstrainedWindow* native_constrained_window_;
+ bool off_the_record_;
DISALLOW_COPY_AND_ASSIGN(ConstrainedWindowViews);
};
« no previous file with comments | « chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc ('k') | chrome/browser/ui/views/constrained_window_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698