OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ |
7 | 7 |
8 #include "chrome/browser/ui/base_window.h" | 8 #include "chrome/browser/ui/base_window.h" |
9 #include "chrome/browser/ui/extensions/native_shell_window.h" | 9 #include "chrome/browser/ui/extensions/native_shell_window.h" |
10 #include "chrome/browser/ui/extensions/shell_window.h" | 10 #include "chrome/browser/ui/extensions/shell_window.h" |
11 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" | 11 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" |
12 #include "third_party/skia/include/core/SkRegion.h" | |
13 #include "ui/gfx/image/image_skia.h" | 12 #include "ui/gfx/image/image_skia.h" |
14 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
15 #include "ui/views/widget/widget_delegate.h" | 14 #include "ui/views/widget/widget_delegate.h" |
16 | 15 |
17 class ExtensionKeybindingRegistryViews; | 16 class ExtensionKeybindingRegistryViews; |
18 class Profile; | 17 class Profile; |
19 | 18 |
20 namespace content { | 19 namespace content { |
21 class WebContents; | 20 class WebContents; |
22 } | 21 } |
23 | 22 |
24 namespace extensions { | 23 namespace extensions { |
25 class Extension; | 24 class Extension; |
26 struct DraggableRegion; | |
27 } | 25 } |
28 | 26 |
29 namespace views { | 27 namespace views { |
30 class WebView; | 28 class WebView; |
31 } | 29 } |
32 | 30 |
33 class ShellWindowViews : public NativeShellWindow, | 31 class ShellWindowViews : public NativeShellWindow, |
34 public views::WidgetDelegateView { | 32 public views::WidgetDelegateView { |
35 public: | 33 public: |
36 ShellWindowViews(ShellWindow* shell_window, | 34 ShellWindowViews(ShellWindow* shell_window, |
37 const ShellWindow::CreateParams& params); | 35 const ShellWindow::CreateParams& params); |
38 | 36 |
39 bool frameless() const { return frameless_; } | |
40 SkRegion* draggable_region() { return draggable_region_.get(); } | |
41 | |
42 // BaseWindow implementation. | 37 // BaseWindow implementation. |
43 virtual bool IsActive() const OVERRIDE; | 38 virtual bool IsActive() const OVERRIDE; |
44 virtual bool IsMaximized() const OVERRIDE; | 39 virtual bool IsMaximized() const OVERRIDE; |
45 virtual bool IsMinimized() const OVERRIDE; | 40 virtual bool IsMinimized() const OVERRIDE; |
46 virtual bool IsFullscreen() const OVERRIDE; | 41 virtual bool IsFullscreen() const OVERRIDE; |
47 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; | 42 virtual gfx::NativeWindow GetNativeWindow() OVERRIDE; |
48 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; | 43 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; |
49 virtual gfx::Rect GetBounds() const OVERRIDE; | 44 virtual gfx::Rect GetBounds() const OVERRIDE; |
50 virtual void Show() OVERRIDE; | 45 virtual void Show() OVERRIDE; |
51 virtual void ShowInactive() OVERRIDE; | 46 virtual void ShowInactive() OVERRIDE; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 98 |
104 virtual ~ShellWindowViews(); | 99 virtual ~ShellWindowViews(); |
105 | 100 |
106 // NativeShellWindow implementation. | 101 // NativeShellWindow implementation. |
107 virtual void SetFullscreen(bool fullscreen) OVERRIDE; | 102 virtual void SetFullscreen(bool fullscreen) OVERRIDE; |
108 virtual bool IsFullscreenOrPending() const OVERRIDE; | 103 virtual bool IsFullscreenOrPending() const OVERRIDE; |
109 virtual void UpdateWindowIcon() OVERRIDE; | 104 virtual void UpdateWindowIcon() OVERRIDE; |
110 virtual void UpdateWindowTitle() OVERRIDE; | 105 virtual void UpdateWindowTitle() OVERRIDE; |
111 virtual void UpdateDraggableRegions( | 106 virtual void UpdateDraggableRegions( |
112 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; | 107 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; |
113 virtual void UpdateLegacyDraggableRegions( | |
114 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; | |
115 virtual void HandleKeyboardEvent( | 108 virtual void HandleKeyboardEvent( |
116 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 109 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
117 | 110 |
118 void OnViewWasResized(); | 111 void OnViewWasResized(); |
119 | 112 |
120 ShellWindow* shell_window_; // weak - ShellWindow owns NativeShellWindow. | 113 ShellWindow* shell_window_; // weak - ShellWindow owns NativeShellWindow. |
121 | 114 |
122 views::WebView* web_view_; | 115 views::WebView* web_view_; |
123 views::Widget* window_; | 116 views::Widget* window_; |
124 bool is_fullscreen_; | 117 bool is_fullscreen_; |
125 | 118 |
126 scoped_ptr<SkRegion> draggable_region_; | |
127 | |
128 bool frameless_; | |
129 gfx::Size minimum_size_; | 119 gfx::Size minimum_size_; |
130 gfx::Size maximum_size_; | 120 gfx::Size maximum_size_; |
131 | 121 |
132 // The class that registers for keyboard shortcuts for extension commands. | 122 // The class that registers for keyboard shortcuts for extension commands. |
133 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; | 123 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; |
134 | 124 |
135 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 125 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
136 | 126 |
137 DISALLOW_COPY_AND_ASSIGN(ShellWindowViews); | 127 DISALLOW_COPY_AND_ASSIGN(ShellWindowViews); |
138 }; | 128 }; |
139 | 129 |
140 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ | 130 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_SHELL_WINDOW_VIEWS_H_ |
OLD | NEW |