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/controls/webview/unhandled_keyboard_event_handler.h" | 15 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h" |
16 #include "ui/views/widget/widget_delegate.h" | 16 #include "ui/views/widget/widget_delegate.h" |
17 #include "ui/views/widget/widget_observer.h" | 17 #include "ui/views/widget/widget_observer.h" |
18 | 18 |
19 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
20 #include "chrome/browser/shell_integration.h" | 20 #include "chrome/browser/shell_integration.h" |
21 #endif | 21 #endif |
22 | 22 |
| 23 #if defined(USE_ASH) |
| 24 namespace ash { |
| 25 class ImmersiveFullscreenController; |
| 26 } |
| 27 #endif |
| 28 |
23 class ExtensionKeybindingRegistryViews; | 29 class ExtensionKeybindingRegistryViews; |
24 class Profile; | 30 class Profile; |
25 | 31 |
26 namespace apps { | 32 namespace apps { |
27 class ShellWindowFrameView; | 33 class ShellWindowFrameView; |
28 } | 34 } |
29 | 35 |
30 namespace content { | 36 namespace content { |
31 class RenderViewHost; | 37 class RenderViewHost; |
32 class WebContents; | 38 class WebContents; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 virtual void Layout() OVERRIDE; | 137 virtual void Layout() OVERRIDE; |
132 virtual void ViewHierarchyChanged( | 138 virtual void ViewHierarchyChanged( |
133 const ViewHierarchyChangedDetails& details) OVERRIDE; | 139 const ViewHierarchyChangedDetails& details) OVERRIDE; |
134 virtual gfx::Size GetPreferredSize() OVERRIDE; | 140 virtual gfx::Size GetPreferredSize() OVERRIDE; |
135 virtual gfx::Size GetMinimumSize() OVERRIDE; | 141 virtual gfx::Size GetMinimumSize() OVERRIDE; |
136 virtual gfx::Size GetMaximumSize() OVERRIDE; | 142 virtual gfx::Size GetMaximumSize() OVERRIDE; |
137 virtual void OnFocus() OVERRIDE; | 143 virtual void OnFocus() OVERRIDE; |
138 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 144 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
139 | 145 |
140 // NativeAppWindow implementation. | 146 // NativeAppWindow implementation. |
141 virtual void SetFullscreen(bool fullscreen) OVERRIDE; | 147 virtual void SetFullscreen(apps::ShellWindow::FullscreenType type) OVERRIDE; |
142 virtual bool IsFullscreenOrPending() const OVERRIDE; | 148 virtual bool SupportsImmersiveFullscreen() const OVERRIDE; |
143 virtual bool IsDetached() const OVERRIDE; | 149 virtual bool IsDetached() const OVERRIDE; |
144 virtual void UpdateWindowIcon() OVERRIDE; | 150 virtual void UpdateWindowIcon() OVERRIDE; |
145 virtual void UpdateWindowTitle() OVERRIDE; | 151 virtual void UpdateWindowTitle() OVERRIDE; |
146 virtual void UpdateDraggableRegions( | 152 virtual void UpdateDraggableRegions( |
147 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; | 153 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; |
148 virtual SkRegion* GetDraggableRegion() OVERRIDE; | 154 virtual SkRegion* GetDraggableRegion() OVERRIDE; |
149 virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) OVERRIDE; | 155 virtual void UpdateInputRegion(scoped_ptr<SkRegion> region) OVERRIDE; |
150 virtual void HandleKeyboardEvent( | 156 virtual void HandleKeyboardEvent( |
151 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 157 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
152 virtual bool IsFrameless() const OVERRIDE; | 158 virtual bool IsFrameless() const OVERRIDE; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 const bool frameless_; | 192 const bool frameless_; |
187 const bool transparent_background_; | 193 const bool transparent_background_; |
188 gfx::Size preferred_size_; | 194 gfx::Size preferred_size_; |
189 bool resizable_; | 195 bool resizable_; |
190 | 196 |
191 // The class that registers for keyboard shortcuts for extension commands. | 197 // The class that registers for keyboard shortcuts for extension commands. |
192 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; | 198 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; |
193 | 199 |
194 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 200 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
195 | 201 |
196 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; | 202 #if defined(USE_ASH) |
| 203 // Used to put non-frameless windows into immersive fullscreen on ChromeOS. In |
| 204 // immersive fullscreen, the window header (title bar and window controls) |
| 205 // slides onscreen as an overlay when the mouse is hovered at the top of the |
| 206 // screen. |
| 207 scoped_ptr<ash::ImmersiveFullscreenController> |
| 208 immersive_fullscreen_controller_; |
| 209 #endif |
197 | 210 |
198 ObserverList<web_modal::ModalDialogHostObserver> observer_list_; | 211 ObserverList<web_modal::ModalDialogHostObserver> observer_list_; |
199 | 212 |
| 213 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; |
| 214 |
200 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); | 215 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); |
201 }; | 216 }; |
202 | 217 |
203 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ | 218 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ |
OLD | NEW |