| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/string16.h" | 16 #include "base/string16.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "chrome/browser/chrome_to_mobile_service_factory.h" | 19 #include "chrome/browser/chrome_to_mobile_service_factory.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| 21 #include "chrome/browser/ui/gtk/gtk_util.h" | 22 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 22 #include "chrome/browser/ui/gtk/theme_service_gtk.h" | |
| 23 #include "chrome/common/chrome_notification_types.h" | 23 #include "chrome/common/chrome_notification_types.h" |
| 24 #include "content/public/browser/notification_source.h" | 24 #include "content/public/browser/notification_source.h" |
| 25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 26 #include "grit/theme_resources_standard.h" | 26 #include "grit/theme_resources_standard.h" |
| 27 #include "ui/base/animation/throb_animation.h" | 27 #include "ui/base/animation/throb_animation.h" |
| 28 #include "ui/base/gtk/gtk_hig_constants.h" | 28 #include "ui/base/gtk/gtk_hig_constants.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| 30 #include "ui/base/text/bytes_formatting.h" | 30 #include "ui/base/text/bytes_formatting.h" |
| 31 #include "ui/gfx/image/image.h" | 31 #include "ui/gfx/image/image.h" |
| 32 | 32 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 gtk_button_set_label(GTK_BUTTON(send_), | 139 gtk_button_set_label(GTK_BUTTON(send_), |
| 140 l10n_util::GetStringUTF8(IDS_CHROME_TO_MOBILE_BUBBLE_ERROR).c_str()); | 140 l10n_util::GetStringUTF8(IDS_CHROME_TO_MOBILE_BUBBLE_ERROR).c_str()); |
| 141 gtk_widget_set_visible(error_, TRUE); | 141 gtk_widget_set_visible(error_, TRUE); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 ChromeToMobileBubbleGtk::ChromeToMobileBubbleGtk(GtkImage* anchor_image, | 145 ChromeToMobileBubbleGtk::ChromeToMobileBubbleGtk(GtkImage* anchor_image, |
| 146 Profile* profile) | 146 Profile* profile) |
| 147 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), | 147 : ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), |
| 148 service_(ChromeToMobileServiceFactory::GetForProfile(profile)), | 148 service_(ChromeToMobileServiceFactory::GetForProfile(profile)), |
| 149 theme_service_(ThemeServiceGtk::GetFrom(profile)), | 149 theme_service_(GtkThemeService::GetFrom(profile)), |
| 150 selected_mobile_(NULL), | 150 selected_mobile_(NULL), |
| 151 anchor_image_(anchor_image), | 151 anchor_image_(anchor_image), |
| 152 send_copy_(NULL), | 152 send_copy_(NULL), |
| 153 cancel_(NULL), | 153 cancel_(NULL), |
| 154 send_(NULL), | 154 send_(NULL), |
| 155 error_(NULL), | 155 error_(NULL), |
| 156 bubble_(NULL) { | 156 bubble_(NULL) { |
| 157 service_->LogMetric(ChromeToMobileService::BUBBLE_SHOWN); | 157 service_->LogMetric(ChromeToMobileService::BUBBLE_SHOWN); |
| 158 | 158 |
| 159 // Generate the MHTML snapshot now to report its size in the bubble. | 159 // Generate the MHTML snapshot now to report its size in the bubble. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 weak_ptr_factory_.GetWeakPtr()); | 300 weak_ptr_factory_.GetWeakPtr()); |
| 301 | 301 |
| 302 // Update the view's contents to show the "Sending..." progress animation. | 302 // Update the view's contents to show the "Sending..." progress animation. |
| 303 gtk_widget_set_sensitive(cancel_, FALSE); | 303 gtk_widget_set_sensitive(cancel_, FALSE); |
| 304 gtk_widget_set_sensitive(send_, FALSE); | 304 gtk_widget_set_sensitive(send_, FALSE); |
| 305 gtk_button_set_alignment(GTK_BUTTON(send_), 0, 0.5); | 305 gtk_button_set_alignment(GTK_BUTTON(send_), 0, 0.5); |
| 306 progress_animation_.reset(new ui::ThrobAnimation(this)); | 306 progress_animation_.reset(new ui::ThrobAnimation(this)); |
| 307 progress_animation_->SetDuration(kProgressThrobDurationMS); | 307 progress_animation_->SetDuration(kProgressThrobDurationMS); |
| 308 progress_animation_->StartThrobbing(-1); | 308 progress_animation_->StartThrobbing(-1); |
| 309 } | 309 } |
| OLD | NEW |