| 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_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ |
| 7 | 7 |
| 8 #include "apps/shell_window.h" | 8 #include "apps/shell_window.h" |
| 9 #include "apps/ui/native_app_window.h" | 9 #include "apps/ui/native_app_window.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| 11 #include "content/public/browser/web_contents_observer.h" | 11 #include "content/public/browser/web_contents_observer.h" |
| 12 #include "third_party/skia/include/core/SkRegion.h" | 12 #include "third_party/skia/include/core/SkRegion.h" |
| 13 #include "ui/gfx/image/image_skia.h" | 13 #include "ui/gfx/image/image_skia.h" |
| 14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
| 15 #include "ui/views/context_menu_controller.h" | 15 #include "ui/views/context_menu_controller.h" |
| 16 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" | 16 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" |
| 17 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
| 18 #include "ui/views/widget/widget_delegate.h" | 18 #include "ui/views/widget/widget_delegate.h" |
| 19 #include "ui/views/widget/widget_observer.h" | 19 #include "ui/views/widget/widget_observer.h" |
| 20 | 20 |
| 21 #if defined(OS_WIN) |
| 22 #include "chrome/browser/shell_integration.h" |
| 23 #endif |
| 24 |
| 21 #if defined(USE_ASH) | 25 #if defined(USE_ASH) |
| 22 namespace ash { | 26 namespace ash { |
| 23 class ImmersiveFullscreenController; | 27 class ImmersiveFullscreenController; |
| 24 } | 28 } |
| 25 #endif | 29 #endif |
| 26 | 30 |
| 27 class ExtensionKeybindingRegistryViews; | 31 class ExtensionKeybindingRegistryViews; |
| 28 | 32 |
| 29 namespace apps { | 33 namespace apps { |
| 30 class ShellWindowFrameView; | 34 class ShellWindowFrameView; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 virtual void Show() OVERRIDE; | 76 virtual void Show() OVERRIDE; |
| 73 virtual void Activate() OVERRIDE; | 77 virtual void Activate() OVERRIDE; |
| 74 | 78 |
| 75 content::BrowserContext* browser_context() { | 79 content::BrowserContext* browser_context() { |
| 76 return shell_window_->browser_context(); | 80 return shell_window_->browser_context(); |
| 77 } | 81 } |
| 78 | 82 |
| 79 const extensions::Extension* extension() { | 83 const extensions::Extension* extension() { |
| 80 return shell_window_->extension(); | 84 return shell_window_->extension(); |
| 81 } | 85 } |
| 82 const views::Widget* window() const { return window_; } | |
| 83 | |
| 84 virtual void InitializeDefaultWindow( | |
| 85 const apps::ShellWindow::CreateParams& create_params); | |
| 86 virtual void InitializePanelWindow( | |
| 87 const apps::ShellWindow::CreateParams& create_params); | |
| 88 | 86 |
| 89 private: | 87 private: |
| 90 friend class ShapedAppWindowTargeterTest; | 88 friend class ShapedAppWindowTargeterTest; |
| 91 | 89 |
| 90 void InitializeDefaultWindow( |
| 91 const apps::ShellWindow::CreateParams& create_params); |
| 92 void InitializePanelWindow( |
| 93 const apps::ShellWindow::CreateParams& create_params); |
| 92 void OnViewWasResized(); | 94 void OnViewWasResized(); |
| 93 | 95 |
| 94 bool ShouldUseChromeStyleFrame() const; | 96 bool ShouldUseChromeStyleFrame() const; |
| 95 | 97 |
| 96 // Caller owns the returned object. | 98 // Caller owns the returned object. |
| 97 apps::ShellWindowFrameView* CreateShellWindowFrameView(); | 99 apps::ShellWindowFrameView* CreateShellWindowFrameView(); |
| 98 | 100 |
| 101 #if defined(OS_WIN) |
| 102 void OnShortcutInfoLoaded( |
| 103 const ShellIntegration::ShortcutInfo& shortcut_info); |
| 104 HWND GetNativeAppWindowHWND() const; |
| 105 #endif |
| 106 |
| 99 // ui::BaseWindow implementation. | 107 // ui::BaseWindow implementation. |
| 100 virtual bool IsActive() const OVERRIDE; | 108 virtual bool IsActive() const OVERRIDE; |
| 101 virtual bool IsMaximized() const OVERRIDE; | 109 virtual bool IsMaximized() const OVERRIDE; |
| 102 virtual bool IsMinimized() const OVERRIDE; | 110 virtual bool IsMinimized() const OVERRIDE; |
| 103 virtual bool IsFullscreen() const OVERRIDE; | 111 virtual bool IsFullscreen() const OVERRIDE; |
| 104 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; | 112 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; |
| 105 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 113 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; |
| 106 virtual ui::WindowShowState GetRestoredState() const OVERRIDE; | 114 virtual ui::WindowShowState GetRestoredState() const OVERRIDE; |
| 107 virtual gfx::Rect GetBounds() const OVERRIDE; | 115 virtual gfx::Rect GetBounds() const OVERRIDE; |
| 108 virtual void ShowInactive() OVERRIDE; | 116 virtual void ShowInactive() OVERRIDE; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 243 |
| 236 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; | 244 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; |
| 237 | 245 |
| 238 // Used to show the system menu. | 246 // Used to show the system menu. |
| 239 scoped_ptr<views::MenuRunner> menu_runner_; | 247 scoped_ptr<views::MenuRunner> menu_runner_; |
| 240 | 248 |
| 241 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); | 249 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); |
| 242 }; | 250 }; |
| 243 | 251 |
| 244 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ | 252 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ |
| OLD | NEW |