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 // scoped_ptr<gfx::Canvas> canvas( |
pkotwicz
2012/08/07 22:31:22
Nit: remove this
tbarzic
2012/08/08 02:09:29
yeah, I missed that while cleaning up the cl..
| |
407 browser_action_views_[i]->GetIconWithBadge()); | 407 gfx::ImageSkia badge(browser_action_views_[i]->GetIconWithBadge()); |
408 drag_utils::SetDragImageOnDataObject(*canvas, button->size(), press_pt, | 408 drag_utils::SetDragImageOnDataObject(badge, button->size(), press_pt, |
409 data); | 409 data); |
410 | 410 |
411 // Fill in the remaining info. | 411 // Fill in the remaining info. |
412 BrowserActionDragData drag_data( | 412 BrowserActionDragData drag_data( |
413 browser_action_views_[i]->button()->extension()->id(), i); | 413 browser_action_views_[i]->button()->extension()->id(), i); |
414 drag_data.Write(profile_, data); | 414 drag_data.Write(profile_, data); |
415 break; | 415 break; |
416 } | 416 } |
417 } | 417 } |
418 } | 418 } |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
807 views::BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? | 807 views::BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? |
808 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; | 808 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; |
809 popup_ = ExtensionPopup::ShowPopup(popup_url, | 809 popup_ = ExtensionPopup::ShowPopup(popup_url, |
810 browser_, | 810 browser_, |
811 reference_view, | 811 reference_view, |
812 arrow_location); | 812 arrow_location); |
813 popup_->GetWidget()->AddObserver(this); | 813 popup_->GetWidget()->AddObserver(this); |
814 popup_button_ = button; | 814 popup_button_ = button; |
815 popup_button_->SetButtonPushed(); | 815 popup_button_->SetButtonPushed(); |
816 } | 816 } |
OLD | NEW |