| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 gtk_alignment_set_padding(GTK_ALIGNMENT(label_alignment), | 186 gtk_alignment_set_padding(GTK_ALIGNMENT(label_alignment), |
| 187 kMainContentPixelSize, kDialogSpacing, 0, 0); | 187 kMainContentPixelSize, kDialogSpacing, 0, 0); |
| 188 gtk_container_add(GTK_CONTAINER(label_alignment), message_label); | 188 gtk_container_add(GTK_CONTAINER(label_alignment), message_label); |
| 189 gtk_box_pack_start(GTK_BOX(vbox), label_alignment, TRUE, TRUE, 0); | 189 gtk_box_pack_start(GTK_BOX(vbox), label_alignment, TRUE, TRUE, 0); |
| 190 | 190 |
| 191 // TODO(groby): use IDR_SPEECH_INPUT_SPINNER. Pending fix for ThrobberGtk. | 191 // TODO(groby): use IDR_SPEECH_INPUT_SPINNER. Pending fix for ThrobberGtk. |
| 192 // Animate throbber | 192 // Animate throbber |
| 193 throbber->Start(); | 193 throbber->Start(); |
| 194 } | 194 } |
| 195 // static | 195 // static |
| 196 WebIntentPicker* WebIntentPicker::Create(TabContents* tab_contents, | 196 WebIntentPicker* WebIntentPicker::Create(content::WebContents* web_contents, |
| 197 WebIntentPickerDelegate* delegate, | 197 WebIntentPickerDelegate* delegate, |
| 198 WebIntentPickerModel* model) { | 198 WebIntentPickerModel* model) { |
| 199 TabContents* tab_contents = TabContents::FromWebContents(web_contents); |
| 199 return new WebIntentPickerGtk(tab_contents, delegate, model); | 200 return new WebIntentPickerGtk(tab_contents, delegate, model); |
| 200 } | 201 } |
| 201 | 202 |
| 202 WebIntentPickerGtk::WebIntentPickerGtk(TabContents* tab_contents, | 203 WebIntentPickerGtk::WebIntentPickerGtk(TabContents* tab_contents, |
| 203 WebIntentPickerDelegate* delegate, | 204 WebIntentPickerDelegate* delegate, |
| 204 WebIntentPickerModel* model) | 205 WebIntentPickerModel* model) |
| 205 : tab_contents_(tab_contents), | 206 : tab_contents_(tab_contents), |
| 206 delegate_(delegate), | 207 delegate_(delegate), |
| 207 model_(model), | 208 model_(model), |
| 208 contents_(NULL), | 209 contents_(NULL), |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 return alignment; | 812 return alignment; |
| 812 } | 813 } |
| 813 | 814 |
| 814 void WebIntentPickerGtk::RemoveThrobber() { | 815 void WebIntentPickerGtk::RemoveThrobber() { |
| 815 GtkWidget* alignment = gtk_widget_get_parent(throbber_->widget()); | 816 GtkWidget* alignment = gtk_widget_get_parent(throbber_->widget()); |
| 816 DCHECK(alignment); | 817 DCHECK(alignment); |
| 817 gtk_container_remove(GTK_CONTAINER(alignment), throbber_->widget()); | 818 gtk_container_remove(GTK_CONTAINER(alignment), throbber_->widget()); |
| 818 gtk_widget_destroy(alignment); | 819 gtk_widget_destroy(alignment); |
| 819 throbber_->Stop(); | 820 throbber_->Stop(); |
| 820 } | 821 } |
| OLD | NEW |