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

Side by Side Diff: chrome/browser/ui/views/constrained_html_delegate_gtk.cc

Issue 9015022: Replace most of Browser::GetSelectedTabContents calls into Browser::GetSelectedWebContents. I've ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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 (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/tab_contents/tab_contents_wrapper.h" 9 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
10 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" 10 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // ConstrainedWindowGtkDelegate implementation. 43 // ConstrainedWindowGtkDelegate implementation.
44 virtual GtkWidget* GetWidgetRoot() OVERRIDE { 44 virtual GtkWidget* GetWidgetRoot() OVERRIDE {
45 return GetNativeView(); 45 return GetNativeView();
46 } 46 }
47 virtual GtkWidget* GetFocusWidget() OVERRIDE { 47 virtual GtkWidget* GetFocusWidget() OVERRIDE {
48 return html_tab_contents_->tab_contents()->GetContentNativeView(); 48 return html_tab_contents_->tab_contents()->GetContentNativeView();
49 } 49 }
50 virtual void DeleteDelegate() OVERRIDE { 50 virtual void DeleteDelegate() OVERRIDE {
51 if (!closed_via_webui_) 51 if (!closed_via_webui_)
52 html_delegate_->OnDialogClosed(""); 52 html_delegate_->OnDialogClosed("");
53 tab_container_->ChangeTabContents(NULL); 53 tab_container_->ChangeWebContents(NULL);
54 } 54 }
55 virtual bool GetBackgroundColor(GdkColor* color) OVERRIDE { 55 virtual bool GetBackgroundColor(GdkColor* color) OVERRIDE {
56 *color = ui::kGdkWhite; 56 *color = ui::kGdkWhite;
57 return true; 57 return true;
58 } 58 }
59 virtual bool ShouldHaveBorderPadding() const OVERRIDE { 59 virtual bool ShouldHaveBorderPadding() const OVERRIDE {
60 return false; 60 return false;
61 } 61 }
62 62
63 // HtmlDialogTabContentsDelegate interface. 63 // HtmlDialogTabContentsDelegate interface.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 content::Referrer(), 107 content::Referrer(),
108 content::PAGE_TRANSITION_START_PAGE, 108 content::PAGE_TRANSITION_START_PAGE,
109 std::string()); 109 std::string());
110 110
111 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); 111 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
112 params.native_widget = this; 112 params.native_widget = this;
113 GetWidget()->Init(params); 113 GetWidget()->Init(params);
114 114
115 tab_container_ = new TabContentsContainer; 115 tab_container_ = new TabContentsContainer;
116 GetWidget()->SetContentsView(tab_container_); 116 GetWidget()->SetContentsView(tab_container_);
117 tab_container_->ChangeTabContents(html_tab_contents_->tab_contents()); 117 tab_container_->ChangeWebContents(html_tab_contents_->web_contents());
118 118
119 gfx::Size dialog_size; 119 gfx::Size dialog_size;
120 html_delegate_->GetDialogSize(&dialog_size); 120 html_delegate_->GetDialogSize(&dialog_size);
121 gtk_widget_set_size_request(GetWidgetRoot(), 121 gtk_widget_set_size_request(GetWidgetRoot(),
122 dialog_size.width(), 122 dialog_size.width(),
123 dialog_size.height()); 123 dialog_size.height());
124 } 124 }
125 125
126 ConstrainedHtmlDelegateGtk::~ConstrainedHtmlDelegateGtk() { 126 ConstrainedHtmlDelegateGtk::~ConstrainedHtmlDelegateGtk() {
127 if (release_tab_on_close_) 127 if (release_tab_on_close_)
(...skipping 14 matching lines...) Expand all
142 Profile* profile, 142 Profile* profile,
143 HtmlDialogUIDelegate* delegate, 143 HtmlDialogUIDelegate* delegate,
144 TabContentsWrapper* wrapper) { 144 TabContentsWrapper* wrapper) {
145 ConstrainedHtmlDelegateGtk* constrained_delegate = 145 ConstrainedHtmlDelegateGtk* constrained_delegate =
146 new ConstrainedHtmlDelegateGtk(profile, delegate); 146 new ConstrainedHtmlDelegateGtk(profile, delegate);
147 ConstrainedWindow* constrained_window = 147 ConstrainedWindow* constrained_window =
148 new ConstrainedWindowGtk(wrapper, constrained_delegate); 148 new ConstrainedWindowGtk(wrapper, constrained_delegate);
149 constrained_delegate->set_window(constrained_window); 149 constrained_delegate->set_window(constrained_window);
150 return constrained_delegate; 150 return constrained_delegate;
151 } 151 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/browser/ui/views/constrained_html_delegate_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698