| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tabs/tab_strip.h" | 5 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 return ui::DragDropTypes::DRAG_NONE; | 352 return ui::DragDropTypes::DRAG_NONE; |
| 353 | 353 |
| 354 const int drop_index = drop_info_->drop_index; | 354 const int drop_index = drop_info_->drop_index; |
| 355 const bool drop_before = drop_info_->drop_before; | 355 const bool drop_before = drop_info_->drop_before; |
| 356 | 356 |
| 357 // Hide the drop indicator. | 357 // Hide the drop indicator. |
| 358 SetDropIndex(-1, false); | 358 SetDropIndex(-1, false); |
| 359 | 359 |
| 360 GURL url; | 360 GURL url; |
| 361 std::wstring title; | 361 std::wstring title; |
| 362 if (!event.GetData().GetURLAndTitle(&url, &title) || !url.is_valid()) | 362 if (!event.data().GetURLAndTitle(&url, &title) || !url.is_valid()) |
| 363 return ui::DragDropTypes::DRAG_NONE; | 363 return ui::DragDropTypes::DRAG_NONE; |
| 364 | 364 |
| 365 controller()->PerformDrop(drop_before, drop_index, url); | 365 controller()->PerformDrop(drop_before, drop_index, url); |
| 366 | 366 |
| 367 return GetDropEffect(event); | 367 return GetDropEffect(event); |
| 368 } | 368 } |
| 369 | 369 |
| 370 AccessibilityTypes::Role TabStrip::GetAccessibleRole() { | 370 AccessibilityTypes::Role TabStrip::GetAccessibleRole() { |
| 371 return AccessibilityTypes::ROLE_PAGETABLIST; | 371 return AccessibilityTypes::ROLE_PAGETABLIST; |
| 372 } | 372 } |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 drop_info_->arrow_window->SetWindowPos( | 755 drop_info_->arrow_window->SetWindowPos( |
| 756 HWND_TOPMOST, drop_bounds.x(), drop_bounds.y(), drop_bounds.width(), | 756 HWND_TOPMOST, drop_bounds.x(), drop_bounds.y(), drop_bounds.width(), |
| 757 drop_bounds.height(), SWP_NOACTIVATE | SWP_SHOWWINDOW); | 757 drop_bounds.height(), SWP_NOACTIVATE | SWP_SHOWWINDOW); |
| 758 #else | 758 #else |
| 759 drop_info_->arrow_window->SetBounds(drop_bounds); | 759 drop_info_->arrow_window->SetBounds(drop_bounds); |
| 760 drop_info_->arrow_window->Show(); | 760 drop_info_->arrow_window->Show(); |
| 761 #endif | 761 #endif |
| 762 } | 762 } |
| 763 | 763 |
| 764 int TabStrip::GetDropEffect(const views::DropTargetEvent& event) { | 764 int TabStrip::GetDropEffect(const views::DropTargetEvent& event) { |
| 765 const int source_ops = event.GetSourceOperations(); | 765 const int source_ops = event.source_operations(); |
| 766 if (source_ops & ui::DragDropTypes::DRAG_COPY) | 766 if (source_ops & ui::DragDropTypes::DRAG_COPY) |
| 767 return ui::DragDropTypes::DRAG_COPY; | 767 return ui::DragDropTypes::DRAG_COPY; |
| 768 if (source_ops & ui::DragDropTypes::DRAG_LINK) | 768 if (source_ops & ui::DragDropTypes::DRAG_LINK) |
| 769 return ui::DragDropTypes::DRAG_LINK; | 769 return ui::DragDropTypes::DRAG_LINK; |
| 770 return ui::DragDropTypes::DRAG_MOVE; | 770 return ui::DragDropTypes::DRAG_MOVE; |
| 771 } | 771 } |
| 772 | 772 |
| 773 // static | 773 // static |
| 774 SkBitmap* TabStrip::GetDropArrowImage(bool is_down) { | 774 SkBitmap* TabStrip::GetDropArrowImage(bool is_down) { |
| 775 return ResourceBundle::GetSharedInstance().GetBitmapNamed( | 775 return ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { | 949 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { |
| 950 return last_tab->x() + last_tab->width(); | 950 return last_tab->x() + last_tab->width(); |
| 951 } | 951 } |
| 952 | 952 |
| 953 bool TabStrip::IsPointInTab(Tab* tab, | 953 bool TabStrip::IsPointInTab(Tab* tab, |
| 954 const gfx::Point& point_in_tabstrip_coords) { | 954 const gfx::Point& point_in_tabstrip_coords) { |
| 955 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 955 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
| 956 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 956 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
| 957 return tab->HitTest(point_in_tab_coords); | 957 return tab->HitTest(point_in_tab_coords); |
| 958 } | 958 } |
| OLD | NEW |