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 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_NATIVE_APP_WINDOW_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_NATIVE_APP_WINDOW_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_NATIVE_APP_WINDOW_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_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 "apps/shell_window.h" |
11 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #import "chrome/browser/ui/cocoa/browser_command_executor.h" | 14 #import "chrome/browser/ui/cocoa/browser_command_executor.h" |
14 #include "chrome/browser/ui/extensions/native_app_window.h" | 15 #include "chrome/browser/ui/extensions/native_app_window.h" |
15 #include "chrome/browser/ui/extensions/shell_window.h" | |
16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
17 #include "extensions/common/draggable_region.h" | 17 #include "extensions/common/draggable_region.h" |
18 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
19 | 19 |
20 class ExtensionKeybindingRegistryCocoa; | 20 class ExtensionKeybindingRegistryCocoa; |
21 class Profile; | 21 class Profile; |
22 class NativeAppWindowCocoa; | 22 class NativeAppWindowCocoa; |
23 @class ShellNSWindow; | 23 @class ShellNSWindow; |
24 class SkRegion; | 24 class SkRegion; |
25 | 25 |
(...skipping 10 matching lines...) Expand all Loading... |
36 | 36 |
37 // Consults the Command Registry to see if this |event| needs to be handled as | 37 // Consults the Command Registry to see if this |event| needs to be handled as |
38 // an extension command and returns YES if so (NO otherwise). | 38 // an extension command and returns YES if so (NO otherwise). |
39 - (BOOL)handledByExtensionCommand:(NSEvent*)event; | 39 - (BOOL)handledByExtensionCommand:(NSEvent*)event; |
40 | 40 |
41 @end | 41 @end |
42 | 42 |
43 // Cocoa bridge to AppWindow. | 43 // Cocoa bridge to AppWindow. |
44 class NativeAppWindowCocoa : public NativeAppWindow { | 44 class NativeAppWindowCocoa : public NativeAppWindow { |
45 public: | 45 public: |
46 NativeAppWindowCocoa(ShellWindow* shell_window, | 46 NativeAppWindowCocoa(apps::ShellWindow* shell_window, |
47 const ShellWindow::CreateParams& params); | 47 const apps::ShellWindow::CreateParams& params); |
48 | 48 |
49 // ui::BaseWindow implementation. | 49 // ui::BaseWindow implementation. |
50 virtual bool IsActive() const OVERRIDE; | 50 virtual bool IsActive() const OVERRIDE; |
51 virtual bool IsMaximized() const OVERRIDE; | 51 virtual bool IsMaximized() const OVERRIDE; |
52 virtual bool IsMinimized() const OVERRIDE; | 52 virtual bool IsMinimized() const OVERRIDE; |
53 virtual bool IsFullscreen() const OVERRIDE; | 53 virtual bool IsFullscreen() const OVERRIDE; |
54 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; | 54 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; |
55 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 55 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; |
56 virtual ui::WindowShowState GetRestoredState() const OVERRIDE; | 56 virtual ui::WindowShowState GetRestoredState() const OVERRIDE; |
57 virtual gfx::Rect GetBounds() const OVERRIDE; | 57 virtual gfx::Rect GetBounds() const OVERRIDE; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 void InstallView(); | 141 void InstallView(); |
142 void UninstallView(); | 142 void UninstallView(); |
143 void InstallDraggableRegionViews(); | 143 void InstallDraggableRegionViews(); |
144 void UpdateDraggableRegionsForSystemDrag( | 144 void UpdateDraggableRegionsForSystemDrag( |
145 const std::vector<extensions::DraggableRegion>& regions, | 145 const std::vector<extensions::DraggableRegion>& regions, |
146 const extensions::DraggableRegion* draggable_area); | 146 const extensions::DraggableRegion* draggable_area); |
147 void UpdateDraggableRegionsForCustomDrag( | 147 void UpdateDraggableRegionsForCustomDrag( |
148 const std::vector<extensions::DraggableRegion>& regions); | 148 const std::vector<extensions::DraggableRegion>& regions); |
149 | 149 |
150 ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow. | 150 apps::ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow. |
151 | 151 |
152 bool has_frame_; | 152 bool has_frame_; |
153 | 153 |
154 bool is_maximized_; | 154 bool is_maximized_; |
155 bool is_fullscreen_; | 155 bool is_fullscreen_; |
156 NSRect restored_bounds_; | 156 NSRect restored_bounds_; |
157 | 157 |
158 gfx::Size min_size_; | 158 gfx::Size min_size_; |
159 gfx::Size max_size_; | 159 gfx::Size max_size_; |
160 bool resizable_; | 160 bool resizable_; |
(...skipping 18 matching lines...) Expand all Loading... |
179 NSPoint last_mouse_location_; | 179 NSPoint last_mouse_location_; |
180 | 180 |
181 // The Extension Command Registry used to determine which keyboard events to | 181 // The Extension Command Registry used to determine which keyboard events to |
182 // handle. | 182 // handle. |
183 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; | 183 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; |
184 | 184 |
185 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa); | 185 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa); |
186 }; | 186 }; |
187 | 187 |
188 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_NATIVE_APP_WINDOW_COCOA_H_ | 188 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_NATIVE_APP_WINDOW_COCOA_H_ |
OLD | NEW |