| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 | 396 |
| 397 void BrowserActionsContainer::WriteDragDataForView(View* sender, | 397 void BrowserActionsContainer::WriteDragDataForView(View* sender, |
| 398 const gfx::Point& press_pt, | 398 const gfx::Point& press_pt, |
| 399 OSExchangeData* data) { | 399 OSExchangeData* data) { |
| 400 DCHECK(data); | 400 DCHECK(data); |
| 401 | 401 |
| 402 for (size_t i = 0; i < browser_action_views_.size(); ++i) { | 402 for (size_t i = 0; i < browser_action_views_.size(); ++i) { |
| 403 BrowserActionButton* button = browser_action_views_[i]->button(); | 403 BrowserActionButton* button = browser_action_views_[i]->button(); |
| 404 if (button == sender) { | 404 if (button == sender) { |
| 405 // Set the dragging image for the icon. | 405 // Set the dragging image for the icon. |
| 406 scoped_ptr<gfx::Canvas> canvas( | 406 gfx::ImageSkia badge(browser_action_views_[i]->GetIconWithBadge()); |
| 407 browser_action_views_[i]->GetIconWithBadge()); | 407 drag_utils::SetDragImageOnDataObject(badge, button->size(), press_pt, |
| 408 drag_utils::SetDragImageOnDataObject(*canvas, button->size(), press_pt, | |
| 409 data); | 408 data); |
| 410 | 409 |
| 411 // Fill in the remaining info. | 410 // Fill in the remaining info. |
| 412 BrowserActionDragData drag_data( | 411 BrowserActionDragData drag_data( |
| 413 browser_action_views_[i]->button()->extension()->id(), i); | 412 browser_action_views_[i]->button()->extension()->id(), i); |
| 414 drag_data.Write(profile_, data); | 413 drag_data.Write(profile_, data); |
| 415 break; | 414 break; |
| 416 } | 415 } |
| 417 } | 416 } |
| 418 } | 417 } |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 views::BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? | 806 views::BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? |
| 808 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; | 807 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; |
| 809 popup_ = ExtensionPopup::ShowPopup(popup_url, | 808 popup_ = ExtensionPopup::ShowPopup(popup_url, |
| 810 browser_, | 809 browser_, |
| 811 reference_view, | 810 reference_view, |
| 812 arrow_location); | 811 arrow_location); |
| 813 popup_->GetWidget()->AddObserver(this); | 812 popup_->GetWidget()->AddObserver(this); |
| 814 popup_button_ = button; | 813 popup_button_ = button; |
| 815 popup_button_->SetButtonPushed(); | 814 popup_button_->SetButtonPushed(); |
| 816 } | 815 } |
| OLD | NEW |