OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_html_ui.h" | 5 #include "chrome/browser/ui/webui/constrained_html_ui.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 8 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
9 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" | 9 #include "chrome/browser/ui/gtk/tab_contents_container_gtk.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 10 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 window_(NULL), | 78 window_(NULL), |
79 closed_via_webui_(false) { | 79 closed_via_webui_(false) { |
80 tab_.tab_contents()->set_delegate(this); | 80 tab_.tab_contents()->set_delegate(this); |
81 | 81 |
82 // Set |this| as a property on the tab contents so that the ConstrainedHtmlUI | 82 // Set |this| as a property on the tab contents so that the ConstrainedHtmlUI |
83 // can get a reference to |this|. | 83 // can get a reference to |this|. |
84 ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( | 84 ConstrainedHtmlUI::GetPropertyAccessor().SetProperty( |
85 tab_.tab_contents()->property_bag(), this); | 85 tab_.tab_contents()->property_bag(), this); |
86 | 86 |
87 tab_.tab_contents()->controller().LoadURL( | 87 tab_.tab_contents()->controller().LoadURL( |
88 delegate->GetDialogContentURL(), GURL(), PageTransition::START_PAGE, | 88 delegate->GetDialogContentURL(), GURL(), |
89 std::string()); | 89 content::PAGE_TRANSITION_START_PAGE, std::string()); |
90 tab_contents_container_.SetTab(&tab_); | 90 tab_contents_container_.SetTab(&tab_); |
91 | 91 |
92 gfx::Size dialog_size; | 92 gfx::Size dialog_size; |
93 delegate->GetDialogSize(&dialog_size); | 93 delegate->GetDialogSize(&dialog_size); |
94 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_.widget()), | 94 gtk_widget_set_size_request(GTK_WIDGET(tab_contents_container_.widget()), |
95 dialog_size.width(), | 95 dialog_size.width(), |
96 dialog_size.height()); | 96 dialog_size.height()); |
97 | 97 |
98 gtk_widget_show_all(GetWidgetRoot()); | 98 gtk_widget_show_all(GetWidgetRoot()); |
99 } | 99 } |
(...skipping 16 matching lines...) Expand all Loading... |
116 Profile* profile, | 116 Profile* profile, |
117 HtmlDialogUIDelegate* delegate, | 117 HtmlDialogUIDelegate* delegate, |
118 TabContentsWrapper* overshadowed) { | 118 TabContentsWrapper* overshadowed) { |
119 ConstrainedHtmlDelegateGtk* constrained_delegate = | 119 ConstrainedHtmlDelegateGtk* constrained_delegate = |
120 new ConstrainedHtmlDelegateGtk(profile, delegate); | 120 new ConstrainedHtmlDelegateGtk(profile, delegate); |
121 ConstrainedWindow* constrained_window = | 121 ConstrainedWindow* constrained_window = |
122 new ConstrainedWindowGtk(overshadowed, constrained_delegate); | 122 new ConstrainedWindowGtk(overshadowed, constrained_delegate); |
123 constrained_delegate->set_window(constrained_window); | 123 constrained_delegate->set_window(constrained_window); |
124 return constrained_window; | 124 return constrained_window; |
125 } | 125 } |
OLD | NEW |