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

Side by Side Diff: chrome/browser/ui/browser_window_state.cc

Issue 11085053: Improving window auto management between workspaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 8 years, 2 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
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/browser_window_state.h" 5 #include "chrome/browser/ui/browser_window_state.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "chrome/browser/defaults.h" 9 #include "chrome/browser/defaults.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 case Browser::TYPE_PANEL: 62 case Browser::TYPE_PANEL:
63 // Do not save the window placement of panels. 63 // Do not save the window placement of panels.
64 return false; 64 return false;
65 default: 65 default:
66 return false; 66 return false;
67 } 67 }
68 } 68 }
69 69
70 void SaveWindowPlacement(const Browser* browser, 70 void SaveWindowPlacement(const Browser* browser,
71 const gfx::Rect& bounds, 71 const gfx::Rect& bounds,
72 ui::WindowShowState show_state) { 72 ui::WindowShowState show_state,
73 bool user_has_changed_window_or_position) {
73 // Save to the session storage service, used when reloading a past session. 74 // Save to the session storage service, used when reloading a past session.
74 // Note that we don't want to be the ones who cause lazy initialization of 75 // Note that we don't want to be the ones who cause lazy initialization of
75 // the session service. This function gets called during initial window 76 // the session service. This function gets called during initial window
76 // showing, and we don't want to bring in the session service this early. 77 // showing, and we don't want to bring in the session service this early.
77 SessionService* session_service = 78 SessionService* session_service =
78 SessionServiceFactory::GetForProfileIfExisting(browser->profile()); 79 SessionServiceFactory::GetForProfileIfExisting(browser->profile());
79 if (session_service) 80 if (session_service)
80 session_service->SetWindowBounds(browser->session_id(), bounds, show_state); 81 session_service->SetWindowBounds(browser->session_id(),
82 bounds,
83 show_state,
84 user_has_changed_window_or_position);
81 } 85 }
82 86
83 void GetSavedWindowBoundsAndShowState(const Browser* browser, 87 void GetSavedWindowBoundsAndShowState(const Browser* browser,
84 gfx::Rect* bounds, 88 gfx::Rect* bounds,
85 ui::WindowShowState* show_state) { 89 ui::WindowShowState* show_state) {
86 DCHECK(browser); 90 DCHECK(browser);
87 DCHECK(bounds); 91 DCHECK(bounds);
88 DCHECK(show_state); 92 DCHECK(show_state);
89 *bounds = browser->override_bounds(); 93 *bounds = browser->override_bounds();
90 WindowSizer::GetBrowserWindowBoundsAndShowState(browser->app_name(), 94 WindowSizer::GetBrowserWindowBoundsAndShowState(browser->app_name(),
(...skipping 25 matching lines...) Expand all
116 if (parsed_command_line.HasSwitch(switches::kWindowPosition)) { 120 if (parsed_command_line.HasSwitch(switches::kWindowPosition)) {
117 std::string str = 121 std::string str =
118 parsed_command_line.GetSwitchValueASCII(switches::kWindowPosition); 122 parsed_command_line.GetSwitchValueASCII(switches::kWindowPosition);
119 int x, y; 123 int x, y;
120 if (ParseCommaSeparatedIntegers(str, &x, &y)) 124 if (ParseCommaSeparatedIntegers(str, &x, &y))
121 bounds->set_origin(gfx::Point(x, y)); 125 bounds->set_origin(gfx::Point(x, y));
122 } 126 }
123 } 127 }
124 128
125 } // namespace chrome 129 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698