| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 128 } |
| 129 | 129 |
| 130 void WebIntentPickerGtk::OnFaviconChanged(WebIntentPickerModel* model, | 130 void WebIntentPickerGtk::OnFaviconChanged(WebIntentPickerModel* model, |
| 131 size_t index) { | 131 size_t index) { |
| 132 const WebIntentPickerModel::InstalledService& installed_service = | 132 const WebIntentPickerModel::InstalledService& installed_service = |
| 133 model->GetInstalledServiceAt(index); | 133 model->GetInstalledServiceAt(index); |
| 134 GtkWidget* button = GetServiceButton(index); | 134 GtkWidget* button = GetServiceButton(index); |
| 135 SetServiceButtonImage(button, installed_service.favicon.ToGdkPixbuf()); | 135 SetServiceButtonImage(button, installed_service.favicon.ToGdkPixbuf()); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void WebIntentPickerGtk::OnExtensionIconChanged(WebIntentPickerModel* model, |
| 139 const string16& extension_id) { |
| 140 // TODO(binji): implement. |
| 141 } |
| 142 |
| 138 void WebIntentPickerGtk::OnInlineDisposition(WebIntentPickerModel* model) { | 143 void WebIntentPickerGtk::OnInlineDisposition(WebIntentPickerModel* model) { |
| 139 const WebIntentPickerModel::InstalledService& installed_service = | 144 const WebIntentPickerModel::InstalledService& installed_service = |
| 140 model->GetInstalledServiceAt(model->inline_disposition_index()); | 145 model->GetInstalledServiceAt(model->inline_disposition_index()); |
| 141 const GURL& url = installed_service.url; | 146 const GURL& url = installed_service.url; |
| 142 | 147 |
| 143 content::WebContents* web_contents = content::WebContents::Create( | 148 content::WebContents* web_contents = content::WebContents::Create( |
| 144 browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); | 149 browser_->profile(), NULL, MSG_ROUTING_NONE, NULL, NULL); |
| 145 inline_disposition_tab_contents_.reset(new TabContentsWrapper(web_contents)); | 150 inline_disposition_tab_contents_.reset(new TabContentsWrapper(web_contents)); |
| 146 inline_disposition_delegate_.reset(new WebIntentInlineDispositionDelegate); | 151 inline_disposition_delegate_.reset(new WebIntentInlineDispositionDelegate); |
| 147 web_contents->SetDelegate(inline_disposition_delegate_.get()); | 152 web_contents->SetDelegate(inline_disposition_delegate_.get()); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 g_signal_connect(contents_, "destroy", G_CALLBACK(&OnDestroyThunk), this); | 281 g_signal_connect(contents_, "destroy", G_CALLBACK(&OnDestroyThunk), this); |
| 277 } | 282 } |
| 278 | 283 |
| 279 GtkWidget* WebIntentPickerGtk::GetServiceButton(size_t index) { | 284 GtkWidget* WebIntentPickerGtk::GetServiceButton(size_t index) { |
| 280 GList* button_list = gtk_container_get_children(GTK_CONTAINER(button_vbox_)); | 285 GList* button_list = gtk_container_get_children(GTK_CONTAINER(button_vbox_)); |
| 281 GtkWidget* button = GTK_WIDGET(g_list_nth_data(button_list, index)); | 286 GtkWidget* button = GTK_WIDGET(g_list_nth_data(button_list, index)); |
| 282 DCHECK(button != NULL); | 287 DCHECK(button != NULL); |
| 283 | 288 |
| 284 return button; | 289 return button; |
| 285 } | 290 } |
| OLD | NEW |