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

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

Issue 5089001: Cleanup: Include browser.h -> ui/browser.h [Part 3]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes. Created 10 years, 1 month 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/dom_view_browsertest.cc ('k') | chrome/browser/window_sizer_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/window_sizer.h" 5 #include "chrome/browser/window_sizer.h"
6 6
7 #include "chrome/browser/browser.h"
8 #include "chrome/browser/browser_list.h" 7 #include "chrome/browser/browser_list.h"
9 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/browser_window.h" 9 #include "chrome/browser/browser_window.h"
11 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/common/pref_names.h" 12 #include "chrome/common/pref_names.h"
13 13
14 /////////////////////////////////////////////////////////////////////////////// 14 ///////////////////////////////////////////////////////////////////////////////
15 // An implementation of WindowSizer::StateProvider that gets the last active 15 // An implementation of WindowSizer::StateProvider that gets the last active
16 // and persistent state from the browser window and the user's profile. 16 // and persistent state from the browser window and the user's profile.
17 class DefaultStateProvider : public WindowSizer::StateProvider { 17 class DefaultStateProvider : public WindowSizer::StateProvider {
18 public: 18 public:
19 explicit DefaultStateProvider(const std::string& app_name, Browser* browser) 19 explicit DefaultStateProvider(const std::string& app_name, Browser* browser)
20 : app_name_(app_name), 20 : app_name_(app_name),
21 browser_(browser) { 21 browser_(browser) {
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 // On non-Mac platforms, we are less aggressive about repositioning. Simply 327 // On non-Mac platforms, we are less aggressive about repositioning. Simply
328 // ensure that at least kMinVisibleWidth * kMinVisibleHeight is visible. 328 // ensure that at least kMinVisibleWidth * kMinVisibleHeight is visible.
329 const int min_y = work_area.y() + kMinVisibleHeight - bounds->height(); 329 const int min_y = work_area.y() + kMinVisibleHeight - bounds->height();
330 const int min_x = work_area.x() + kMinVisibleWidth - bounds->width(); 330 const int min_x = work_area.x() + kMinVisibleWidth - bounds->width();
331 const int max_y = work_area.bottom() - kMinVisibleHeight; 331 const int max_y = work_area.bottom() - kMinVisibleHeight;
332 const int max_x = work_area.right() - kMinVisibleWidth; 332 const int max_x = work_area.right() - kMinVisibleWidth;
333 bounds->set_y(std::max(min_y, std::min(max_y, bounds->y()))); 333 bounds->set_y(std::max(min_y, std::min(max_y, bounds->y())));
334 bounds->set_x(std::max(min_x, std::min(max_x, bounds->x()))); 334 bounds->set_x(std::max(min_x, std::min(max_x, bounds->x())));
335 #endif // defined(OS_MACOSX) 335 #endif // defined(OS_MACOSX)
336 } 336 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/dom_view_browsertest.cc ('k') | chrome/browser/window_sizer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698