| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_APPS_NATIVE_APP_WINDOW_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "apps/ui/native_app_window.h" | 11 #include "apps/app_window.h" |
| 12 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #import "chrome/browser/ui/cocoa/browser_command_executor.h" | 14 #import "chrome/browser/ui/cocoa/browser_command_executor.h" |
| 15 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 16 #include "extensions/browser/app_window/native_app_window.h" |
| 16 #include "extensions/browser/app_window/size_constraints.h" | 17 #include "extensions/browser/app_window/size_constraints.h" |
| 17 #include "extensions/common/draggable_region.h" | 18 #include "extensions/common/draggable_region.h" |
| 18 #include "ui/base/accelerators/accelerator_manager.h" | 19 #include "ui/base/accelerators/accelerator_manager.h" |
| 19 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
| 20 | 21 |
| 21 namespace apps { | 22 namespace apps { |
| 22 class AppWindow; | 23 class AppWindow; |
| 23 } | 24 } |
| 24 | 25 |
| 25 class ExtensionKeybindingRegistryCocoa; | 26 class ExtensionKeybindingRegistryCocoa; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 40 | 41 |
| 41 // Consults the Command Registry to see if this |event| needs to be handled as | 42 // Consults the Command Registry to see if this |event| needs to be handled as |
| 42 // an extension command and returns YES if so (NO otherwise). | 43 // an extension command and returns YES if so (NO otherwise). |
| 43 // Only extensions with the given |priority| are considered. | 44 // Only extensions with the given |priority| are considered. |
| 44 - (BOOL)handledByExtensionCommand:(NSEvent*)event | 45 - (BOOL)handledByExtensionCommand:(NSEvent*)event |
| 45 priority:(ui::AcceleratorManager::HandlerPriority)priority; | 46 priority:(ui::AcceleratorManager::HandlerPriority)priority; |
| 46 | 47 |
| 47 @end | 48 @end |
| 48 | 49 |
| 49 // Cocoa bridge to AppWindow. | 50 // Cocoa bridge to AppWindow. |
| 50 class NativeAppWindowCocoa : public apps::NativeAppWindow, | 51 class NativeAppWindowCocoa : public extensions::NativeAppWindow, |
| 51 public content::WebContentsObserver { | 52 public content::WebContentsObserver { |
| 52 public: | 53 public: |
| 53 NativeAppWindowCocoa(apps::AppWindow* app_window, | 54 NativeAppWindowCocoa(apps::AppWindow* app_window, |
| 54 const apps::AppWindow::CreateParams& params); | 55 const apps::AppWindow::CreateParams& params); |
| 55 | 56 |
| 56 // ui::BaseWindow implementation. | 57 // ui::BaseWindow implementation. |
| 57 virtual bool IsActive() const OVERRIDE; | 58 virtual bool IsActive() const OVERRIDE; |
| 58 virtual bool IsMaximized() const OVERRIDE; | 59 virtual bool IsMaximized() const OVERRIDE; |
| 59 virtual bool IsMinimized() const OVERRIDE; | 60 virtual bool IsMinimized() const OVERRIDE; |
| 60 virtual bool IsFullscreen() const OVERRIDE; | 61 virtual bool IsFullscreen() const OVERRIDE; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 std::vector<extensions::DraggableRegion> draggable_regions_; | 218 std::vector<extensions::DraggableRegion> draggable_regions_; |
| 218 | 219 |
| 219 // The Extension Command Registry used to determine which keyboard events to | 220 // The Extension Command Registry used to determine which keyboard events to |
| 220 // handle. | 221 // handle. |
| 221 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; | 222 scoped_ptr<ExtensionKeybindingRegistryCocoa> extension_keybinding_registry_; |
| 222 | 223 |
| 223 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa); | 224 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowCocoa); |
| 224 }; | 225 }; |
| 225 | 226 |
| 226 #endif // CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ | 227 #endif // CHROME_BROWSER_UI_COCOA_APPS_NATIVE_APP_WINDOW_COCOA_H_ |
| OLD | NEW |