| 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/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_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 void BrowserActionsContainer::WriteDragDataForView(View* sender, | 382 void BrowserActionsContainer::WriteDragDataForView(View* sender, |
| 383 const gfx::Point& press_pt, | 383 const gfx::Point& press_pt, |
| 384 OSExchangeData* data) { | 384 OSExchangeData* data) { |
| 385 DCHECK(data); | 385 DCHECK(data); |
| 386 | 386 |
| 387 for (size_t i = 0; i < browser_action_views_.size(); ++i) { | 387 for (size_t i = 0; i < browser_action_views_.size(); ++i) { |
| 388 BrowserActionButton* button = browser_action_views_[i]->button(); | 388 BrowserActionButton* button = browser_action_views_[i]->button(); |
| 389 if (button == sender) { | 389 if (button == sender) { |
| 390 // Set the dragging image for the icon. | 390 // Set the dragging image for the icon. |
| 391 gfx::ImageSkia badge(browser_action_views_[i]->GetIconWithBadge()); | 391 gfx::ImageSkia badge(browser_action_views_[i]->GetIconWithBadge()); |
| 392 drag_utils::SetDragImageOnDataObject(badge, button->size(), press_pt, | 392 drag_utils::SetDragImageOnDataObject(badge, button->size(), |
| 393 press_pt.DistanceFromOrigin(), |
| 393 data); | 394 data); |
| 394 | 395 |
| 395 // Fill in the remaining info. | 396 // Fill in the remaining info. |
| 396 BrowserActionDragData drag_data( | 397 BrowserActionDragData drag_data( |
| 397 browser_action_views_[i]->button()->extension()->id(), i); | 398 browser_action_views_[i]->button()->extension()->id(), i); |
| 398 drag_data.Write(profile_, data); | 399 drag_data.Write(profile_, data); |
| 399 break; | 400 break; |
| 400 } | 401 } |
| 401 } | 402 } |
| 402 } | 403 } |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; | 841 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; |
| 841 popup_ = ExtensionPopup::ShowPopup(popup_url, | 842 popup_ = ExtensionPopup::ShowPopup(popup_url, |
| 842 browser_, | 843 browser_, |
| 843 reference_view, | 844 reference_view, |
| 844 arrow_location, | 845 arrow_location, |
| 845 show_action); | 846 show_action); |
| 846 popup_->GetWidget()->AddObserver(this); | 847 popup_->GetWidget()->AddObserver(this); |
| 847 popup_button_ = button; | 848 popup_button_ = button; |
| 848 popup_button_->SetButtonPushed(); | 849 popup_button_->SetButtonPushed(); |
| 849 } | 850 } |
| OLD | NEW |