diff options
Diffstat (limited to 'chrome/browser/ui/views')
6 files changed, 53 insertions, 45 deletions
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index c1cb88d89..863801c 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc @@ -1078,9 +1078,9 @@ void BookmarkBarView::BookmarkNodeFavIconLoaded(BookmarkModel* model, BookmarkNodeChangedImpl(model, node); } -void BookmarkBarView::WriteDragData(View* sender, - const gfx::Point& press_pt, - ui::OSExchangeData* data) { +void BookmarkBarView::WriteDragDataForView(View* sender, + const gfx::Point& press_pt, + ui::OSExchangeData* data) { UserMetrics::RecordAction(UserMetricsAction("BookmarkBar_DragButton"), profile_); @@ -1098,7 +1098,8 @@ void BookmarkBarView::WriteDragData(View* sender, NOTREACHED(); } -int BookmarkBarView::GetDragOperations(View* sender, const gfx::Point& p) { +int BookmarkBarView::GetDragOperationsForView(View* sender, + const gfx::Point& p) { if (size_animation_->is_animating() || (size_animation_->GetCurrentValue() == 0 && !OnNewTabPage())) { // Don't let the user drag while animating open or we're closed (and not on @@ -1118,9 +1119,9 @@ int BookmarkBarView::GetDragOperations(View* sender, const gfx::Point& p) { return ui::DragDropTypes::DRAG_NONE; } -bool BookmarkBarView::CanStartDrag(views::View* sender, - const gfx::Point& press_pt, - const gfx::Point& p) { +bool BookmarkBarView::CanStartDragForView(views::View* sender, + const gfx::Point& press_pt, + const gfx::Point& p) { // Check if we have not moved enough horizontally but we have moved downward // vertically - downward drag. if (!View::ExceededDragThreshold(press_pt.x() - p.x(), 0) && diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h index 5737e7c..c66e247 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h @@ -8,6 +8,7 @@ #include <set> +#include "base/compiler_specific.h" #include "chrome/browser/bookmarks/bookmark_model_observer.h" #include "chrome/browser/bookmarks/bookmark_node_data.h" #include "chrome/browser/sync/profile_sync_service.h" @@ -354,15 +355,16 @@ class BookmarkBarView : public DetachableToolbarView, // DragController method. Determines the node representing sender and invokes // WriteDragData to write the actual data. - virtual void WriteDragData(views::View* sender, - const gfx::Point& press_pt, - ui::OSExchangeData* data); + virtual void WriteDragDataForView(views::View* sender, + const gfx::Point& press_pt, + ui::OSExchangeData* data) OVERRIDE; - virtual int GetDragOperations(views::View* sender, const gfx::Point& p); + virtual int GetDragOperationsForView(views::View* sender, + const gfx::Point& p) OVERRIDE; - virtual bool CanStartDrag(views::View* sender, - const gfx::Point& press_pt, - const gfx::Point& p); + virtual bool CanStartDragForView(views::View* sender, + const gfx::Point& press_pt, + const gfx::Point& p) OVERRIDE; // Writes a BookmarkNodeData for node to data. void WriteDragData(const BookmarkNode* node, ui::OSExchangeData* data); diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc index 6870f65..276bc10 100644 --- a/chrome/browser/ui/views/browser_actions_container.cc +++ b/chrome/browser/ui/views/browser_actions_container.cc @@ -754,9 +754,9 @@ void BrowserActionsContainer::RunMenu(View* source, const gfx::Point& pt) { } } -void BrowserActionsContainer::WriteDragData(View* sender, - const gfx::Point& press_pt, - OSExchangeData* data) { +void BrowserActionsContainer::WriteDragDataForView(View* sender, + const gfx::Point& press_pt, + OSExchangeData* data) { DCHECK(data); for (size_t i = 0; i < browser_action_views_.size(); ++i) { @@ -777,14 +777,14 @@ void BrowserActionsContainer::WriteDragData(View* sender, } } -int BrowserActionsContainer::GetDragOperations(View* sender, - const gfx::Point& p) { +int BrowserActionsContainer::GetDragOperationsForView(View* sender, + const gfx::Point& p) { return ui::DragDropTypes::DRAG_MOVE; } -bool BrowserActionsContainer::CanStartDrag(View* sender, - const gfx::Point& press_pt, - const gfx::Point& p) { +bool BrowserActionsContainer::CanStartDragForView(View* sender, + const gfx::Point& press_pt, + const gfx::Point& p) { return true; } diff --git a/chrome/browser/ui/views/browser_actions_container.h b/chrome/browser/ui/views/browser_actions_container.h index 94c13139e..3400885 100644 --- a/chrome/browser/ui/views/browser_actions_container.h +++ b/chrome/browser/ui/views/browser_actions_container.h @@ -10,6 +10,7 @@ #include <string> #include <vector> +#include "base/compiler_specific.h" #include "base/task.h" #include "chrome/browser/extensions/extension_context_menu_model.h" #include "chrome/browser/extensions/extension_toolbar_model.h" @@ -337,13 +338,14 @@ class BrowserActionsContainer virtual void RunMenu(View* source, const gfx::Point& pt); // Overridden from views::DragController: - virtual void WriteDragData(View* sender, - const gfx::Point& press_pt, - ui::OSExchangeData* data); - virtual int GetDragOperations(View* sender, const gfx::Point& p); - virtual bool CanStartDrag(View* sender, - const gfx::Point& press_pt, - const gfx::Point& p); + virtual void WriteDragDataForView(View* sender, + const gfx::Point& press_pt, + ui::OSExchangeData* data) OVERRIDE; + virtual int GetDragOperationsForView(View* sender, + const gfx::Point& p) OVERRIDE; + virtual bool CanStartDragForView(View* sender, + const gfx::Point& press_pt, + const gfx::Point& p) OVERRIDE; // Overridden from ResizeArea::ResizeAreaDelegate: virtual void OnResize(int resize_amount, bool done_resizing); diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index 686c6f7..ad5f83c 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -1059,10 +1059,11 @@ AccessibilityTypes::Role LocationBarView::GetAccessibleRole() { return AccessibilityTypes::ROLE_GROUPING; } -void LocationBarView::WriteDragData(views::View* sender, - const gfx::Point& press_pt, - OSExchangeData* data) { - DCHECK(GetDragOperations(sender, press_pt) != ui::DragDropTypes::DRAG_NONE); +void LocationBarView::WriteDragDataForView(views::View* sender, + const gfx::Point& press_pt, + OSExchangeData* data) { + DCHECK_NE(GetDragOperationsForView(sender, press_pt), + ui::DragDropTypes::DRAG_NONE); TabContents* tab_contents = GetTabContentsFromDelegate(delegate_); DCHECK(tab_contents); @@ -1071,8 +1072,8 @@ void LocationBarView::WriteDragData(views::View* sender, tab_contents->GetFavIcon(), data); } -int LocationBarView::GetDragOperations(views::View* sender, - const gfx::Point& p) { +int LocationBarView::GetDragOperationsForView(views::View* sender, + const gfx::Point& p) { DCHECK((sender == location_icon_view_) || (sender == ev_bubble_view_)); TabContents* tab_contents = GetTabContentsFromDelegate(delegate_); return (tab_contents && tab_contents->GetURL().is_valid() && @@ -1081,9 +1082,9 @@ int LocationBarView::GetDragOperations(views::View* sender, ui::DragDropTypes::DRAG_NONE; } -bool LocationBarView::CanStartDrag(View* sender, - const gfx::Point& press_pt, - const gfx::Point& p) { +bool LocationBarView::CanStartDragForView(View* sender, + const gfx::Point& press_pt, + const gfx::Point& p) { return true; } diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h index 90607c8..2d53468 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.h +++ b/chrome/browser/ui/views/location_bar/location_bar_view.h @@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/compiler_specific.h" #include "base/task.h" #include "chrome/browser/autocomplete/autocomplete_edit.h" #include "chrome/browser/extensions/extension_context_menu_model.h" @@ -211,13 +212,14 @@ class LocationBarView : public LocationBar, virtual AccessibilityTypes::Role GetAccessibleRole() OVERRIDE; // Overridden from views::DragController: - virtual void WriteDragData(View* sender, - const gfx::Point& press_pt, - OSExchangeData* data) OVERRIDE; - virtual int GetDragOperations(View* sender, const gfx::Point& p) OVERRIDE; - virtual bool CanStartDrag(View* sender, - const gfx::Point& press_pt, - const gfx::Point& p) OVERRIDE; + virtual void WriteDragDataForView(View* sender, + const gfx::Point& press_pt, + OSExchangeData* data) OVERRIDE; + virtual int GetDragOperationsForView(View* sender, + const gfx::Point& p) OVERRIDE; + virtual bool CanStartDragForView(View* sender, + const gfx::Point& press_pt, + const gfx::Point& p) OVERRIDE; // Overridden from LocationBar: virtual void ShowFirstRunBubble(FirstRun::BubbleType bubble_type) OVERRIDE; |