OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 2323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2334 center_x = GetMirroredXInView(center_x); | 2334 center_x = GetMirroredXInView(center_x); |
2335 | 2335 |
2336 // Determine the screen bounds. | 2336 // Determine the screen bounds. |
2337 gfx::Point drop_loc(center_x - drop_indicator_width / 2, | 2337 gfx::Point drop_loc(center_x - drop_indicator_width / 2, |
2338 -drop_indicator_height); | 2338 -drop_indicator_height); |
2339 ConvertPointToScreen(this, &drop_loc); | 2339 ConvertPointToScreen(this, &drop_loc); |
2340 gfx::Rect drop_bounds(drop_loc.x(), drop_loc.y(), drop_indicator_width, | 2340 gfx::Rect drop_bounds(drop_loc.x(), drop_loc.y(), drop_indicator_width, |
2341 drop_indicator_height); | 2341 drop_indicator_height); |
2342 | 2342 |
2343 // If the rect doesn't fit on the monitor, push the arrow to the bottom. | 2343 // If the rect doesn't fit on the monitor, push the arrow to the bottom. |
2344 gfx::Screen* screen = gfx::Screen::GetScreenFor(GetWidget()->GetNativeView()); | 2344 gfx::Screen* screen = gfx::Screen::GetScreen(); |
2345 gfx::Display display = screen->GetDisplayMatching(drop_bounds); | 2345 gfx::Display display = screen->GetDisplayMatching(drop_bounds); |
2346 *is_beneath = !display.bounds().Contains(drop_bounds); | 2346 *is_beneath = !display.bounds().Contains(drop_bounds); |
2347 if (*is_beneath) | 2347 if (*is_beneath) |
2348 drop_bounds.Offset(0, drop_bounds.height() + height()); | 2348 drop_bounds.Offset(0, drop_bounds.height() + height()); |
2349 | 2349 |
2350 return drop_bounds; | 2350 return drop_bounds; |
2351 } | 2351 } |
2352 | 2352 |
2353 void TabStrip::UpdateDropIndex(const DropTargetEvent& event) { | 2353 void TabStrip::UpdateDropIndex(const DropTargetEvent& event) { |
2354 // If the UI layout is right-to-left, we need to mirror the mouse | 2354 // If the UI layout is right-to-left, we need to mirror the mouse |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2863 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); | 2863 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); |
2864 if (view) | 2864 if (view) |
2865 return view; | 2865 return view; |
2866 } | 2866 } |
2867 Tab* tab = FindTabForEvent(point); | 2867 Tab* tab = FindTabForEvent(point); |
2868 if (tab) | 2868 if (tab) |
2869 return ConvertPointToViewAndGetEventHandler(this, tab, point); | 2869 return ConvertPointToViewAndGetEventHandler(this, tab, point); |
2870 } | 2870 } |
2871 return this; | 2871 return this; |
2872 } | 2872 } |
OLD | NEW |