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" | 13 #import "chrome/browser/ui/cocoa/browser_command_executor.h" |
14 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
15 #include "extensions/browser/app_window/app_window.h" | 15 #include "extensions/browser/app_window/app_window.h" |
16 #include "extensions/browser/app_window/native_app_window.h" | 16 #include "extensions/browser/app_window/native_app_window.h" |
17 #include "extensions/browser/app_window/size_constraints.h" | 17 #include "extensions/browser/app_window/size_constraints.h" |
18 #include "extensions/common/draggable_region.h" | 18 #include "extensions/common/draggable_region.h" |
19 #include "ui/base/accelerators/accelerator_manager.h" | 19 #include "ui/base/accelerators/accelerator_manager.h" |
20 #include "ui/gfx/geometry/rect.h" | 20 #include "ui/gfx/geometry/rect.h" |
21 | 21 |
22 class ExtensionKeybindingRegistryCocoa; | 22 class ExtensionKeybindingRegistryCocoa; |
23 class NativeAppWindowCocoa; | 23 class NativeAppWindowCocoa; |
24 @class ShellNSWindow; | 24 @class AppNSWindow; |
tapted
2015/02/25 06:06:33
nit: sort
jackhou1
2015/02/25 06:10:40
Done.
| |
25 class SkRegion; | 25 class SkRegion; |
26 @class TitlebarBackgroundView; | 26 @class TitlebarBackgroundView; |
27 | 27 |
28 // A window controller for a minimal window to host a web app view. Passes | 28 // A window controller for a minimal window to host a web app view. Passes |
29 // Objective-C notifications to the C++ bridge. | 29 // Objective-C notifications to the C++ bridge. |
30 @interface NativeAppWindowController : NSWindowController | 30 @interface NativeAppWindowController : NSWindowController |
31 <NSWindowDelegate, | 31 <NSWindowDelegate, |
32 BrowserCommandExecutor> { | 32 BrowserCommandExecutor> { |
33 @private | 33 @private |
34 NativeAppWindowCocoa* appWindow_; // Weak; owns self. | 34 NativeAppWindowCocoa* appWindow_; // Weak; owns self. |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
160 // WebContentsModalDialogHost implementation. | 160 // WebContentsModalDialogHost implementation. |
161 gfx::NativeView GetHostView() const override; | 161 gfx::NativeView GetHostView() const override; |
162 gfx::Point GetDialogPosition(const gfx::Size& size) override; | 162 gfx::Point GetDialogPosition(const gfx::Size& size) override; |
163 gfx::Size GetMaximumDialogSize() override; | 163 gfx::Size GetMaximumDialogSize() override; |
164 void AddObserver(web_modal::ModalDialogHostObserver* observer) override; | 164 void AddObserver(web_modal::ModalDialogHostObserver* observer) override; |
165 void RemoveObserver(web_modal::ModalDialogHostObserver* observer) override; | 165 void RemoveObserver(web_modal::ModalDialogHostObserver* observer) override; |
166 | 166 |
167 private: | 167 private: |
168 ~NativeAppWindowCocoa() override; | 168 ~NativeAppWindowCocoa() override; |
169 | 169 |
170 ShellNSWindow* window() const; | 170 AppNSWindow* window() const; |
171 content::WebContents* WebContents() const; | 171 content::WebContents* WebContents() const; |
172 | 172 |
173 // Returns the WindowStyleMask based on the type of window frame. | 173 // Returns the WindowStyleMask based on the type of window frame. |
174 // This includes NSResizableWindowMask if the window is resizable. | 174 // This includes NSResizableWindowMask if the window is resizable. |
175 NSUInteger GetWindowStyleMask() const; | 175 NSUInteger GetWindowStyleMask() const; |
176 | 176 |
177 void InstallView(); | 177 void InstallView(); |
178 void UninstallView(); | 178 void UninstallView(); |
179 void UpdateDraggableRegionViews(); | 179 void UpdateDraggableRegionViews(); |
180 | 180 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
214 std::vector<extensions::DraggableRegion> draggable_regions_; | 214 std::vector<extensions::DraggableRegion> draggable_regions_; |
215 | 215 |
216 // The Extension Command Registry used to determine which keyboard events to | 216 // The Extension Command Registry used to determine which keyboard events to |
217 // handle. | 217 // handle. |
218 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; | 218 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; |
219 | 219 |
220 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa); | 220 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa); |
221 }; | 221 }; |
222 | 222 |
223 #endif // CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ | 223 #endif // CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ |
OLD | NEW |