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

Unified Diff: chrome/browser/fullscreen_mac.mm

Issue 11791005: Switch to direct observation of fullscreen after r174754. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/fullscreen_mac.mm
diff --git a/chrome/browser/fullscreen_mac.mm b/chrome/browser/fullscreen_mac.mm
index f4e73c06ab6a14877146fcb0715e103f341f9bb9..ae50d7c07a7166b709fc000a5077134ac1d8307f 100644
--- a/chrome/browser/fullscreen_mac.mm
+++ b/chrome/browser/fullscreen_mac.mm
@@ -7,7 +7,6 @@
#import <Cocoa/Cocoa.h>
#import "base/logging.h"
-#import "third_party/GTM/Foundation/GTMNSObject+KeyValueObserving.h"
// Replicate specific 10.7 SDK declarations for building with prior SDKs.
#if !defined(MAC_OS_X_VERSION_10_7) || \
@@ -54,25 +53,25 @@ BOOL AreOptionsFullScreen(NSApplicationPresentationOptions options) {
- (id)init {
if ((self = [super init])) {
- [NSApp gtm_addObserver:self
- forKeyPath:@"currentSystemPresentationOptions"
- selector:@selector(observeNotification:)
- userInfo:nil
- options:NSKeyValueObservingOptionNew |
- NSKeyValueObservingOptionInitial];
+ [NSApp addObserver:self
+ forKeyPath:@"currentSystemPresentationOptions"
+ options:NSKeyValueObservingOptionNew |
+ NSKeyValueObservingOptionInitial
+ context:nil];
}
return self;
}
- (void)dealloc {
- [NSApp gtm_removeObserver:self
- forKeyPath:@"currentSystemPresentationOptions"
- selector:@selector(observeNotification:)];
+ [NSApp removeObserver:self
+ forKeyPath:@"currentSystemPresentationOptions"];
[super dealloc];
}
-- (void)observeNotification:(GTMKeyValueChangeNotification*)notification {
- NSDictionary* change = [notification change];
+- (void)observeValueForKeyPath:(NSString*)keyPath
+ ofObject:(id)object
+ change:(NSDictionary*)change
+ context:(void*)context {
NSApplicationPresentationOptions options =
[[change objectForKey:NSKeyValueChangeNewKey] integerValue];
[self setFullScreen:AreOptionsFullScreen(options)];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698