OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/download_item_gtk.h" | 5 #include "chrome/browser/gtk/download_item_gtk.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "app/slide_animation.h" | 9 #include "app/slide_animation.h" |
10 #include "app/text_elider.h" | 10 #include "app/text_elider.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 default: | 394 default: |
395 NOTREACHED(); | 395 NOTREACHED(); |
396 } | 396 } |
397 | 397 |
398 // Now update the status label. We may have already removed it; if so, we | 398 // Now update the status label. We may have already removed it; if so, we |
399 // do nothing. | 399 // do nothing. |
400 if (!status_label_) { | 400 if (!status_label_) { |
401 return; | 401 return; |
402 } | 402 } |
403 | 403 |
404 std::wstring status_text = download_model_->GetStatusText(); | 404 status_text_ = UTF16ToUTF8(download_model_->GetStatusText()); |
405 status_text_ = WideToUTF8(status_text); | |
406 // Remove the status text label. | 405 // Remove the status text label. |
407 if (status_text.empty()) { | 406 if (status_text_.empty()) { |
408 gtk_widget_destroy(status_label_); | 407 gtk_widget_destroy(status_label_); |
409 return; | 408 return; |
410 } | 409 } |
411 | 410 |
412 UpdateStatusLabel(status_text_); | 411 UpdateStatusLabel(status_text_); |
413 } | 412 } |
414 | 413 |
415 void DownloadItemGtk::AnimationProgressed(const Animation* animation) { | 414 void DownloadItemGtk::AnimationProgressed(const Animation* animation) { |
416 if (animation == complete_animation_.get()) { | 415 if (animation == complete_animation_.get()) { |
417 gtk_widget_queue_draw(progress_area_.get()); | 416 gtk_widget_queue_draw(progress_area_.get()); |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 get_download()->DangerousDownloadValidated(); | 870 get_download()->DangerousDownloadValidated(); |
872 } | 871 } |
873 | 872 |
874 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { | 873 void DownloadItemGtk::OnDangerousDecline(GtkWidget* button) { |
875 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", | 874 UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", |
876 base::Time::Now() - creation_time_); | 875 base::Time::Now() - creation_time_); |
877 if (get_download()->state() == DownloadItem::IN_PROGRESS) | 876 if (get_download()->state() == DownloadItem::IN_PROGRESS) |
878 get_download()->Cancel(true); | 877 get_download()->Cancel(true); |
879 get_download()->Remove(true); | 878 get_download()->Remove(true); |
880 } | 879 } |
OLD | NEW |