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

Side by Side Diff: chrome/browser/chrome_browser_application_mac.mm

Issue 8724004: [Mac] Move ScopedSendingEvent from content/common/mac to base/mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add CrAppControlProtocol support to CrDrtApplication Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/chrome_browser_application_mac.h" 5 #import "chrome/browser/chrome_browser_application_mac.h"
6 6
7 #import "base/logging.h" 7 #import "base/logging.h"
8 #include "base/mac/crash_logging.h" 8 #include "base/mac/crash_logging.h"
9 #import "base/mac/scoped_nsexception_enabler.h" 9 #import "base/mac/scoped_nsexception_enabler.h"
10 #import "base/metrics/histogram.h" 10 #import "base/metrics/histogram.h"
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 362
363 - (void)addEventHook:(id<CrApplicationEventHookProtocol>)handler { 363 - (void)addEventHook:(id<CrApplicationEventHookProtocol>)handler {
364 [eventHooks_ addObject:handler]; 364 [eventHooks_ addObject:handler];
365 } 365 }
366 366
367 - (void)removeEventHook:(id<CrApplicationEventHookProtocol>)handler { 367 - (void)removeEventHook:(id<CrApplicationEventHookProtocol>)handler {
368 [eventHooks_ removeObject:handler]; 368 [eventHooks_ removeObject:handler];
369 } 369 }
370 370
371 - (void)sendEvent:(NSEvent*)event { 371 - (void)sendEvent:(NSEvent*)event {
372 content::mac::ScopedSendingEvent sendingEventScoper; 372 base::mac::ScopedSendingEvent sendingEventScoper;
373 for (id<CrApplicationEventHookProtocol> handler in eventHooks_.get()) { 373 for (id<CrApplicationEventHookProtocol> handler in eventHooks_.get()) {
374 [handler hookForEvent:event]; 374 [handler hookForEvent:event];
375 } 375 }
376 [super sendEvent:event]; 376 [super sendEvent:event];
377 } 377 }
378 378
379 // NSExceptions which are caught by the event loop are logged here. 379 // NSExceptions which are caught by the event loop are logged here.
380 // NSException uses setjmp/longjmp, which can be very bad for C++, so 380 // NSException uses setjmp/longjmp, which can be very bad for C++, so
381 // we attempt to track and report them. 381 // we attempt to track and report them.
382 - (void)reportException:(NSException *)anException { 382 - (void)reportException:(NSException *)anException {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 if (RenderViewHost* rvh = contents->render_view_host()) { 448 if (RenderViewHost* rvh = contents->render_view_host()) {
449 rvh->EnableRendererAccessibility(); 449 rvh->EnableRendererAccessibility();
450 } 450 }
451 } 451 }
452 } 452 }
453 } 453 }
454 return [super accessibilitySetValue:value forAttribute:attribute]; 454 return [super accessibilitySetValue:value forAttribute:attribute];
455 } 455 }
456 456
457 @end 457 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698