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

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

Issue 164459: Implement drag and drop of downloads for the Mac downloads page (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months 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 | « chrome/browser/download/download_util.cc ('k') | chrome/chrome.gyp » ('j') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/views/download_item_view.h" 5 #include "chrome/browser/views/download_item_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/gfx/canvas.h" 9 #include "app/gfx/canvas.h"
10 #include "app/gfx/text_elider.h" 10 #include "app/gfx/text_elider.h"
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 if (!starting_drag_) { 865 if (!starting_drag_) {
866 starting_drag_ = true; 866 starting_drag_ = true;
867 drag_start_point_ = event.location(); 867 drag_start_point_ = event.location();
868 } 868 }
869 if (dragging_) { 869 if (dragging_) {
870 if (download_->state() == DownloadItem::COMPLETE) { 870 if (download_->state() == DownloadItem::COMPLETE) {
871 IconManager* im = g_browser_process->icon_manager(); 871 IconManager* im = g_browser_process->icon_manager();
872 SkBitmap* icon = im->LookupIcon(download_->full_path(), 872 SkBitmap* icon = im->LookupIcon(download_->full_path(),
873 IconLoader::SMALL); 873 IconLoader::SMALL);
874 if (icon) 874 if (icon)
875 download_util::DragDownload(download_, icon); 875 download_util::DragDownload(download_, icon, NULL);
876 } 876 }
877 } else if (ExceededDragThreshold( 877 } else if (ExceededDragThreshold(
878 event.location().x() - drag_start_point_.x(), 878 event.location().x() - drag_start_point_.x(),
879 event.location().y() - drag_start_point_.y())) { 879 event.location().y() - drag_start_point_.y())) {
880 dragging_ = true; 880 dragging_ = true;
881 } 881 }
882 return true; 882 return true;
883 } 883 }
884 884
885 void DownloadItemView::AnimationProgressed(const Animation* animation) { 885 void DownloadItemView::AnimationProgressed(const Animation* animation) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 void DownloadItemView::Reenable() { 984 void DownloadItemView::Reenable() {
985 disabled_while_opening_ = false; 985 disabled_while_opening_ = false;
986 SetEnabled(true); // Triggers a repaint. 986 SetEnabled(true); // Triggers a repaint.
987 } 987 }
988 988
989 bool DownloadItemView::InDropDownButtonXCoordinateRange(int x) { 989 bool DownloadItemView::InDropDownButtonXCoordinateRange(int x) {
990 if (x > drop_down_x_left_ && x < drop_down_x_right_) 990 if (x > drop_down_x_left_ && x < drop_down_x_right_)
991 return true; 991 return true;
992 return false; 992 return false;
993 } 993 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_util.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698