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/gtk/web_intent_picker_gtk.h" | 5 #include "chrome/browser/ui/gtk/web_intent_picker_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 TabContents* WebIntentPickerGtk::SetInlineDisposition(const GURL& url) { | 247 TabContents* WebIntentPickerGtk::SetInlineDisposition(const GURL& url) { |
248 TabContents* tab_contents = new TabContents( | 248 TabContents* tab_contents = new TabContents( |
249 browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); | 249 browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
250 inline_disposition_tab_contents_.reset(new TabContentsWrapper(tab_contents)); | 250 inline_disposition_tab_contents_.reset(new TabContentsWrapper(tab_contents)); |
251 inline_disposition_delegate_.reset(new InlineDispositionDelegate); | 251 inline_disposition_delegate_.reset(new InlineDispositionDelegate); |
252 tab_contents->set_delegate(inline_disposition_delegate_.get()); | 252 tab_contents->set_delegate(inline_disposition_delegate_.get()); |
253 tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); | 253 tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); |
254 tab_contents_container_->SetTab(inline_disposition_tab_contents_.get()); | 254 tab_contents_container_->SetTab(inline_disposition_tab_contents_.get()); |
255 | 255 |
256 inline_disposition_tab_contents_->tab_contents()->controller().LoadURL( | 256 inline_disposition_tab_contents_->tab_contents()->controller().LoadURL( |
257 url, GURL(), content::PAGE_TRANSITION_START_PAGE, std::string()); | 257 url, content::Referrer(), content::PAGE_TRANSITION_START_PAGE, |
| 258 std::string()); |
258 | 259 |
259 // Replace the bubble picker contents with the inline disposition. | 260 // Replace the bubble picker contents with the inline disposition. |
260 | 261 |
261 gtk_container_foreach(GTK_CONTAINER(contents_), RemoveAllHelper, NULL); | 262 gtk_container_foreach(GTK_CONTAINER(contents_), RemoveAllHelper, NULL); |
262 | 263 |
263 GtkWidget* service_hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); | 264 GtkWidget* service_hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); |
264 // TODO(gbillock): Eventually get the service icon button here. | 265 // TODO(gbillock): Eventually get the service icon button here. |
265 // Maybe add a title or something too? | 266 // Maybe add a title or something too? |
266 close_button_.reset( | 267 close_button_.reset( |
267 CustomDrawButton::CloseButton(GetThemeService(wrapper_))); | 268 CustomDrawButton::CloseButton(GetThemeService(wrapper_))); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 const TabContents* source) const { | 322 const TabContents* source) const { |
322 return true; | 323 return true; |
323 } | 324 } |
324 | 325 |
325 bool WebIntentPickerGtk::InlineDispositionDelegate:: | 326 bool WebIntentPickerGtk::InlineDispositionDelegate:: |
326 ShouldAddNavigationToHistory( | 327 ShouldAddNavigationToHistory( |
327 const history::HistoryAddPageArgs& add_page_args, | 328 const history::HistoryAddPageArgs& add_page_args, |
328 content::NavigationType navigation_type) { | 329 content::NavigationType navigation_type) { |
329 return false; | 330 return false; |
330 } | 331 } |
OLD | NEW |