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