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/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 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 void WebIntentPickerGtk::OnExtensionIconChanged(WebIntentPickerModel* model, | 219 void WebIntentPickerGtk::OnExtensionIconChanged(WebIntentPickerModel* model, |
220 const string16& extension_id) { | 220 const string16& extension_id) { |
221 UpdateSuggestedExtensions(); | 221 UpdateSuggestedExtensions(); |
222 } | 222 } |
223 | 223 |
224 void WebIntentPickerGtk::OnInlineDisposition(const string16& title, | 224 void WebIntentPickerGtk::OnInlineDisposition(const string16& title, |
225 const GURL& url) { | 225 const GURL& url) { |
226 content::WebContents* web_contents = content::WebContents::Create( | 226 content::WebContents* web_contents = content::WebContents::Create( |
227 tab_contents_->profile(), | 227 tab_contents_->profile(), |
228 tab_util::GetSiteInstanceForNewTab(tab_contents_->profile(), url), | 228 tab_util::GetSiteInstanceForNewTab(tab_contents_->profile(), url), |
229 MSG_ROUTING_NONE, NULL, NULL); | 229 MSG_ROUTING_NONE, NULL); |
230 inline_disposition_tab_contents_.reset(new TabContents(web_contents)); | 230 inline_disposition_tab_contents_.reset(new TabContents(web_contents)); |
231 Browser* browser = browser::FindBrowserWithWebContents( | 231 Browser* browser = browser::FindBrowserWithWebContents( |
232 tab_contents_->web_contents()); | 232 tab_contents_->web_contents()); |
233 inline_disposition_delegate_.reset( | 233 inline_disposition_delegate_.reset( |
234 new WebIntentInlineDispositionDelegate(this, web_contents, browser)); | 234 new WebIntentInlineDispositionDelegate(this, web_contents, browser)); |
235 | 235 |
236 // Must call this immediately after WebContents creation to avoid race | 236 // Must call this immediately after WebContents creation to avoid race |
237 // with load. | 237 // with load. |
238 delegate_->OnInlineDispositionWebContentsCreated(web_contents); | 238 delegate_->OnInlineDispositionWebContentsCreated(web_contents); |
239 | 239 |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 return alignment; | 707 return alignment; |
708 } | 708 } |
709 | 709 |
710 void WebIntentPickerGtk::RemoveThrobber() { | 710 void WebIntentPickerGtk::RemoveThrobber() { |
711 GtkWidget* alignment = gtk_widget_get_parent(throbber_->widget()); | 711 GtkWidget* alignment = gtk_widget_get_parent(throbber_->widget()); |
712 DCHECK(alignment); | 712 DCHECK(alignment); |
713 gtk_container_remove(GTK_CONTAINER(alignment), throbber_->widget()); | 713 gtk_container_remove(GTK_CONTAINER(alignment), throbber_->widget()); |
714 gtk_widget_destroy(alignment); | 714 gtk_widget_destroy(alignment); |
715 throbber_->Stop(); | 715 throbber_->Stop(); |
716 } | 716 } |
OLD | NEW |