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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller_private.mm

Issue 1440593004: Make operators on scoped_ptr match the ones defined for std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrequals: followupfix-after-rebase Created 5 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
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 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #import "base/auto_reset.h" 9 #import "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 // |windowScreen| can be nil (for example, if the monitor arrangement was 150 // |windowScreen| can be nil (for example, if the monitor arrangement was
151 // changed while in fullscreen mode). If we see a nil screen, return without 151 // changed while in fullscreen mode). If we see a nil screen, return without
152 // saving. 152 // saving.
153 // TODO(rohitrao): We should just not save anything for fullscreen windows. 153 // TODO(rohitrao): We should just not save anything for fullscreen windows.
154 // http://crbug.com/36479. 154 // http://crbug.com/36479.
155 if (!windowScreen) 155 if (!windowScreen)
156 return; 156 return;
157 157
158 // Only save main window information to preferences. 158 // Only save main window information to preferences.
159 PrefService* prefs = browser_->profile()->GetPrefs(); 159 PrefService* prefs = browser_->profile()->GetPrefs();
160 if (!prefs || browser_ != chrome::GetLastActiveBrowser()) 160 if (!prefs || browser_.get() != chrome::GetLastActiveBrowser())
161 return; 161 return;
162 162
163 // Save the current work area, in flipped coordinates. 163 // Save the current work area, in flipped coordinates.
164 gfx::Rect workArea(NSRectToCGRect([windowScreen visibleFrame])); 164 gfx::Rect workArea(NSRectToCGRect([windowScreen visibleFrame]));
165 workArea.set_y(monitorFrame.size.height - workArea.y() - workArea.height()); 165 workArea.set_y(monitorFrame.size.height - workArea.y() - workArea.height());
166 166
167 scoped_ptr<DictionaryPrefUpdate> update = 167 scoped_ptr<DictionaryPrefUpdate> update =
168 chrome::GetWindowPlacementDictionaryReadWrite( 168 chrome::GetWindowPlacementDictionaryReadWrite(
169 chrome::GetWindowName(browser_.get()), 169 chrome::GetWindowName(browser_.get()),
170 browser_->profile()->GetPrefs()); 170 browser_->profile()->GetPrefs());
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 return browser_->tab_strip_model()->GetActiveWebContents(); 1216 return browser_->tab_strip_model()->GetActiveWebContents();
1217 } 1217 }
1218 1218
1219 - (PermissionBubbleManager*)permissionBubbleManager { 1219 - (PermissionBubbleManager*)permissionBubbleManager {
1220 if (WebContents* contents = [self webContents]) 1220 if (WebContents* contents = [self webContents])
1221 return PermissionBubbleManager::FromWebContents(contents); 1221 return PermissionBubbleManager::FromWebContents(contents);
1222 return nil; 1222 return nil;
1223 } 1223 }
1224 1224
1225 @end // @implementation BrowserWindowController(Private) 1225 @end // @implementation BrowserWindowController(Private)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller.mm ('k') | chrome/browser/ui/cocoa/panels/panel_cocoa_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698