| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/ui/gtk/tab_contents_container_gtk.h" | 8 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" |
| 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 10 #include "chrome/browser/ui/webui/web_dialog_delegate.h" | |
| 11 #include "chrome/browser/ui/webui/web_dialog_ui.h" | |
| 12 #include "content/public/browser/notification_source.h" | 10 #include "content/public/browser/notification_source.h" |
| 13 #include "content/public/browser/render_view_host.h" | 11 #include "content/public/browser/render_view_host.h" |
| 14 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
| 15 #include "ui/base/gtk/gtk_hig_constants.h" | 13 #include "ui/base/gtk/gtk_hig_constants.h" |
| 16 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
| 15 #include "ui/web_dialogs/web_dialog_delegate.h" |
| 16 #include "ui/web_dialogs/web_dialog_ui.h" |
| 17 | 17 |
| 18 using content::WebContents; | 18 using content::WebContents; |
| 19 using ui::ConstrainedWebDialogDelegate; |
| 20 using ui::ConstrainedWebDialogUI; |
| 21 using ui::WebDialogDelegate; |
| 19 | 22 |
| 20 class ConstrainedWebDialogDelegateGtk : public ConstrainedWindowGtkDelegate, | 23 class ConstrainedWebDialogDelegateGtk : public ConstrainedWindowGtkDelegate, |
| 21 public ConstrainedWebDialogDelegate { | 24 public ConstrainedWebDialogDelegate { |
| 22 public: | 25 public: |
| 23 ConstrainedWebDialogDelegateGtk( | 26 ConstrainedWebDialogDelegateGtk( |
| 24 Profile* profile, | 27 Profile* profile, |
| 25 WebDialogDelegate* delegate, | 28 WebDialogDelegate* delegate, |
| 26 WebDialogWebContentsDelegate* tab_delegate); | 29 WebDialogWebContentsDelegate* tab_delegate); |
| 27 | 30 |
| 28 virtual ~ConstrainedWebDialogDelegateGtk() {} | 31 virtual ~ConstrainedWebDialogDelegateGtk() {} |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 90 |
| 88 gfx::Size dialog_size; | 91 gfx::Size dialog_size; |
| 89 delegate->GetDialogSize(&dialog_size); | 92 delegate->GetDialogSize(&dialog_size); |
| 90 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_.widget()), | 93 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_.widget()), |
| 91 dialog_size.width(), | 94 dialog_size.width(), |
| 92 dialog_size.height()); | 95 dialog_size.height()); |
| 93 | 96 |
| 94 gtk_widget_show_all(GetWidgetRoot()); | 97 gtk_widget_show_all(GetWidgetRoot()); |
| 95 } | 98 } |
| 96 | 99 |
| 97 // static | 100 ConstrainedWebDialogDelegate* ui::CreateConstrainedWebDialog( |
| 98 ConstrainedWebDialogDelegate* | |
| 99 ConstrainedWebDialogUI::CreateConstrainedWebDialog( | |
| 100 Profile* profile, | 101 Profile* profile, |
| 101 WebDialogDelegate* delegate, | 102 WebDialogDelegate* delegate, |
| 102 WebDialogWebContentsDelegate* tab_delegate, | 103 WebDialogWebContentsDelegate* tab_delegate, |
| 103 TabContentsWrapper* overshadowed) { | 104 TabContentsWrapper* overshadowed) { |
| 104 ConstrainedWebDialogDelegateGtk* constrained_delegate = | 105 ConstrainedWebDialogDelegateGtk* constrained_delegate = |
| 105 new ConstrainedWebDialogDelegateGtk(profile, delegate, tab_delegate); | 106 new ConstrainedWebDialogDelegateGtk(profile, delegate, tab_delegate); |
| 106 ConstrainedWindow* constrained_window = | 107 ConstrainedWindow* constrained_window = |
| 107 new ConstrainedWindowGtk(overshadowed, constrained_delegate); | 108 new ConstrainedWindowGtk(overshadowed, constrained_delegate); |
| 108 constrained_delegate->set_window(constrained_window); | 109 constrained_delegate->set_window(constrained_window); |
| 109 return constrained_delegate; | 110 return constrained_delegate; |
| 110 } | 111 } |
| OLD | NEW |