[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" | ||||
[email protected] | 3560b57 | 2012-04-04 20:47:32 | [diff] [blame] | 10 | #include "content/shell/shell_content_browser_client.h" |
[email protected] | f3474bb5 | 2012-04-02 16:32:36 | [diff] [blame] | 11 | #include "googleurl/src/gurl.h" |
[email protected] | a670807 | 2012-03-27 14:10:45 | [diff] [blame] | 12 | |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 13 | @implementation ShellCrApplication |
14 | |||||
15 | - (BOOL)isHandlingSendEvent { | ||||
16 | return handlingSendEvent_; | ||||
17 | } | ||||
18 | |||||
19 | - (void)sendEvent:(NSEvent*)event { | ||||
[email protected] | 997ec9f | 2012-11-21 04:44:14 | [diff] [blame] | 20 | base::AutoReset<BOOL> scoper(&handlingSendEvent_, YES); |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 21 | [super sendEvent:event]; |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 22 | } |
23 | |||||
24 | - (void)setHandlingSendEvent:(BOOL)handlingSendEvent { | ||||
25 | handlingSendEvent_ = handlingSendEvent; | ||||
26 | } | ||||
27 | |||||
[email protected] | f3474bb5 | 2012-04-02 16:32:36 | [diff] [blame] | 28 | - (IBAction)newDocument:(id)sender { |
[email protected] | 3560b57 | 2012-04-04 20:47:32 | [diff] [blame] | 29 | content::ShellBrowserContext* browserContext = |
[email protected] | eabbfb1 | 2013-04-05 23:28:35 | [diff] [blame] | 30 | content::ShellContentBrowserClient::Get()->browser_context(); |
[email protected] | 3560b57 | 2012-04-04 20:47:32 | [diff] [blame] | 31 | content::Shell::CreateNewWindow(browserContext, |
[email protected] | f3474bb5 | 2012-04-02 16:32:36 | [diff] [blame] | 32 | GURL("about:blank"), |
33 | NULL, | ||||
34 | MSG_ROUTING_NONE, | ||||
[email protected] | cdb80672 | 2013-01-10 14:18:23 | [diff] [blame] | 35 | gfx::Size()); |
[email protected] | f3474bb5 | 2012-04-02 16:32:36 | [diff] [blame] | 36 | } |
37 | |||||
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 38 | @end |