[email protected] | de7d61ff | 2013-08-20 11:30:41 | [diff] [blame^] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | de7d61ff | 2013-08-20 11:30:41 | [diff] [blame^] | 5 | #include "content/shell/browser/shell_application_mac.h" |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 6 | |
[email protected] | a670807 | 2012-03-27 14:10:45 | [diff] [blame] | 7 | #include "base/auto_reset.h" |
[email protected] | 685c8af | 2013-08-06 03:10:15 | [diff] [blame] | 8 | #include "content/public/common/url_constants.h" |
[email protected] | de7d61ff | 2013-08-20 11:30:41 | [diff] [blame^] | 9 | #include "content/shell/browser/shell.h" |
10 | #include "content/shell/browser/shell_browser_context.h" | ||||
11 | #include "content/shell/browser/shell_content_browser_client.h" | ||||
[email protected] | 707e1c4 | 2013-07-09 21:18:58 | [diff] [blame] | 12 | #include "url/gurl.h" |
[email protected] | a670807 | 2012-03-27 14:10:45 | [diff] [blame] | 13 | |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 14 | @implementation ShellCrApplication |
15 | |||||
16 | - (BOOL)isHandlingSendEvent { | ||||
17 | return handlingSendEvent_; | ||||
18 | } | ||||
19 | |||||
20 | - (void)sendEvent:(NSEvent*)event { | ||||
[email protected] | 997ec9f | 2012-11-21 04:44:14 | [diff] [blame] | 21 | base::AutoReset<BOOL> scoper(&handlingSendEvent_, YES); |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 22 | [super sendEvent:event]; |
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 23 | } |
24 | |||||
25 | - (void)setHandlingSendEvent:(BOOL)handlingSendEvent { | ||||
26 | handlingSendEvent_ = handlingSendEvent; | ||||
27 | } | ||||
28 | |||||
[email protected] | f3474bb5 | 2012-04-02 16:32:36 | [diff] [blame] | 29 | - (IBAction)newDocument:(id)sender { |
[email protected] | 3560b57 | 2012-04-04 20:47:32 | [diff] [blame] | 30 | content::ShellBrowserContext* browserContext = |
[email protected] | eabbfb1 | 2013-04-05 23:28:35 | [diff] [blame] | 31 | content::ShellContentBrowserClient::Get()->browser_context(); |
[email protected] | 3560b57 | 2012-04-04 20:47:32 | [diff] [blame] | 32 | content::Shell::CreateNewWindow(browserContext, |
[email protected] | 685c8af | 2013-08-06 03:10:15 | [diff] [blame] | 33 | GURL(content::kAboutBlankURL), |
[email protected] | f3474bb5 | 2012-04-02 16:32:36 | [diff] [blame] | 34 | NULL, |
35 | MSG_ROUTING_NONE, | ||||
[email protected] | cdb80672 | 2013-01-10 14:18:23 | [diff] [blame] | 36 | gfx::Size()); |
[email protected] | f3474bb5 | 2012-04-02 16:32:36 | [diff] [blame] | 37 | } |
38 | |||||
[email protected] | c4e78d7 | 2012-03-24 22:55:41 | [diff] [blame] | 39 | @end |