| 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 11 matching lines...) Expand all Loading... |
| 22 #include "ui/base/animation/animation_container.h" | 22 #include "ui/base/animation/animation_container.h" |
| 23 #include "ui/base/dragdrop/drag_drop_types.h" | 23 #include "ui/base/dragdrop/drag_drop_types.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "views/controls/image_view.h" | 26 #include "views/controls/image_view.h" |
| 27 #include "views/widget/default_theme_provider.h" | 27 #include "views/widget/default_theme_provider.h" |
| 28 #include "views/window/non_client_view.h" | 28 #include "views/window/non_client_view.h" |
| 29 #include "views/window/window.h" | 29 #include "views/window/window.h" |
| 30 | 30 |
| 31 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
| 32 #include "app/win/win_util.h" | 32 #include "views/widget/monitor_win.h" |
| 33 #include "views/widget/widget_win.h" | 33 #include "views/widget/widget_win.h" |
| 34 #elif defined(OS_LINUX) | 34 #elif defined(OS_LINUX) |
| 35 #include "views/widget/widget_gtk.h" | 35 #include "views/widget/widget_gtk.h" |
| 36 #endif | 36 #endif |
| 37 | 37 |
| 38 #undef min | 38 #undef min |
| 39 #undef max | 39 #undef max |
| 40 | 40 |
| 41 #if defined(COMPILER_GCC) | 41 #if defined(COMPILER_GCC) |
| 42 // Squash false positive signed overflow warning in GenerateStartAndEndWidths | 42 // Squash false positive signed overflow warning in GenerateStartAndEndWidths |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 | 675 |
| 676 // Determine the screen bounds. | 676 // Determine the screen bounds. |
| 677 gfx::Point drop_loc(center_x - drop_indicator_width / 2, | 677 gfx::Point drop_loc(center_x - drop_indicator_width / 2, |
| 678 -drop_indicator_height); | 678 -drop_indicator_height); |
| 679 ConvertPointToScreen(this, &drop_loc); | 679 ConvertPointToScreen(this, &drop_loc); |
| 680 gfx::Rect drop_bounds(drop_loc.x(), drop_loc.y(), drop_indicator_width, | 680 gfx::Rect drop_bounds(drop_loc.x(), drop_loc.y(), drop_indicator_width, |
| 681 drop_indicator_height); | 681 drop_indicator_height); |
| 682 | 682 |
| 683 // If the rect doesn't fit on the monitor, push the arrow to the bottom. | 683 // If the rect doesn't fit on the monitor, push the arrow to the bottom. |
| 684 #if defined(OS_WIN) | 684 #if defined(OS_WIN) |
| 685 gfx::Rect monitor_bounds = app::win::GetMonitorBoundsForRect(drop_bounds); | 685 gfx::Rect monitor_bounds = views::GetMonitorBoundsForRect(drop_bounds); |
| 686 *is_beneath = (monitor_bounds.IsEmpty() || | 686 *is_beneath = (monitor_bounds.IsEmpty() || |
| 687 !monitor_bounds.Contains(drop_bounds)); | 687 !monitor_bounds.Contains(drop_bounds)); |
| 688 #else | 688 #else |
| 689 *is_beneath = false; | 689 *is_beneath = false; |
| 690 NOTIMPLEMENTED(); | 690 NOTIMPLEMENTED(); |
| 691 #endif | 691 #endif |
| 692 if (*is_beneath) | 692 if (*is_beneath) |
| 693 drop_bounds.Offset(0, drop_bounds.height() + height()); | 693 drop_bounds.Offset(0, drop_bounds.height() + height()); |
| 694 | 694 |
| 695 return drop_bounds; | 695 return drop_bounds; |
| (...skipping 253 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 |