| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 #import "base/mac/cocoa_protocols.h" | 11 #import "base/mac/cocoa_protocols.h" |
| 12 #include "base/memory/scoped_nsobject.h" | 12 #include "base/memory/scoped_nsobject.h" |
| 13 #include "chrome/browser/ui/extensions/shell_window.h" | 13 #include "chrome/browser/ui/extensions/shell_window.h" |
| 14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
| 15 | 15 |
| 16 class ExtensionHost; | 16 class Profile; |
| 17 class ShellWindowCocoa; | 17 class ShellWindowCocoa; |
| 18 | 18 |
| 19 // A window controller for a minimal window to host a web app view. Passes | 19 // A window controller for a minimal window to host a web app view. Passes |
| 20 // Objective-C notifications to the C++ bridge. | 20 // Objective-C notifications to the C++ bridge. |
| 21 @interface ShellWindowController : NSWindowController<NSWindowDelegate> { | 21 @interface ShellWindowController : NSWindowController<NSWindowDelegate> { |
| 22 @private | 22 @private |
| 23 ShellWindowCocoa* shellWindow_; // Weak; owns self. | 23 ShellWindowCocoa* shellWindow_; // Weak; owns self. |
| 24 } | 24 } |
| 25 | 25 |
| 26 @property(assign, nonatomic) ShellWindowCocoa* shellWindow; | 26 @property(assign, nonatomic) ShellWindowCocoa* shellWindow; |
| 27 | 27 |
| 28 @end | 28 @end |
| 29 | 29 |
| 30 // Cocoa bridge to ShellWindow. | 30 // Cocoa bridge to ShellWindow. |
| 31 class ShellWindowCocoa : public ShellWindow { | 31 class ShellWindowCocoa : public ShellWindow { |
| 32 public: | 32 public: |
| 33 explicit ShellWindowCocoa(ExtensionHost* host); | 33 ShellWindowCocoa(Profile* profile, |
| 34 const Extension* extension, |
| 35 const GURL& url); |
| 34 | 36 |
| 35 // BaseWindow implementation. | 37 // BaseWindow implementation. |
| 36 virtual bool IsActive() const OVERRIDE; | 38 virtual bool IsActive() const OVERRIDE; |
| 37 virtual bool IsMaximized() const OVERRIDE; | 39 virtual bool IsMaximized() const OVERRIDE; |
| 38 virtual bool IsMinimized() const OVERRIDE; | 40 virtual bool IsMinimized() const OVERRIDE; |
| 39 virtual bool IsFullscreen() const OVERRIDE; | 41 virtual bool IsFullscreen() const OVERRIDE; |
| 40 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 42 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; |
| 41 virtual gfx::Rect GetBounds() const OVERRIDE; | 43 virtual gfx::Rect GetBounds() const OVERRIDE; |
| 42 virtual void Show() OVERRIDE; | 44 virtual void Show() OVERRIDE; |
| 43 virtual void ShowInactive() OVERRIDE; | 45 virtual void ShowInactive() OVERRIDE; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 60 | 62 |
| 61 NSWindow* window() const; | 63 NSWindow* window() const; |
| 62 | 64 |
| 63 scoped_nsobject<ShellWindowController> window_controller_; | 65 scoped_nsobject<ShellWindowController> window_controller_; |
| 64 NSInteger attention_request_id_; // identifier from requestUserAttention | 66 NSInteger attention_request_id_; // identifier from requestUserAttention |
| 65 | 67 |
| 66 DISALLOW_COPY_AND_ASSIGN(ShellWindowCocoa); | 68 DISALLOW_COPY_AND_ASSIGN(ShellWindowCocoa); |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_SHELL_WINDOW_COCOA_H_ | 71 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_SHELL_WINDOW_COCOA_H_ |
| OLD | NEW |