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/chrome_to_mobile_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/chrome_to_mobile_bubble_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 } | 118 } |
119 } | 119 } |
120 | 120 |
121 void ChromeToMobileBubbleGtk::OnSendComplete(bool success) { | 121 void ChromeToMobileBubbleGtk::OnSendComplete(bool success) { |
122 progress_animation_->Stop(); | 122 progress_animation_->Stop(); |
123 gtk_button_set_alignment(GTK_BUTTON(send_), 0.5, 0.5); | 123 gtk_button_set_alignment(GTK_BUTTON(send_), 0.5, 0.5); |
124 | 124 |
125 if (success) { | 125 if (success) { |
126 gtk_button_set_label(GTK_BUTTON(send_), | 126 gtk_button_set_label(GTK_BUTTON(send_), |
127 l10n_util::GetStringUTF8(IDS_CHROME_TO_MOBILE_BUBBLE_SENT).c_str()); | 127 l10n_util::GetStringUTF8(IDS_CHROME_TO_MOBILE_BUBBLE_SENT).c_str()); |
128 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 128 base::MessageLoop::current()->PostDelayedTask( |
| 129 FROM_HERE, |
129 base::Bind(&ChromeToMobileBubbleGtk::OnCancelClicked, | 130 base::Bind(&ChromeToMobileBubbleGtk::OnCancelClicked, |
130 weak_ptr_factory_.GetWeakPtr(), GTK_WIDGET(NULL)), | 131 weak_ptr_factory_.GetWeakPtr(), |
| 132 GTK_WIDGET(NULL)), |
131 base::TimeDelta::FromSeconds(kAutoCloseDelay)); | 133 base::TimeDelta::FromSeconds(kAutoCloseDelay)); |
132 } else { | 134 } else { |
133 gtk_button_set_label(GTK_BUTTON(send_), | 135 gtk_button_set_label(GTK_BUTTON(send_), |
134 l10n_util::GetStringUTF8(IDS_CHROME_TO_MOBILE_BUBBLE_ERROR).c_str()); | 136 l10n_util::GetStringUTF8(IDS_CHROME_TO_MOBILE_BUBBLE_ERROR).c_str()); |
135 gtk_widget_set_visible(error_, TRUE); | 137 gtk_widget_set_visible(error_, TRUE); |
136 } | 138 } |
137 } | 139 } |
138 | 140 |
139 ChromeToMobileBubbleGtk::ChromeToMobileBubbleGtk(GtkWidget* anchor_widget, | 141 ChromeToMobileBubbleGtk::ChromeToMobileBubbleGtk(GtkWidget* anchor_widget, |
140 Browser* browser) | 142 Browser* browser) |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 } | 313 } |
312 | 314 |
313 // Update the view's contents to show the "Sending..." progress animation. | 315 // Update the view's contents to show the "Sending..." progress animation. |
314 gtk_widget_set_sensitive(cancel_, FALSE); | 316 gtk_widget_set_sensitive(cancel_, FALSE); |
315 gtk_widget_set_sensitive(send_, FALSE); | 317 gtk_widget_set_sensitive(send_, FALSE); |
316 gtk_button_set_alignment(GTK_BUTTON(send_), 0, 0.5); | 318 gtk_button_set_alignment(GTK_BUTTON(send_), 0, 0.5); |
317 progress_animation_.reset(new ui::ThrobAnimation(this)); | 319 progress_animation_.reset(new ui::ThrobAnimation(this)); |
318 progress_animation_->SetDuration(kProgressThrobDurationMS); | 320 progress_animation_->SetDuration(kProgressThrobDurationMS); |
319 progress_animation_->StartThrobbing(-1); | 321 progress_animation_->StartThrobbing(-1); |
320 } | 322 } |
OLD | NEW |