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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 void WebIntentPickerGtk::OnExtensionIconChanged(WebIntentPickerModel* model, | 185 void WebIntentPickerGtk::OnExtensionIconChanged(WebIntentPickerModel* model, |
186 const string16& extension_id) { | 186 const string16& extension_id) { |
187 UpdateSuggestedExtensions(); | 187 UpdateSuggestedExtensions(); |
188 } | 188 } |
189 | 189 |
190 void WebIntentPickerGtk::OnInlineDisposition(WebIntentPickerModel* model, | 190 void WebIntentPickerGtk::OnInlineDisposition(WebIntentPickerModel* model, |
191 const GURL& url) { | 191 const GURL& url) { |
192 content::WebContents* web_contents = content::WebContents::Create( | 192 content::WebContents* web_contents = content::WebContents::Create( |
193 browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); | 193 browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
194 inline_disposition_tab_contents_.reset(new TabContentsWrapper(web_contents)); | 194 inline_disposition_tab_contents_.reset(new TabContentsWrapper(web_contents)); |
195 inline_disposition_delegate_.reset(new WebIntentInlineDispositionDelegate); | 195 inline_disposition_delegate_.reset( |
| 196 new WebIntentInlineDispositionDelegate(this)); |
196 web_contents->SetDelegate(inline_disposition_delegate_.get()); | 197 web_contents->SetDelegate(inline_disposition_delegate_.get()); |
197 | 198 |
198 // Must call this immediately after WebContents creation to avoid race | 199 // Must call this immediately after WebContents creation to avoid race |
199 // with load. | 200 // with load. |
200 delegate_->OnInlineDispositionWebContentsCreated(web_contents); | 201 delegate_->OnInlineDispositionWebContentsCreated(web_contents); |
201 | 202 |
202 tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); | 203 tab_contents_container_.reset(new TabContentsContainerGtk(NULL)); |
203 tab_contents_container_->SetTab(inline_disposition_tab_contents_.get()); | 204 tab_contents_container_->SetTab(inline_disposition_tab_contents_.get()); |
204 | 205 |
205 inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( | 206 inline_disposition_tab_contents_->web_contents()->GetController().LoadURL( |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 for (int i = 0; i < 5; ++i) { | 563 for (int i = 0; i < 5; ++i) { |
563 gtk_box_pack_start( | 564 gtk_box_pack_start( |
564 GTK_BOX(hbox), | 565 GTK_BOX(hbox), |
565 gtk_image_new_from_pixbuf(rb.GetRTLEnabledPixbufNamed( | 566 gtk_image_new_from_pixbuf(rb.GetRTLEnabledPixbufNamed( |
566 WebIntentPicker::GetNthStarImageIdFromCWSRating(rating, i))), | 567 WebIntentPicker::GetNthStarImageIdFromCWSRating(rating, i))), |
567 FALSE, FALSE, 0); | 568 FALSE, FALSE, 0); |
568 } | 569 } |
569 | 570 |
570 return hbox; | 571 return hbox; |
571 } | 572 } |
OLD | NEW |