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

Side by Side Diff: chrome/browser/ui/window_sizer/window_sizer_mac.mm

Issue 1336993002: Straighten up includes of host_desktop.h/host_desktop_type.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@host_desktop_type
Patch Set: Build fixes for Windows and Mac Created 5 years, 3 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/window_sizer/window_sizer.h" 5 #include "chrome/browser/ui/window_sizer/window_sizer.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_finder.h" 10 #include "chrome/browser/ui/browser_finder.h"
11 #include "chrome/browser/ui/browser_window.h" 11 #include "chrome/browser/ui/browser_window.h"
12 #include "chrome/browser/ui/host_desktop.h" 12 #include "ui/gfx/host_desktop_type.h"
13 13
14 // How much horizontal and vertical offset there is between newly 14 // How much horizontal and vertical offset there is between newly
15 // opened windows. 15 // opened windows.
16 const int WindowSizer::kWindowTilePixels = 22; 16 const int WindowSizer::kWindowTilePixels = 22;
17 17
18 // static 18 // static
19 gfx::Point WindowSizer::GetDefaultPopupOrigin(const gfx::Size& size, 19 gfx::Point WindowSizer::GetDefaultPopupOrigin(const gfx::Size& size,
20 ui::HostDesktopType type) { 20 ui::HostDesktopType type) {
21 NSRect work_area = [[NSScreen mainScreen] visibleFrame]; 21 NSRect work_area = [[NSScreen mainScreen] visibleFrame];
22 NSRect main_area = [[[NSScreen screens] objectAtIndex:0] frame]; 22 NSRect main_area = [[[NSScreen screens] objectAtIndex:0] frame];
(...skipping 11 matching lines...) Expand all
34 NSMinY(work_area) + size.height())); 34 NSMinY(work_area) + size.height()));
35 35
36 // Adjust corner to now overflow the work area left and top edges, so 36 // Adjust corner to now overflow the work area left and top edges, so
37 // that if a popup does not fit the title-bar is remains visible. 37 // that if a popup does not fit the title-bar is remains visible.
38 corner = NSMakePoint(std::max(corner.x, limit.x), 38 corner = NSMakePoint(std::max(corner.x, limit.x),
39 std::min(corner.y, limit.y)); 39 std::min(corner.y, limit.y));
40 } 40 }
41 41
42 return gfx::Point(corner.x, NSHeight(main_area) - corner.y); 42 return gfx::Point(corner.x, NSHeight(main_area) - corner.y);
43 } 43 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/window_sizer/window_sizer_aura.cc ('k') | chrome/test/base/browser_with_test_window_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698