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

Side by Side Diff: chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc

Issue 12276010: Factor out uses of the WebContentsModalDialog interface from platform-independent code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove CloseWebContentsModalDialog call from ConstrainedWebDialogDelegateBase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h" 5 #include "chrome/browser/ui/webui/constrained_web_dialog_delegate_base.h"
6 6
7 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" 7 #include "chrome/browser/ui/gtk/constrained_window_gtk.h"
8 #include "content/public/browser/notification_source.h" 8 #include "content/public/browser/notification_source.h"
9 #include "content/public/browser/render_view_host.h" 9 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 10 matching lines...) Expand all
21 class ConstrainedWebDialogDelegateGtk : public ConstrainedWindowGtkDelegate, 21 class ConstrainedWebDialogDelegateGtk : public ConstrainedWindowGtkDelegate,
22 public ConstrainedWebDialogDelegate { 22 public ConstrainedWebDialogDelegate {
23 public: 23 public:
24 ConstrainedWebDialogDelegateGtk( 24 ConstrainedWebDialogDelegateGtk(
25 content::BrowserContext* browser_context, 25 content::BrowserContext* browser_context,
26 WebDialogDelegate* delegate, 26 WebDialogDelegate* delegate,
27 WebDialogWebContentsDelegate* tab_delegate); 27 WebDialogWebContentsDelegate* tab_delegate);
28 28
29 virtual ~ConstrainedWebDialogDelegateGtk() {} 29 virtual ~ConstrainedWebDialogDelegateGtk() {}
30 30
31 void set_window(WebContentsModalDialog* dialog) {
32 return impl_->set_window(dialog);
33 }
34
35 // ConstrainedWebDialogDelegate interface 31 // ConstrainedWebDialogDelegate interface
36 virtual const WebDialogDelegate* 32 virtual const WebDialogDelegate*
37 GetWebDialogDelegate() const OVERRIDE { 33 GetWebDialogDelegate() const OVERRIDE {
38 return impl_->GetWebDialogDelegate(); 34 return impl_->GetWebDialogDelegate();
39 } 35 }
40 virtual WebDialogDelegate* GetWebDialogDelegate() OVERRIDE { 36 virtual WebDialogDelegate* GetWebDialogDelegate() OVERRIDE {
41 return impl_->GetWebDialogDelegate(); 37 return impl_->GetWebDialogDelegate();
42 } 38 }
43 virtual void OnDialogCloseFromWebUI() OVERRIDE { 39 virtual void OnDialogCloseFromWebUI() OVERRIDE {
44 return impl_->OnDialogCloseFromWebUI(); 40 return impl_->OnDialogCloseFromWebUI();
45 } 41 }
46 virtual void ReleaseWebContentsOnDialogClose() OVERRIDE { 42 virtual void ReleaseWebContentsOnDialogClose() OVERRIDE {
47 return impl_->ReleaseWebContentsOnDialogClose(); 43 return impl_->ReleaseWebContentsOnDialogClose();
48 } 44 }
49 virtual WebContentsModalDialog* GetWindow() OVERRIDE { 45 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE {
50 return impl_->GetWindow(); 46 return impl_->GetNativeWindow();
51 } 47 }
52 virtual WebContents* GetWebContents() OVERRIDE { 48 virtual WebContents* GetWebContents() OVERRIDE {
53 return impl_->GetWebContents(); 49 return impl_->GetWebContents();
54 } 50 }
55 51
56 // ConstrainedWindowGtkDelegate interface 52 // ConstrainedWindowGtkDelegate interface
57 virtual GtkWidget* GetWidgetRoot() OVERRIDE { 53 virtual GtkWidget* GetWidgetRoot() OVERRIDE {
58 return GetWebContents()->GetView()->GetNativeView(); 54 return GetWebContents()->GetView()->GetNativeView();
59 } 55 }
60 virtual GtkWidget* GetFocusWidget() OVERRIDE { 56 virtual GtkWidget* GetFocusWidget() OVERRIDE {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 88 }
93 89
94 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( 90 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog(
95 content::BrowserContext* browser_context, 91 content::BrowserContext* browser_context,
96 WebDialogDelegate* delegate, 92 WebDialogDelegate* delegate,
97 WebDialogWebContentsDelegate* tab_delegate, 93 WebDialogWebContentsDelegate* tab_delegate,
98 content::WebContents* web_contents) { 94 content::WebContents* web_contents) {
99 ConstrainedWebDialogDelegateGtk* constrained_delegate = 95 ConstrainedWebDialogDelegateGtk* constrained_delegate =
100 new ConstrainedWebDialogDelegateGtk( 96 new ConstrainedWebDialogDelegateGtk(
101 browser_context, delegate, tab_delegate); 97 browser_context, delegate, tab_delegate);
102 WebContentsModalDialog* web_contents_modal_dialog = 98 new ConstrainedWindowGtk(web_contents, constrained_delegate);
103 new ConstrainedWindowGtk(web_contents, constrained_delegate);
104 constrained_delegate->set_window(web_contents_modal_dialog);
105 return constrained_delegate; 99 return constrained_delegate;
106 } 100 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698