Chromium Code Reviews| 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" | |
|
tapted
2014/12/17 08:05:16
nit: import
Yoyo Zhou
2014/12/18 02:38:33
This is also only ever #included, not #imported.
tapted
2014/12/18 03:30:55
scoped_nsobject.h is objective C-only (it won't co
Yoyo Zhou
2014/12/18 22:42:07
Yeah, I miscounted and there are some #imports. As
| |
| 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 | |
|
tapted
2014/12/17 08:05:16
nit: a short comment? (just to satisfy the objc st
Yoyo Zhou
2014/12/18 02:38:34
Done.
| |
| 20 : NSWindowController<NSWindowDelegate> { | |
| 21 extensions::ShellNativeAppWindowMac* appWindow_; // Owns us. | |
|
tapted
2014/12/17 08:05:16
@private
before this
Yoyo Zhou
2014/12/18 02:38:34
Done.
| |
| 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 |