| OLD | NEW |
| 1 // Copyright (c) 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 "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.h" | 9 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 10 #include "content/public/browser/notification_source.h" | 10 #include "content/public/browser/notification_source.h" |
| 11 #include "content/public/browser/render_view_host.h" | 11 #include "content/public/browser/render_view_host.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateGtk); | 79 DISALLOW_COPY_AND_ASSIGN(ConstrainedWebDialogDelegateGtk); |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 ConstrainedWebDialogDelegateGtk::ConstrainedWebDialogDelegateGtk( | 82 ConstrainedWebDialogDelegateGtk::ConstrainedWebDialogDelegateGtk( |
| 83 Profile* profile, | 83 Profile* profile, |
| 84 WebDialogDelegate* delegate, | 84 WebDialogDelegate* delegate, |
| 85 WebDialogWebContentsDelegate* tab_delegate) | 85 WebDialogWebContentsDelegate* tab_delegate) |
| 86 : impl_(new ConstrainedWebDialogDelegateBase(profile, delegate, tab_delegate
)), | 86 : impl_(new ConstrainedWebDialogDelegateBase(profile, delegate, tab_delegate
)), |
| 87 tab_contents_container_(NULL) { | 87 tab_contents_container_(NULL) { |
| 88 tab_contents_container_.SetTab(tab()); | 88 tab_contents_container_.SetTab(tab()->web_contents()); |
| 89 | 89 |
| 90 gfx::Size dialog_size; | 90 gfx::Size dialog_size; |
| 91 delegate->GetDialogSize(&dialog_size); | 91 delegate->GetDialogSize(&dialog_size); |
| 92 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_.widget()), | 92 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_.widget()), |
| 93 dialog_size.width(), | 93 dialog_size.width(), |
| 94 dialog_size.height()); | 94 dialog_size.height()); |
| 95 | 95 |
| 96 gtk_widget_show_all(GetWidgetRoot()); | 96 gtk_widget_show_all(GetWidgetRoot()); |
| 97 } | 97 } |
| 98 | 98 |
| 99 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( | 99 ConstrainedWebDialogDelegate* CreateConstrainedWebDialog( |
| 100 Profile* profile, | 100 Profile* profile, |
| 101 WebDialogDelegate* delegate, | 101 WebDialogDelegate* delegate, |
| 102 WebDialogWebContentsDelegate* tab_delegate, | 102 WebDialogWebContentsDelegate* tab_delegate, |
| 103 content::WebContents* web_contents) { | 103 content::WebContents* web_contents) { |
| 104 ConstrainedWebDialogDelegateGtk* constrained_delegate = | 104 ConstrainedWebDialogDelegateGtk* constrained_delegate = |
| 105 new ConstrainedWebDialogDelegateGtk(profile, delegate, tab_delegate); | 105 new ConstrainedWebDialogDelegateGtk(profile, delegate, tab_delegate); |
| 106 ConstrainedWindow* constrained_window = | 106 ConstrainedWindow* constrained_window = |
| 107 new ConstrainedWindowGtk(web_contents, constrained_delegate); | 107 new ConstrainedWindowGtk(web_contents, constrained_delegate); |
| 108 constrained_delegate->set_window(constrained_window); | 108 constrained_delegate->set_window(constrained_window); |
| 109 return constrained_delegate; | 109 return constrained_delegate; |
| 110 } | 110 } |
| OLD | NEW |