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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 | 853 |
854 // TabStrip::DropInfo ---------------------------------------------------------- | 854 // TabStrip::DropInfo ---------------------------------------------------------- |
855 | 855 |
856 TabStrip::DropInfo::DropInfo(int drop_index, bool drop_before, bool point_down) | 856 TabStrip::DropInfo::DropInfo(int drop_index, bool drop_before, bool point_down) |
857 : drop_index(drop_index), | 857 : drop_index(drop_index), |
858 drop_before(drop_before), | 858 drop_before(drop_before), |
859 point_down(point_down) { | 859 point_down(point_down) { |
860 arrow_view = new views::ImageView; | 860 arrow_view = new views::ImageView; |
861 arrow_view->SetImage(GetDropArrowImage(point_down)); | 861 arrow_view->SetImage(GetDropArrowImage(point_down)); |
862 | 862 |
863 arrow_window = views::Widget::CreateWidget(); | 863 arrow_window = new views::Widget; |
864 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 864 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
865 params.keep_on_top = true; | 865 params.keep_on_top = true; |
866 params.transparent = true; | 866 params.transparent = true; |
867 params.accept_events = false; | 867 params.accept_events = false; |
868 params.can_activate = false; | 868 params.can_activate = false; |
869 params.bounds = gfx::Rect(drop_indicator_width, drop_indicator_height); | 869 params.bounds = gfx::Rect(drop_indicator_width, drop_indicator_height); |
870 arrow_window->Init(params); | 870 arrow_window->Init(params); |
871 arrow_window->SetContentsView(arrow_view); | 871 arrow_window->SetContentsView(arrow_view); |
872 } | 872 } |
873 | 873 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { | 1020 int TabStrip::GetAvailableWidthForTabs(Tab* last_tab) const { |
1021 return last_tab->x() + last_tab->width(); | 1021 return last_tab->x() + last_tab->width(); |
1022 } | 1022 } |
1023 | 1023 |
1024 bool TabStrip::IsPointInTab(Tab* tab, | 1024 bool TabStrip::IsPointInTab(Tab* tab, |
1025 const gfx::Point& point_in_tabstrip_coords) { | 1025 const gfx::Point& point_in_tabstrip_coords) { |
1026 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); | 1026 gfx::Point point_in_tab_coords(point_in_tabstrip_coords); |
1027 View::ConvertPointToView(this, tab, &point_in_tab_coords); | 1027 View::ConvertPointToView(this, tab, &point_in_tab_coords); |
1028 return tab->HitTest(point_in_tab_coords); | 1028 return tab->HitTest(point_in_tab_coords); |
1029 } | 1029 } |
OLD | NEW |