blob: 0ccce071f9f9bd45bf8fac003713536671e1717b [file] [log] [blame]
[email protected]c4e78d72012-03-24 22:55:411// 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]a6708072012-03-27 14:10:457#include "base/auto_reset.h"
[email protected]f3474bb52012-04-02 16:32:368#include "content/shell/shell.h"
9#include "content/shell/shell_browser_context.h"
[email protected]3560b572012-04-04 20:47:3210#include "content/shell/shell_content_browser_client.h"
[email protected]f3474bb52012-04-02 16:32:3611#include "googleurl/src/gurl.h"
[email protected]a6708072012-03-27 14:10:4512
[email protected]c4e78d72012-03-24 22:55:4113@implementation ShellCrApplication
14
15- (BOOL)isHandlingSendEvent {
16 return handlingSendEvent_;
17}
18
19- (void)sendEvent:(NSEvent*)event {
[email protected]a6708072012-03-27 14:10:4520 AutoReset<BOOL> scoper(&handlingSendEvent_, YES);
[email protected]c4e78d72012-03-24 22:55:4121 [super sendEvent:event];
[email protected]c4e78d72012-03-24 22:55:4122}
23
24- (void)setHandlingSendEvent:(BOOL)handlingSendEvent {
25 handlingSendEvent_ = handlingSendEvent;
26}
27
[email protected]f3474bb52012-04-02 16:32:3628- (IBAction)newDocument:(id)sender {
[email protected]3560b572012-04-04 20:47:3229 content::ShellBrowserContext* browserContext =
30 static_cast<content::ShellContentBrowserClient*>(
31 content::GetContentClient()->browser())->browser_context();
32 content::Shell::CreateNewWindow(browserContext,
[email protected]f3474bb52012-04-02 16:32:3633 GURL("about:blank"),
34 NULL,
35 MSG_ROUTING_NONE,
36 NULL);
37}
38
[email protected]c4e78d72012-03-24 22:55:4139@end