[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 1 | // Copyright (c) 2012 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 "content/shell/shell_application_mac.h" | ||||
6 | |||||
[email protected] | a670807 | 2012-03-27 14:10:45 | [diff] [blame] | 7 | #include "base/auto_reset.h" |
[email protected] | f3474bb5 | 2012-04-02 16:32:36 | [diff] [blame^] | 8 | #include "content/shell/shell.h" |
9 | #include "content/shell/shell_browser_context.h" | ||||
10 | #include "googleurl/src/gurl.h" | ||||
[email protected] | a670807 | 2012-03-27 14:10:45 | [diff] [blame] | 11 | |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 12 | @implementation ShellCrApplication |
13 | |||||
14 | - (BOOL)isHandlingSendEvent { | ||||
15 | return handlingSendEvent_; | ||||
16 | } | ||||
17 | |||||
18 | - (void)sendEvent:(NSEvent*)event { | ||||
[email protected] | a670807 | 2012-03-27 14:10:45 | [diff] [blame] | 19 | AutoReset<BOOL> scoper(&handlingSendEvent_, YES); |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 20 | [super sendEvent:event]; |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 21 | } |
22 | |||||
23 | - (void)setHandlingSendEvent:(BOOL)handlingSendEvent { | ||||
24 | handlingSendEvent_ = handlingSendEvent; | ||||
25 | } | ||||
26 | |||||
[email protected] | f3474bb5 | 2012-04-02 16:32:36 | [diff] [blame^] | 27 | - (IBAction)newDocument:(id)sender { |
28 | content::Shell::CreateNewWindow(content::ShellBrowserContext::GetInstance(), | ||||
29 | GURL("about:blank"), | ||||
30 | NULL, | ||||
31 | MSG_ROUTING_NONE, | ||||
32 | NULL); | ||||
33 | } | ||||
34 | |||||
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 35 | @end |