Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / extensions / shell / browser / shell_native_app_window_mac.h
blob0f989231d10b72140a4ebce6cbda861b729913a9
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.
5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_NATIVE_APP_WINDOW_MAC_H_
6 #define EXTENSIONS_SHELL_BROWSER_SHELL_NATIVE_APP_WINDOW_MAC_H_
8 #import <Cocoa/Cocoa.h>
10 #import "base/mac/scoped_nsobject.h"
11 #include "extensions/shell/browser/shell_native_app_window.h"
13 @class ShellNSWindow;
15 namespace extensions {
16 class ShellNativeAppWindowMac;
19 // A window controller for ShellNativeAppWindowMac to handle NSNotifications
20 // and pass them to the C++ implementation.
21 @interface ShellNativeAppWindowController
22 : NSWindowController<NSWindowDelegate> {
23 @private
24 extensions::ShellNativeAppWindowMac* appWindow_; // Owns us.
27 @property(assign, nonatomic) extensions::ShellNativeAppWindowMac* appWindow;
29 @end
31 namespace extensions {
33 // A minimal implementation of ShellNativeAppWindow for Mac Cocoa.
34 // Based on the NativeAppWindowCocoa implementation.
35 class ShellNativeAppWindowMac : public ShellNativeAppWindow {
36 public:
37 ShellNativeAppWindowMac(extensions::AppWindow* app_window,
38 const extensions::AppWindow::CreateParams& params);
39 ~ShellNativeAppWindowMac() override;
41 // ui::BaseWindow:
42 bool IsActive() const override;
43 gfx::NativeWindow GetNativeWindow() const override;
44 gfx::Rect GetBounds() const override;
45 void Show() override;
46 void Hide() override;
47 void Activate() override;
48 void Deactivate() override;
49 void SetBounds(const gfx::Rect& bounds) override;
51 // Called when the window is about to close.
52 void WindowWillClose();
54 private:
55 ShellNSWindow* window() const;
57 base::scoped_nsobject<ShellNativeAppWindowController> window_controller_;
59 DISALLOW_COPY_AND_ASSIGN(ShellNativeAppWindowMac);
62 } // namespace extensions
64 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_NATIVE_APP_WINDOW_MAC_H_