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

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

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebasefinal Created 8 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
OLDNEW
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/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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 669
670 // Paint the background images. 670 // Paint the background images.
671 int x = kLeftPadding; 671 int x = kLeftPadding;
672 canvas->Save(); 672 canvas->Save();
673 if (base::i18n::IsRTL()) { 673 if (base::i18n::IsRTL()) {
674 // Since we do not have the mirrored images for 674 // Since we do not have the mirrored images for
675 // (hot_)body_image_set->top_left, (hot_)body_image_set->left, 675 // (hot_)body_image_set->top_left, (hot_)body_image_set->left,
676 // (hot_)body_image_set->bottom_left, and drop_down_image_set, 676 // (hot_)body_image_set->bottom_left, and drop_down_image_set,
677 // for RTL UI, we flip the canvas to draw those images mirrored. 677 // for RTL UI, we flip the canvas to draw those images mirrored.
678 // Consequently, we do not need to mirror the x-axis of those images. 678 // Consequently, we do not need to mirror the x-axis of those images.
679 canvas->Translate(gfx::Point(width(), 0)); 679 canvas->Translate(gfx::Vector2d(width(), 0));
680 canvas->Scale(-1, 1); 680 canvas->Scale(-1, 1);
681 } 681 }
682 PaintImages(canvas, 682 PaintImages(canvas,
683 body_image_set->top_left, body_image_set->left, 683 body_image_set->top_left, body_image_set->left,
684 body_image_set->bottom_left, 684 body_image_set->bottom_left,
685 x, box_y_, box_height_, body_image_set->top_left->width()); 685 x, box_y_, box_height_, body_image_set->top_left->width());
686 x += body_image_set->top_left->width(); 686 x += body_image_set->top_left->width();
687 PaintImages(canvas, 687 PaintImages(canvas,
688 body_image_set->top, body_image_set->center, 688 body_image_set->top, body_image_set->center,
689 body_image_set->bottom, 689 body_image_set->bottom,
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 void DownloadItemView::AnimateStateTransition(State from, State to, 1226 void DownloadItemView::AnimateStateTransition(State from, State to,
1227 ui::SlideAnimation* animation) { 1227 ui::SlideAnimation* animation) {
1228 if (from == NORMAL && to == HOT) { 1228 if (from == NORMAL && to == HOT) {
1229 animation->Show(); 1229 animation->Show();
1230 } else if (from == HOT && to == NORMAL) { 1230 } else if (from == HOT && to == NORMAL) {
1231 animation->Hide(); 1231 animation->Hide();
1232 } else if (from != to) { 1232 } else if (from != to) {
1233 animation->Reset((to == HOT) ? 1.0 : 0.0); 1233 animation->Reset((to == HOT) ? 1.0 : 0.0);
1234 } 1234 }
1235 } 1235 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698