| OLD | NEW |
| 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/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/browser_actions_container.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/prefs/pref_service.h" | 9 #include "chrome/browser/prefs/pref_service.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 374 |
| 375 void BrowserActionsContainer::WriteDragDataForView(View* sender, | 375 void BrowserActionsContainer::WriteDragDataForView(View* sender, |
| 376 const gfx::Point& press_pt, | 376 const gfx::Point& press_pt, |
| 377 OSExchangeData* data) { | 377 OSExchangeData* data) { |
| 378 DCHECK(data); | 378 DCHECK(data); |
| 379 | 379 |
| 380 for (size_t i = 0; i < browser_action_views_.size(); ++i) { | 380 for (size_t i = 0; i < browser_action_views_.size(); ++i) { |
| 381 BrowserActionButton* button = browser_action_views_[i]->button(); | 381 BrowserActionButton* button = browser_action_views_[i]->button(); |
| 382 if (button == sender) { | 382 if (button == sender) { |
| 383 // Set the dragging image for the icon. | 383 // Set the dragging image for the icon. |
| 384 scoped_ptr<gfx::Canvas> canvas( | 384 gfx::ImageSkia badge(browser_action_views_[i]->GetIconWithBadge()); |
| 385 browser_action_views_[i]->GetIconWithBadge()); | 385 drag_utils::SetDragImageOnDataObject(badge, button->size(), press_pt, |
| 386 drag_utils::SetDragImageOnDataObject(*canvas, button->size(), press_pt, | |
| 387 data); | 386 data); |
| 388 | 387 |
| 389 // Fill in the remaining info. | 388 // Fill in the remaining info. |
| 390 BrowserActionDragData drag_data( | 389 BrowserActionDragData drag_data( |
| 391 browser_action_views_[i]->button()->extension()->id(), i); | 390 browser_action_views_[i]->button()->extension()->id(), i); |
| 392 drag_data.Write(profile_, data); | 391 drag_data.Write(profile_, data); |
| 393 break; | 392 break; |
| 394 } | 393 } |
| 395 } | 394 } |
| 396 } | 395 } |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 views::BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? | 809 views::BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? |
| 811 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; | 810 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; |
| 812 popup_ = ExtensionPopup::ShowPopup(popup_url, | 811 popup_ = ExtensionPopup::ShowPopup(popup_url, |
| 813 browser_, | 812 browser_, |
| 814 reference_view, | 813 reference_view, |
| 815 arrow_location); | 814 arrow_location); |
| 816 popup_->GetWidget()->AddObserver(this); | 815 popup_->GetWidget()->AddObserver(this); |
| 817 popup_button_ = button; | 816 popup_button_ = button; |
| 818 popup_button_->SetButtonPushed(); | 817 popup_button_->SetButtonPushed(); |
| 819 } | 818 } |
| OLD | NEW |