| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "content/shell/shell_application_mac.h" | 5 #include "content/shell/shell_application_mac.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "content/shell/shell.h" | 8 #include "content/shell/shell.h" |
| 9 #include "content/shell/shell_browser_context.h" | 9 #include "content/shell/shell_browser_context.h" |
| 10 #include "content/shell/shell_content_browser_client.h" |
| 10 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 11 | 12 |
| 12 @implementation ShellCrApplication | 13 @implementation ShellCrApplication |
| 13 | 14 |
| 14 - (BOOL)isHandlingSendEvent { | 15 - (BOOL)isHandlingSendEvent { |
| 15 return handlingSendEvent_; | 16 return handlingSendEvent_; |
| 16 } | 17 } |
| 17 | 18 |
| 18 - (void)sendEvent:(NSEvent*)event { | 19 - (void)sendEvent:(NSEvent*)event { |
| 19 AutoReset<BOOL> scoper(&handlingSendEvent_, YES); | 20 AutoReset<BOOL> scoper(&handlingSendEvent_, YES); |
| 20 [super sendEvent:event]; | 21 [super sendEvent:event]; |
| 21 } | 22 } |
| 22 | 23 |
| 23 - (void)setHandlingSendEvent:(BOOL)handlingSendEvent { | 24 - (void)setHandlingSendEvent:(BOOL)handlingSendEvent { |
| 24 handlingSendEvent_ = handlingSendEvent; | 25 handlingSendEvent_ = handlingSendEvent; |
| 25 } | 26 } |
| 26 | 27 |
| 27 - (IBAction)newDocument:(id)sender { | 28 - (IBAction)newDocument:(id)sender { |
| 28 content::Shell::CreateNewWindow(content::ShellBrowserContext::GetInstance(), | 29 content::ShellBrowserContext* browserContext = |
| 30 static_cast<content::ShellContentBrowserClient*>( |
| 31 content::GetContentClient()->browser())->browser_context(); |
| 32 content::Shell::CreateNewWindow(browserContext, |
| 29 GURL("about:blank"), | 33 GURL("about:blank"), |
| 30 NULL, | 34 NULL, |
| 31 MSG_ROUTING_NONE, | 35 MSG_ROUTING_NONE, |
| 32 NULL); | 36 NULL); |
| 33 } | 37 } |
| 34 | 38 |
| 35 @end | 39 @end |
| OLD | NEW |