| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 return drop_data.Read(data) ? drop_data.IsFromProfile(profile_) : false; | 279 return drop_data.Read(data) ? drop_data.IsFromProfile(profile_) : false; |
| 280 } | 280 } |
| 281 | 281 |
| 282 void BrowserActionsContainer::OnDragEntered( | 282 void BrowserActionsContainer::OnDragEntered( |
| 283 const ui::DropTargetEvent& event) { | 283 const ui::DropTargetEvent& event) { |
| 284 } | 284 } |
| 285 | 285 |
| 286 int BrowserActionsContainer::OnDragUpdated( | 286 int BrowserActionsContainer::OnDragUpdated( |
| 287 const ui::DropTargetEvent& event) { | 287 const ui::DropTargetEvent& event) { |
| 288 // First check if we are above the chevron (overflow) menu. | 288 // First check if we are above the chevron (overflow) menu. |
| 289 if (GetEventHandlerForPoint(event.location()) == chevron_) { | 289 if (GetEventHandlerForPoint(gfx::ToFlooredPoint(event.location())) == |
| 290 chevron_) { |
| 290 if (!show_menu_task_factory_.HasWeakPtrs() && !overflow_menu_) | 291 if (!show_menu_task_factory_.HasWeakPtrs() && !overflow_menu_) |
| 291 StartShowFolderDropMenuTimer(); | 292 StartShowFolderDropMenuTimer(); |
| 292 return ui::DragDropTypes::DRAG_MOVE; | 293 return ui::DragDropTypes::DRAG_MOVE; |
| 293 } | 294 } |
| 294 StopShowFolderDropMenuTimer(); | 295 StopShowFolderDropMenuTimer(); |
| 295 | 296 |
| 296 // Figure out where to display the indicator. This is a complex calculation: | 297 // Figure out where to display the indicator. This is a complex calculation: |
| 297 | 298 |
| 298 // First, we figure out how much space is to the left of the icon area, so we | 299 // First, we figure out how much space is to the left of the icon area, so we |
| 299 // can calculate the true offset into the icon area. | 300 // can calculate the true offset into the icon area. |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 views::BubbleBorder::TOP_RIGHT, | 923 views::BubbleBorder::TOP_RIGHT, |
| 923 show_action); | 924 show_action); |
| 924 popup_->GetWidget()->AddObserver(this); | 925 popup_->GetWidget()->AddObserver(this); |
| 925 popup_button_ = button; | 926 popup_button_ = button; |
| 926 | 927 |
| 927 // Only set button as pushed if it was triggered by a user click. | 928 // Only set button as pushed if it was triggered by a user click. |
| 928 if (should_grant) | 929 if (should_grant) |
| 929 popup_button_->SetButtonPushed(); | 930 popup_button_->SetButtonPushed(); |
| 930 return true; | 931 return true; |
| 931 } | 932 } |
| OLD | NEW |