| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_MAC_H_ | 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_MAC_H_ |
| 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_MAC_H_ | 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_MAC_H_ |
| 7 | 7 |
| 8 #include "extensions/shell/browser/desktop_controller.h" | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "extensions/shell/browser/desktop_controller.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 class AppWindow; | 15 class AppWindow; |
| 16 class AppWindowClient; | 16 class AppWindowClient; |
| 17 | 17 |
| 18 // A simple implementation of the app_shell DesktopController for Mac Cocoa. | 18 // A simple implementation of the app_shell DesktopController for Mac Cocoa. |
| 19 // Only currently supports one app window (unlike Aura). | 19 // Only currently supports one app window (unlike Aura). |
| 20 class ShellDesktopControllerMac : public DesktopController { | 20 class ShellDesktopControllerMac : public DesktopController { |
| 21 public: | 21 public: |
| 22 ShellDesktopControllerMac(); | 22 ShellDesktopControllerMac(); |
| 23 ~ShellDesktopControllerMac() override; | 23 ~ShellDesktopControllerMac() override; |
| 24 | 24 |
| 25 // DesktopController: | 25 // DesktopController: |
| 26 gfx::Size GetWindowSize() override; | 26 gfx::Size GetWindowSize() override; |
| 27 AppWindow* CreateAppWindow(content::BrowserContext* context, | 27 AppWindow* CreateAppWindow(content::BrowserContext* context, |
| 28 const Extension* extension) override; | 28 const Extension* extension) override; |
| 29 void AddAppWindow(gfx::NativeWindow window) override; | 29 void AddAppWindow(gfx::NativeWindow window) override; |
| 30 void RemoveAppWindow(AppWindow* window) override; | 30 void RemoveAppWindow(AppWindow* window) override; |
| 31 void CloseAppWindows() override; | 31 void CloseAppWindows() override; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 scoped_ptr<AppWindowClient> app_window_client_; | 34 std::unique_ptr<AppWindowClient> app_window_client_; |
| 35 | 35 |
| 36 // The desktop only supports a single app window. | 36 // The desktop only supports a single app window. |
| 37 // TODO(yoz): Support multiple app windows, as we do in Aura. | 37 // TODO(yoz): Support multiple app windows, as we do in Aura. |
| 38 AppWindow* app_window_; // NativeAppWindow::Close() deletes this. | 38 AppWindow* app_window_; // NativeAppWindow::Close() deletes this. |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(ShellDesktopControllerMac); | 40 DISALLOW_COPY_AND_ASSIGN(ShellDesktopControllerMac); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace extensions | 43 } // namespace extensions |
| 44 | 44 |
| 45 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_MAC_H_ | 45 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_DESKTOP_CONTROLLER_MAC_H_ |
| OLD | NEW |