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_SHELL_WINDOW_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_SHELL_WINDOW_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_SHELL_WINDOW_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_SHELL_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/memory/scoped_nsobject.h" | 11 #include "base/memory/scoped_nsobject.h" |
| 12 #include "chrome/browser/ui/cocoa/constrained_window_mac.h" |
12 #include "chrome/browser/ui/extensions/shell_window.h" | 13 #include "chrome/browser/ui/extensions/shell_window.h" |
13 #include "chrome/common/extensions/draggable_region.h" | 14 #include "chrome/common/extensions/draggable_region.h" |
14 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
| 16 #import "third_party/GTM/AppKit/GTMWindowSheetController.h" |
15 | 17 |
16 class Profile; | 18 class Profile; |
17 class ShellWindowCocoa; | 19 class ShellWindowCocoa; |
18 | 20 |
19 // A window controller for a minimal window to host a web app view. Passes | 21 // A window controller for a minimal window to host a web app view. Passes |
20 // Objective-C notifications to the C++ bridge. | 22 // Objective-C notifications to the C++ bridge. |
21 @interface ShellWindowController : NSWindowController<NSWindowDelegate> { | 23 @interface ShellWindowController : NSWindowController |
| 24 <NSWindowDelegate, |
| 25 GTMWindowSheetControllerDelegate, |
| 26 ConstrainedWindowSupport> { |
22 @private | 27 @private |
23 ShellWindowCocoa* shellWindow_; // Weak; owns self. | 28 ShellWindowCocoa* shellWindow_; // Weak; owns self. |
| 29 // Manages per-window sheets. |
| 30 scoped_nsobject<GTMWindowSheetController> sheetController_; |
24 } | 31 } |
25 | 32 |
26 @property(assign, nonatomic) ShellWindowCocoa* shellWindow; | 33 @property(assign, nonatomic) ShellWindowCocoa* shellWindow; |
27 | 34 |
28 @end | 35 @end |
29 | 36 |
30 // Cocoa bridge to ShellWindow. | 37 // Cocoa bridge to ShellWindow. |
31 class ShellWindowCocoa : public ShellWindow { | 38 class ShellWindowCocoa : public ShellWindow { |
32 public: | 39 public: |
33 ShellWindowCocoa(Profile* profile, | 40 ShellWindowCocoa(Profile* profile, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 96 |
90 scoped_nsobject<ShellWindowController> window_controller_; | 97 scoped_nsobject<ShellWindowController> window_controller_; |
91 NSInteger attention_request_id_; // identifier from requestUserAttention | 98 NSInteger attention_request_id_; // identifier from requestUserAttention |
92 | 99 |
93 std::vector<extensions::DraggableRegion> draggable_regions_; | 100 std::vector<extensions::DraggableRegion> draggable_regions_; |
94 | 101 |
95 DISALLOW_COPY_AND_ASSIGN(ShellWindowCocoa); | 102 DISALLOW_COPY_AND_ASSIGN(ShellWindowCocoa); |
96 }; | 103 }; |
97 | 104 |
98 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_SHELL_WINDOW_COCOA_H_ | 105 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_SHELL_WINDOW_COCOA_H_ |
OLD | NEW |