Refactor management of overview window copy lifetime into a separate class.
[chromium-blink-merge.git] / content / shell / browser / shell_application_mac.mm
blobe18df5b67cf389f3c54894794e0f4ddeec4caa12
1 // Copyright 2013 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.
5 #include "content/shell/browser/shell_application_mac.h"
7 #include "base/auto_reset.h"
8 #include "content/public/common/url_constants.h"
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"
12 #include "url/gurl.h"
14 @implementation ShellCrApplication
16 - (BOOL)isHandlingSendEvent {
17   return handlingSendEvent_;
20 - (void)sendEvent:(NSEvent*)event {
21   base::AutoReset<BOOL> scoper(&handlingSendEvent_, YES);
22   [super sendEvent:event];
25 - (void)setHandlingSendEvent:(BOOL)handlingSendEvent {
26   handlingSendEvent_ = handlingSendEvent;
29 - (IBAction)newDocument:(id)sender {
30   content::ShellBrowserContext* browserContext =
31       content::ShellContentBrowserClient::Get()->browser_context();
32   content::Shell::CreateNewWindow(browserContext,
33                                   GURL(content::kAboutBlankURL),
34                                   NULL,
35                                   MSG_ROUTING_NONE,
36                                   gfx::Size());
39 @end