Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 8548016: Fix the placement of dangerous download warning icons in DownloadItemView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/views/download/download_item_view.h" 5 #include "chrome/browser/ui/views/download/download_item_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 download_util::SMALL); 818 download_util::SMALL);
819 } else { 819 } else {
820 download_util::PaintDownloadComplete(canvas, this, 0, 0, 820 download_util::PaintDownloadComplete(canvas, this, 0, 0,
821 complete_animation_->GetCurrentValue(), 821 complete_animation_->GetCurrentValue(),
822 download_util::SMALL); 822 download_util::SMALL);
823 } 823 }
824 } 824 }
825 } 825 }
826 826
827 // Draw the icon image. 827 // Draw the icon image.
828 int mirrored_x = GetMirroredXWithWidthInView( 828 int icon_x, icon_y;
829 download_util::kSmallProgressIconOffset, icon->width()); 829
830 if (IsDangerousMode()) {
831 icon_x = kLeftPadding + body_image_set->top_left->width();
832 icon_y = (height() - icon->height()) / 2;
833 } else {
834 icon_x = download_util::kSmallProgressIconOffset;
835 icon_y = download_util::kSmallProgressIconOffset;
836 }
837 icon_x = GetMirroredXWithWidthInView(icon_x, icon->width());
830 if (IsEnabled()) { 838 if (IsEnabled()) {
831 canvas->DrawBitmapInt(*icon, mirrored_x, 839 canvas->DrawBitmapInt(*icon, icon_x, icon_y);
832 download_util::kSmallProgressIconOffset);
833 } else { 840 } else {
834 // Use an alpha to make the image look disabled. 841 // Use an alpha to make the image look disabled.
835 SkPaint paint; 842 SkPaint paint;
836 paint.setAlpha(120); 843 paint.setAlpha(120);
837 canvas->DrawBitmapInt(*icon, mirrored_x, 844 canvas->DrawBitmapInt(*icon, icon_x, icon_y, paint);
838 download_util::kSmallProgressIconOffset, paint);
839 } 845 }
840 } 846 }
841 } 847 }
842 848
843 void DownloadItemView::OpenDownload() { 849 void DownloadItemView::OpenDownload() {
844 // We're interested in how long it takes users to open downloads. If they 850 // We're interested in how long it takes users to open downloads. If they
845 // open downloads super quickly, we should be concerned about clickjacking. 851 // open downloads super quickly, we should be concerned about clickjacking.
846 UMA_HISTOGRAM_LONG_TIMES("clickjacking.open_download", 852 UMA_HISTOGRAM_LONG_TIMES("clickjacking.open_download",
847 base::Time::Now() - creation_time_); 853 base::Time::Now() - creation_time_);
848 download_->OpenDownload(); 854 download_->OpenDownload();
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 // If the name has changed, notify assistive technology that the name 1130 // If the name has changed, notify assistive technology that the name
1125 // has changed so they can announce it immediately. 1131 // has changed so they can announce it immediately.
1126 if (new_name != accessible_name_) { 1132 if (new_name != accessible_name_) {
1127 accessible_name_ = new_name; 1133 accessible_name_ = new_name;
1128 if (GetWidget()) { 1134 if (GetWidget()) {
1129 GetWidget()->NotifyAccessibilityEvent( 1135 GetWidget()->NotifyAccessibilityEvent(
1130 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true); 1136 this, ui::AccessibilityTypes::EVENT_NAME_CHANGED, true);
1131 } 1137 }
1132 } 1138 }
1133 } 1139 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698