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

Unified Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 119363: Add a stack-based class for property disabling and re-enabling screen updatin... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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
« base/base.gyp ('K') | « base/scoped_nsdisable_screen_updates.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_window_controller.mm
===================================================================
--- chrome/browser/cocoa/browser_window_controller.mm (revision 17937)
+++ chrome/browser/cocoa/browser_window_controller.mm (working copy)
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/mac_util.h"
+#include "base/scoped_nsdisable_screen_updates.h"
#include "base/sys_string_conversions.h"
#include "chrome/app/chrome_dll_resource.h" // IDC_*
#include "chrome/browser/browser.h"
@@ -193,7 +194,7 @@
// going away) will again call to close the window when it's finally ready.
- (BOOL)windowShouldClose:(id)sender {
// Disable updates while closing all tabs to avoid flickering.
- NSDisableScreenUpdates();
+ base::ScopedNSDisableScreenUpdates disabler;
// Give beforeunload handlers the chance to cancel the close before we hide
// the window below.
if (!browser_->ShouldCloseWindow())
@@ -212,7 +213,6 @@
browser_->OnWindowClosing();
return NO;
}
- NSEnableScreenUpdates();
// the tab strip is empty, it's ok to close the window
return YES;
@@ -462,7 +462,7 @@
- (TabWindowController*)detachTabToNewWindow:(TabView*)tabView {
// Disable screen updates so that this appears as a single visual change.
- NSDisableScreenUpdates();
+ base::ScopedNSDisableScreenUpdates disabler;
// Fetch the tab contents for the tab being dragged
int index = [tabStripController_ indexForTabView:tabView];
@@ -507,7 +507,6 @@
// And make sure we use the correct frame in the new view.
[[controller tabStripController] setFrameOfSelectedTab:tabRect];
- NSEnableScreenUpdates();
return controller;
}
« base/base.gyp ('K') | « base/scoped_nsdisable_screen_updates.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698