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/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 void BrowserActionsContainer::WriteDragDataForView(View* sender, | 420 void BrowserActionsContainer::WriteDragDataForView(View* sender, |
421 const gfx::Point& press_pt, | 421 const gfx::Point& press_pt, |
422 OSExchangeData* data) { | 422 OSExchangeData* data) { |
423 DCHECK(data); | 423 DCHECK(data); |
424 | 424 |
425 for (size_t i = 0; i < browser_action_views_.size(); ++i) { | 425 for (size_t i = 0; i < browser_action_views_.size(); ++i) { |
426 BrowserActionButton* button = browser_action_views_[i]->button(); | 426 BrowserActionButton* button = browser_action_views_[i]->button(); |
427 if (button == sender) { | 427 if (button == sender) { |
428 // Set the dragging image for the icon. | 428 // Set the dragging image for the icon. |
429 gfx::ImageSkia badge(browser_action_views_[i]->GetIconWithBadge()); | 429 gfx::ImageSkia badge(browser_action_views_[i]->GetIconWithBadge()); |
430 drag_utils::SetDragImageOnDataObject(badge, button->size(), | 430 drag_utils::SetDragImageOnDataObject(badge, |
431 press_pt.OffsetFromOrigin(), | 431 press_pt.OffsetFromOrigin(), |
432 data); | 432 data); |
433 | 433 |
434 // Fill in the remaining info. | 434 // Fill in the remaining info. |
435 BrowserActionDragData drag_data( | 435 BrowserActionDragData drag_data( |
436 browser_action_views_[i]->button()->extension()->id(), i); | 436 browser_action_views_[i]->button()->extension()->id(), i); |
437 drag_data.Write(profile_, data); | 437 drag_data.Write(profile_, data); |
438 break; | 438 break; |
439 } | 439 } |
440 } | 440 } |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 views::BubbleBorder::TOP_RIGHT, | 932 views::BubbleBorder::TOP_RIGHT, |
933 show_action); | 933 show_action); |
934 popup_->GetWidget()->AddObserver(this); | 934 popup_->GetWidget()->AddObserver(this); |
935 popup_button_ = button; | 935 popup_button_ = button; |
936 | 936 |
937 // Only set button as pushed if it was triggered by a user click. | 937 // Only set button as pushed if it was triggered by a user click. |
938 if (should_grant) | 938 if (should_grant) |
939 popup_button_->SetButtonPushed(); | 939 popup_button_->SetButtonPushed(); |
940 return true; | 940 return true; |
941 } | 941 } |
OLD | NEW |