OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_NATIVE_APP_WINDOW_MAC_H_ |
| 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_NATIVE_APP_WINDOW_MAC_H_ |
| 7 |
| 8 #import <Cocoa/Cocoa.h> |
| 9 |
| 10 #include "base/mac/scoped_nsobject.h" |
| 11 #include "extensions/shell/browser/shell_native_app_window.h" |
| 12 |
| 13 @class ShellNSWindow; |
| 14 |
| 15 namespace extensions { |
| 16 class ShellNativeAppWindowMac; |
| 17 } |
| 18 |
| 19 @interface ShellNativeAppWindowController |
| 20 : NSWindowController<NSWindowDelegate> { |
| 21 extensions::ShellNativeAppWindowMac* appWindow_; // Owns us. |
| 22 } |
| 23 |
| 24 @property(assign, nonatomic) extensions::ShellNativeAppWindowMac* appWindow; |
| 25 |
| 26 @end |
| 27 |
| 28 namespace extensions { |
| 29 |
| 30 // A minimal implementation of ShellNativeAppWindow for Mac Cocoa. |
| 31 // Based on the NativeAppWindowCocoa implementation. |
| 32 class ShellNativeAppWindowMac : public ShellNativeAppWindow { |
| 33 public: |
| 34 ShellNativeAppWindowMac(extensions::AppWindow* app_window, |
| 35 const extensions::AppWindow::CreateParams& params); |
| 36 ~ShellNativeAppWindowMac() override; |
| 37 |
| 38 // ui::BaseWindow: |
| 39 bool IsActive() const override; |
| 40 gfx::NativeWindow GetNativeWindow() const override; |
| 41 gfx::Rect GetBounds() const override; |
| 42 void Show() override; |
| 43 void Hide() override; |
| 44 void Activate() override; |
| 45 void Deactivate() override; |
| 46 void SetBounds(const gfx::Rect& bounds) override; |
| 47 |
| 48 // Called when the window is about to close. |
| 49 void WindowWillClose(); |
| 50 |
| 51 private: |
| 52 ShellNSWindow* window() const; |
| 53 |
| 54 base::scoped_nsobject<ShellNativeAppWindowController> window_controller_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(ShellNativeAppWindowMac); |
| 57 }; |
| 58 |
| 59 } // namespace extensions |
| 60 |
| 61 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_NATIVE_APP_WINDOW_MAC_H_ |
OLD | NEW |