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

Unified Diff: app/system_monitor_mac.mm

Issue 6361002: Move SystemMonitor to src/chrome/common.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 | « app/system_monitor.cc ('k') | app/system_monitor_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/system_monitor_mac.mm
===================================================================
--- app/system_monitor_mac.mm (revision 71446)
+++ app/system_monitor_mac.mm (working copy)
@@ -1,67 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "app/system_monitor.h"
-
-#import <AppKit/AppKit.h>
-
-@interface SystemMonitorBridge : NSObject {
- @private
- SystemMonitor* systemMonitor_; // weak
-}
-
-- (id)initWithSystemMonitor:(SystemMonitor*)monitor;
-- (void)computerDidSleep:(NSNotification*)notification;
-- (void)computerDidWake:(NSNotification*)notification;
-
-@end
-
-@implementation SystemMonitorBridge
-
-- (id)initWithSystemMonitor:(SystemMonitor*)monitor {
- self = [super init];
- if (self) {
- systemMonitor_ = monitor;
-
- // See QA1340
- // <http://developer.apple.com/library/mac/#qa/qa2004/qa1340.html> for more
- // details.
- [[[NSWorkspace sharedWorkspace] notificationCenter]
- addObserver:self
- selector:@selector(computerDidSleep:)
- name:NSWorkspaceWillSleepNotification
- object:nil];
- [[[NSWorkspace sharedWorkspace] notificationCenter]
- addObserver:self
- selector:@selector(computerDidWake:)
- name:NSWorkspaceDidWakeNotification
- object:nil];
- }
- return self;
-}
-
-- (void)dealloc {
- [[[NSWorkspace sharedWorkspace] notificationCenter]
- removeObserver:self];
- [super dealloc];
-}
-
-- (void)computerDidSleep:(NSNotification*)notification {
- systemMonitor_->ProcessPowerMessage(SystemMonitor::SUSPEND_EVENT);
-}
-
-- (void)computerDidWake:(NSNotification*)notification {
- systemMonitor_->ProcessPowerMessage(SystemMonitor::RESUME_EVENT);
-}
-
-@end
-
-void SystemMonitor::PlatformInit() {
- system_monitor_bridge_ =
- [[SystemMonitorBridge alloc] initWithSystemMonitor:this];
-}
-
-void SystemMonitor::PlatformDestroy() {
- [system_monitor_bridge_ release];
-}
« no previous file with comments | « app/system_monitor.cc ('k') | app/system_monitor_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698