| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/mac/scoped_nsobject.h" | 11 #include "base/mac/scoped_nsobject.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #import "chrome/browser/ui/cocoa/browser_command_executor.h" | |
| 14 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
| 15 #include "extensions/browser/app_window/app_window.h" | 14 #include "extensions/browser/app_window/app_window.h" |
| 16 #include "extensions/browser/app_window/native_app_window.h" | 15 #include "extensions/browser/app_window/native_app_window.h" |
| 17 #include "extensions/browser/app_window/size_constraints.h" | 16 #include "extensions/browser/app_window/size_constraints.h" |
| 18 #include "extensions/common/draggable_region.h" | 17 #include "extensions/common/draggable_region.h" |
| 19 #include "ui/base/accelerators/accelerator_manager.h" | 18 #include "ui/base/accelerators/accelerator_manager.h" |
| 20 #include "ui/gfx/geometry/rect.h" | 19 #include "ui/gfx/geometry/rect.h" |
| 21 | 20 |
| 22 @class AppNSWindow; | 21 @class AppNSWindow; |
| 23 class ExtensionKeybindingRegistryCocoa; | 22 class ExtensionKeybindingRegistryCocoa; |
| 24 class NativeAppWindowCocoa; | 23 class NativeAppWindowCocoa; |
| 25 class SkRegion; | 24 class SkRegion; |
| 26 | 25 |
| 27 // A window controller for a minimal window to host a web app view. Passes | 26 // A window controller for a minimal window to host a web app view. Passes |
| 28 // Objective-C notifications to the C++ bridge. | 27 // Objective-C notifications to the C++ bridge. |
| 29 @interface NativeAppWindowController : NSWindowController | 28 @interface NativeAppWindowController : NSWindowController<NSWindowDelegate> { |
| 30 <NSWindowDelegate, | |
| 31 BrowserCommandExecutor> { | |
| 32 @private | 29 @private |
| 33 NativeAppWindowCocoa* appWindow_; // Weak; owns self. | 30 NativeAppWindowCocoa* appWindow_; // Weak; owns self. |
| 34 } | 31 } |
| 35 | 32 |
| 36 @property(assign, nonatomic) NativeAppWindowCocoa* appWindow; | 33 @property(assign, nonatomic) NativeAppWindowCocoa* appWindow; |
| 37 | 34 |
| 38 // Consults the Command Registry to see if this |event| needs to be handled as | 35 // Consults the Command Registry to see if this |event| needs to be handled as |
| 39 // an extension command and returns YES if so (NO otherwise). | 36 // an extension command and returns YES if so (NO otherwise). |
| 40 // Only extensions with the given |priority| are considered. | 37 // Only extensions with the given |priority| are considered. |
| 41 - (BOOL)handledByExtensionCommand:(NSEvent*)event | 38 - (BOOL)handledByExtensionCommand:(NSEvent*)event |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // handle. | 211 // handle. |
| 215 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; | 212 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; |
| 216 | 213 |
| 217 // Tracks the last time the extension asked the window to activate. | 214 // Tracks the last time the extension asked the window to activate. |
| 218 base::Time last_activate_; | 215 base::Time last_activate_; |
| 219 | 216 |
| 220 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa); | 217 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa); |
| 221 }; | 218 }; |
| 222 | 219 |
| 223 #endif // CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ | 220 #endif // CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ |
| OLD | NEW |