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

Side by Side Diff: chrome/browser/download/download_util.cc

Issue 11368072: aura: Add flag to indicate if a drag session is started with touch or mouse. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch 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 // Download utility implementation 5 // Download utility implementation
6 6
7 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. 7 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first.
8 8
9 #include "chrome/browser/download/download_util.h" 9 #include "chrome/browser/download/download_util.h"
10 10
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 #if defined(USE_AURA) 390 #if defined(USE_AURA)
391 aura::RootWindow* root_window = view->GetRootWindow(); 391 aura::RootWindow* root_window = view->GetRootWindow();
392 if (!root_window || !aura::client::GetDragDropClient(root_window)) 392 if (!root_window || !aura::client::GetDragDropClient(root_window))
393 return; 393 return;
394 394
395 gfx::Point location = gfx::Screen::GetScreenFor(view)->GetCursorScreenPoint(); 395 gfx::Point location = gfx::Screen::GetScreenFor(view)->GetCursorScreenPoint();
396 aura::client::GetDragDropClient(root_window)->StartDragAndDrop( 396 aura::client::GetDragDropClient(root_window)->StartDragAndDrop(
397 data, 397 data,
398 root_window, 398 root_window,
399 location, 399 location,
400 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK); 400 ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK,
401 ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE);
401 #else // We are on WIN without AURA 402 #else // We are on WIN without AURA
402 // We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a 403 // We cannot use Widget::RunShellDrag on WIN since the |view| is backed by a
403 // TabContentsViewWin, not a NativeWidgetWin. 404 // TabContentsViewWin, not a NativeWidgetWin.
404 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource); 405 scoped_refptr<ui::DragSource> drag_source(new ui::DragSource);
405 // Run the drag and drop loop 406 // Run the drag and drop loop
406 DWORD effects; 407 DWORD effects;
407 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), 408 DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data),
408 drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, &effects); 409 drag_source.get(), DROPEFFECT_COPY | DROPEFFECT_LINK, &effects);
409 #endif 410 #endif
410 411
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 ShowInShelfData* data = 518 ShowInShelfData* data =
518 static_cast<ShowInShelfData*>(item->GetUserData(kShowInShelfKey)); 519 static_cast<ShowInShelfData*>(item->GetUserData(kShowInShelfKey));
519 return !data || data->should_show(); 520 return !data || data->should_show();
520 } 521 }
521 522
522 void SetShouldShowInShelf(content::DownloadItem* item, bool should_show) { 523 void SetShouldShowInShelf(content::DownloadItem* item, bool should_show) {
523 item->SetUserData(kShowInShelfKey, new ShowInShelfData(should_show)); 524 item->SetUserData(kShowInShelfKey, new ShowInShelfData(should_show));
524 } 525 }
525 526
526 } // namespace download_util 527 } // namespace download_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698