Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2326 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 center_x = GetMirroredXInView(center_x); 2337 center_x = GetMirroredXInView(center_x);
2338 2338
2339 // Determine the screen bounds. 2339 // Determine the screen bounds.
2340 gfx::Point drop_loc(center_x - drop_indicator_width / 2, 2340 gfx::Point drop_loc(center_x - drop_indicator_width / 2,
2341 -drop_indicator_height); 2341 -drop_indicator_height);
2342 ConvertPointToScreen(this, &drop_loc); 2342 ConvertPointToScreen(this, &drop_loc);
2343 gfx::Rect drop_bounds(drop_loc.x(), drop_loc.y(), drop_indicator_width, 2343 gfx::Rect drop_bounds(drop_loc.x(), drop_loc.y(), drop_indicator_width,
2344 drop_indicator_height); 2344 drop_indicator_height);
2345 2345
2346 // If the rect doesn't fit on the monitor, push the arrow to the bottom. 2346 // If the rect doesn't fit on the monitor, push the arrow to the bottom.
2347 gfx::Screen* screen = gfx::Screen::GetScreenFor(GetWidget()->GetNativeView()); 2347 gfx::Screen* screen = gfx::Screen::GetScreen();
2348 gfx::Display display = screen->GetDisplayMatching(drop_bounds); 2348 gfx::Display display = screen->GetDisplayMatching(drop_bounds);
2349 *is_beneath = !display.bounds().Contains(drop_bounds); 2349 *is_beneath = !display.bounds().Contains(drop_bounds);
2350 if (*is_beneath) 2350 if (*is_beneath)
2351 drop_bounds.Offset(0, drop_bounds.height() + height()); 2351 drop_bounds.Offset(0, drop_bounds.height() + height());
2352 2352
2353 return drop_bounds; 2353 return drop_bounds;
2354 } 2354 }
2355 2355
2356 void TabStrip::UpdateDropIndex(const DropTargetEvent& event) { 2356 void TabStrip::UpdateDropIndex(const DropTargetEvent& event) {
2357 // If the UI layout is right-to-left, we need to mirror the mouse 2357 // If the UI layout is right-to-left, we need to mirror the mouse
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
2871 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point); 2871 ConvertPointToViewAndGetEventHandler(this, newtab_button_, point);
2872 if (view) 2872 if (view)
2873 return view; 2873 return view;
2874 } 2874 }
2875 Tab* tab = FindTabForEvent(point); 2875 Tab* tab = FindTabForEvent(point);
2876 if (tab) 2876 if (tab)
2877 return ConvertPointToViewAndGetEventHandler(this, tab, point); 2877 return ConvertPointToViewAndGetEventHandler(this, tab, point);
2878 } 2878 }
2879 return this; 2879 return this;
2880 } 2880 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698