| OLD | NEW |
| 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 "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "chrome/browser/extensions/extension_message_bubble_controller.h" | 9 #include "chrome/browser/extensions/extension_message_bubble_controller.h" |
| 10 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 void BrowserActionsContainer::WriteDragDataForView(View* sender, | 608 void BrowserActionsContainer::WriteDragDataForView(View* sender, |
| 609 const gfx::Point& press_pt, | 609 const gfx::Point& press_pt, |
| 610 OSExchangeData* data) { | 610 OSExchangeData* data) { |
| 611 DCHECK(data); | 611 DCHECK(data); |
| 612 | 612 |
| 613 ToolbarActionViews::iterator iter = std::find(toolbar_action_views_.begin(), | 613 ToolbarActionViews::iterator iter = std::find(toolbar_action_views_.begin(), |
| 614 toolbar_action_views_.end(), | 614 toolbar_action_views_.end(), |
| 615 sender); | 615 sender); |
| 616 DCHECK(iter != toolbar_action_views_.end()); | 616 DCHECK(iter != toolbar_action_views_.end()); |
| 617 ToolbarActionViewController* view_controller = (*iter)->view_controller(); | 617 ToolbarActionViewController* view_controller = (*iter)->view_controller(); |
| 618 gfx::Size size(ToolbarActionsBar::IconWidth(false), |
| 619 ToolbarActionsBar::IconHeight()); |
| 618 drag_utils::SetDragImageOnDataObject( | 620 drag_utils::SetDragImageOnDataObject( |
| 619 view_controller->GetIconWithBadge(), | 621 view_controller->GetIcon(GetCurrentWebContents(), size).AsImageSkia(), |
| 620 press_pt.OffsetFromOrigin(), | 622 press_pt.OffsetFromOrigin(), |
| 621 data); | 623 data); |
| 622 // Fill in the remaining info. | 624 // Fill in the remaining info. |
| 623 BrowserActionDragData drag_data(view_controller->GetId(), | 625 BrowserActionDragData drag_data(view_controller->GetId(), |
| 624 iter - toolbar_action_views_.begin()); | 626 iter - toolbar_action_views_.begin()); |
| 625 drag_data.Write(browser_->profile(), data); | 627 drag_data.Write(browser_->profile(), data); |
| 626 } | 628 } |
| 627 | 629 |
| 628 int BrowserActionsContainer::GetDragOperationsForView(View* sender, | 630 int BrowserActionsContainer::GetDragOperationsForView(View* sender, |
| 629 const gfx::Point& p) { | 631 const gfx::Point& p) { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 const int kImages[] = IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT); | 786 const int kImages[] = IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT); |
| 785 highlight_painter_.reset(views::Painter::CreateImageGridPainter(kImages)); | 787 highlight_painter_.reset(views::Painter::CreateImageGridPainter(kImages)); |
| 786 } | 788 } |
| 787 | 789 |
| 788 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { | 790 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { |
| 789 DCHECK(active_bubble_); | 791 DCHECK(active_bubble_); |
| 790 DCHECK_EQ(active_bubble_->GetWidget(), widget); | 792 DCHECK_EQ(active_bubble_->GetWidget(), widget); |
| 791 widget->RemoveObserver(this); | 793 widget->RemoveObserver(this); |
| 792 active_bubble_ = nullptr; | 794 active_bubble_ = nullptr; |
| 793 } | 795 } |
| OLD | NEW |