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

Unified Diff: chrome/browser/ui/window_sizer_mac.mm

Issue 10704022: browser: Move window sizer to subdir. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/window_sizer_gtk.cc ('k') | chrome/browser/ui/window_sizer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/window_sizer_mac.mm
diff --git a/chrome/browser/ui/window_sizer_mac.mm b/chrome/browser/ui/window_sizer_mac.mm
deleted file mode 100644
index 445292c4da26ae0302af4b28b3ee5c041bba6301..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/window_sizer_mac.mm
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/window_sizer.h"
-
-#import <Cocoa/Cocoa.h>
-
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_list.h"
-#include "chrome/browser/ui/browser_window.h"
-
-// How much horizontal and vertical offset there is between newly
-// opened windows.
-const int WindowSizer::kWindowTilePixels = 22;
-
-// static
-gfx::Point WindowSizer::GetDefaultPopupOrigin(const gfx::Size& size) {
- NSRect work_area = [[NSScreen mainScreen] visibleFrame];
- NSRect main_area = [[[NSScreen screens] objectAtIndex:0] frame];
- NSPoint corner = NSMakePoint(NSMinX(work_area), NSMaxY(work_area));
-
- if (Browser* b = BrowserList::GetLastActive()) {
- NSWindow* window = b->window()->GetNativeWindow();
- NSRect window_frame = [window frame];
-
- // Limit to not overflow the work area right and bottom edges.
- NSPoint limit = NSMakePoint(
- std::min(NSMinX(window_frame) + kWindowTilePixels,
- NSMaxX(work_area) - size.width()),
- std::max(NSMaxY(window_frame) - kWindowTilePixels,
- NSMinY(work_area) + size.height()));
-
- // Adjust corner to now overflow the work area left and top edges, so
- // that if a popup does not fit the title-bar is remains visible.
- corner = NSMakePoint(std::max(corner.x, limit.x),
- std::min(corner.y, limit.y));
- }
-
- return gfx::Point(corner.x, NSHeight(main_area) - corner.y);
-}
« no previous file with comments | « chrome/browser/ui/window_sizer_gtk.cc ('k') | chrome/browser/ui/window_sizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698