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

Side by Side Diff: base/test/mock_chrome_application_mac.mm

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « base/test/mock_chrome_application_mac.h ('k') | base/test/mock_devices_changed_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/test/mock_chrome_application_mac.h"
6
7 #include "base/auto_reset.h"
8 #include "base/logging.h"
9
10 @implementation MockCrApp
11
12 + (NSApplication*)sharedApplication {
13 NSApplication* app = [super sharedApplication];
14 DCHECK([app conformsToProtocol:@protocol(CrAppControlProtocol)])
15 << "Existing NSApp (class " << [[app className] UTF8String]
16 << ") does not conform to required protocol.";
17 DCHECK(base::MessagePumpMac::UsingCrApp())
18 << "MessagePumpMac::Create() was called before "
19 << "+[MockCrApp sharedApplication]";
20 return app;
21 }
22
23 - (void)sendEvent:(NSEvent*)event {
24 base::AutoReset<BOOL> scoper(&handlingSendEvent_, YES);
25 [super sendEvent:event];
26 }
27
28 - (void)setHandlingSendEvent:(BOOL)handlingSendEvent {
29 handlingSendEvent_ = handlingSendEvent;
30 }
31
32 - (BOOL)isHandlingSendEvent {
33 return handlingSendEvent_;
34 }
35
36 @end
37
38 namespace mock_cr_app {
39
40 void RegisterMockCrApp() {
41 [MockCrApp sharedApplication];
42 }
43
44 } // namespace mock_cr_app
OLDNEW
« no previous file with comments | « base/test/mock_chrome_application_mac.h ('k') | base/test/mock_devices_changed_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698