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

Side by Side Diff: chrome/browser/ui/window_sizer/window_sizer_win.cc

Issue 138943006: Remove a bunch of dead files after the win aura switch. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_view.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/window_sizer/window_sizer.h"
6
7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_finder.h"
9 #include "chrome/browser/ui/browser_window.h"
10 #include "chrome/browser/ui/host_desktop.h"
11
12 // How much horizontal and vertical offset there is between newly
13 // opened windows.
14 const int WindowSizer::kWindowTilePixels = 10;
15
16 // static
17 gfx::Point WindowSizer::GetDefaultPopupOrigin(const gfx::Size& size,
18 chrome::HostDesktopType type) {
19 RECT area;
20 SystemParametersInfo(SPI_GETWORKAREA, 0, &area, 0);
21 gfx::Point corner(area.left, area.top);
22
23 if (Browser* browser = chrome::FindLastActiveWithHostDesktopType(type)) {
24 RECT browser_rect;
25 HWND window = reinterpret_cast<HWND>(browser->window()->GetNativeWindow());
26 if (GetWindowRect(window, &browser_rect)) {
27 // Limit to not overflow the work area right and bottom edges.
28 gfx::Point limit(
29 std::min(browser_rect.left + kWindowTilePixels,
30 area.right-size.width()),
31 std::min(browser_rect.top + kWindowTilePixels,
32 area.bottom-size.height())
33 );
34 // Adjust corner to now overflow the work area left and top edges, so
35 // that if a popup does not fit the title-bar is remains visible.
36 corner = gfx::Point(
37 std::max(corner.x(), limit.x()),
38 std::max(corner.y(), limit.y())
39 );
40 }
41 }
42 return corner;
43 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_view.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698