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

Side by Side Diff: chrome/browser/ui/views/toolbar/browser_actions_container.cc

Issue 2792183002: Delete ash-based code for Windows drag-and-drop graphics. (Closed)
Patch Set: ashdrag: addheaders Created 3 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/toolbar/browser_actions_container.h" 5 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 11 matching lines...) Expand all
22 #include "chrome/browser/ui/views/frame/browser_view.h" 22 #include "chrome/browser/ui/views/frame/browser_view.h"
23 #include "chrome/browser/ui/views/toolbar/app_menu_button.h" 23 #include "chrome/browser/ui/views/toolbar/app_menu_button.h"
24 #include "chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h" 24 #include "chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h"
25 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" 25 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
26 #include "chrome/common/extensions/command.h" 26 #include "chrome/common/extensions/command.h"
27 #include "chrome/grit/generated_resources.h" 27 #include "chrome/grit/generated_resources.h"
28 #include "chrome/grit/theme_resources.h" 28 #include "chrome/grit/theme_resources.h"
29 #include "extensions/common/feature_switch.h" 29 #include "extensions/common/feature_switch.h"
30 #include "third_party/skia/include/core/SkColor.h" 30 #include "third_party/skia/include/core/SkColor.h"
31 #include "ui/accessibility/ax_node_data.h" 31 #include "ui/accessibility/ax_node_data.h"
32 #include "ui/base/dragdrop/drag_utils.h"
33 #include "ui/base/l10n/l10n_util.h" 32 #include "ui/base/l10n/l10n_util.h"
34 #include "ui/base/nine_image_painter_factory.h" 33 #include "ui/base/nine_image_painter_factory.h"
35 #include "ui/base/resource/resource_bundle.h" 34 #include "ui/base/resource/resource_bundle.h"
36 #include "ui/gfx/canvas.h" 35 #include "ui/gfx/canvas.h"
37 #include "ui/gfx/geometry/rect.h" 36 #include "ui/gfx/geometry/rect.h"
38 #include "ui/resources/grit/ui_resources.h" 37 #include "ui/resources/grit/ui_resources.h"
39 #include "ui/views/bubble/bubble_dialog_delegate.h" 38 #include "ui/views/bubble/bubble_dialog_delegate.h"
40 #include "ui/views/controls/resize_area.h" 39 #include "ui/views/controls/resize_area.h"
41 #include "ui/views/painter.h" 40 #include "ui/views/painter.h"
42 #include "ui/views/widget/widget.h" 41 #include "ui/views/widget/widget.h"
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 514
516 auto it = 515 auto it =
517 std::find_if(toolbar_action_views_.cbegin(), toolbar_action_views_.cend(), 516 std::find_if(toolbar_action_views_.cbegin(), toolbar_action_views_.cend(),
518 [sender](const std::unique_ptr<ToolbarActionView>& ptr) { 517 [sender](const std::unique_ptr<ToolbarActionView>& ptr) {
519 return ptr.get() == sender; 518 return ptr.get() == sender;
520 }); 519 });
521 DCHECK(it != toolbar_action_views_.cend()); 520 DCHECK(it != toolbar_action_views_.cend());
522 ToolbarActionViewController* view_controller = (*it)->view_controller(); 521 ToolbarActionViewController* view_controller = (*it)->view_controller();
523 gfx::Size size(ToolbarActionsBar::IconWidth(false), 522 gfx::Size size(ToolbarActionsBar::IconWidth(false),
524 ToolbarActionsBar::IconHeight()); 523 ToolbarActionsBar::IconHeight());
525 drag_utils::SetDragImageOnDataObject( 524 data->provider().SetDragImage(
526 view_controller->GetIcon(GetCurrentWebContents(), size).AsImageSkia(), 525 view_controller->GetIcon(GetCurrentWebContents(), size).AsImageSkia(),
527 press_pt.OffsetFromOrigin(), 526 press_pt.OffsetFromOrigin());
528 data);
529 // Fill in the remaining info. 527 // Fill in the remaining info.
530 BrowserActionDragData drag_data(view_controller->GetId(), 528 BrowserActionDragData drag_data(view_controller->GetId(),
531 it - toolbar_action_views_.cbegin()); 529 it - toolbar_action_views_.cbegin());
532 drag_data.Write(browser_->profile(), data); 530 drag_data.Write(browser_->profile(), data);
533 } 531 }
534 532
535 int BrowserActionsContainer::GetDragOperationsForView(View* sender, 533 int BrowserActionsContainer::GetDragOperationsForView(View* sender,
536 const gfx::Point& p) { 534 const gfx::Point& p) {
537 return ui::DragDropTypes::DRAG_MOVE; 535 return ui::DragDropTypes::DRAG_MOVE;
538 } 536 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 } 658 }
661 } 659 }
662 660
663 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { 661 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) {
664 DCHECK(active_bubble_); 662 DCHECK(active_bubble_);
665 DCHECK_EQ(active_bubble_->GetWidget(), widget); 663 DCHECK_EQ(active_bubble_->GetWidget(), widget);
666 widget->RemoveObserver(this); 664 widget->RemoveObserver(this);
667 active_bubble_ = nullptr; 665 active_bubble_ = nullptr;
668 toolbar_actions_bar_->OnBubbleClosed(); 666 toolbar_actions_bar_->OnBubbleClosed();
669 } 667 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698