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/app_window.h" | 8 #include "apps/app_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" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 virtual void InitializePanelWindow( | 84 virtual void InitializePanelWindow( |
85 const apps::AppWindow::CreateParams& create_params); | 85 const apps::AppWindow::CreateParams& create_params); |
86 | 86 |
87 private: | 87 private: |
88 friend class ShapedAppWindowTargeterTest; | 88 friend class ShapedAppWindowTargeterTest; |
89 FRIEND_TEST_ALL_PREFIXES(ShapedAppWindowTargeterTest, | 89 FRIEND_TEST_ALL_PREFIXES(ShapedAppWindowTargeterTest, |
90 ResizeInsetsWithinBounds); | 90 ResizeInsetsWithinBounds); |
91 | 91 |
92 void OnViewWasResized(); | 92 void OnViewWasResized(); |
93 | 93 |
94 bool ShouldUseChromeStyleFrame() const; | 94 bool ShouldUseNativeFrame() const; |
95 | 95 |
96 // Installs an EasyResizeWindowTargeter on the containing window, which | 96 // Installs an EasyResizeWindowTargeter on the containing window, which |
97 // allows the window to be resized from within |kResizeInsideBoundsSize| | 97 // allows the window to be resized from within |kResizeInsideBoundsSize| |
98 // pixels inside the window bounds. | 98 // pixels inside the window bounds. |
99 void InstallEasyResizeTargeterOnContainer() const; | 99 void InstallEasyResizeTargeterOnContainer() const; |
100 | 100 |
101 // Caller owns the returned object. | 101 // Caller owns the returned object. |
102 apps::AppWindowFrameView* CreateAppWindowFrameView(); | 102 apps::AppWindowFrameView* CreateAppWindowFrameView(); |
103 | 103 |
104 // ui::BaseWindow implementation. | 104 // ui::BaseWindow implementation. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 virtual void UpdateWindowIcon() OVERRIDE; | 181 virtual void UpdateWindowIcon() OVERRIDE; |
182 virtual void UpdateWindowTitle() OVERRIDE; | 182 virtual void UpdateWindowTitle() OVERRIDE; |
183 virtual void UpdateBadgeIcon() OVERRIDE; | 183 virtual void UpdateBadgeIcon() OVERRIDE; |
184 virtual void UpdateDraggableRegions( | 184 virtual void UpdateDraggableRegions( |
185 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; | 185 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; |
186 virtual SkRegion* GetDraggableRegion() OVERRIDE; | 186 virtual SkRegion* GetDraggableRegion() OVERRIDE; |
187 virtual void UpdateShape(scoped_ptr<SkRegion> region) OVERRIDE; | 187 virtual void UpdateShape(scoped_ptr<SkRegion> region) OVERRIDE; |
188 virtual void HandleKeyboardEvent( | 188 virtual void HandleKeyboardEvent( |
189 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 189 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
190 virtual bool IsFrameless() const OVERRIDE; | 190 virtual bool IsFrameless() const OVERRIDE; |
| 191 virtual bool HasFrameColor() const OVERRIDE; |
| 192 virtual SkColor FrameColor() const OVERRIDE; |
191 virtual gfx::Insets GetFrameInsets() const OVERRIDE; | 193 virtual gfx::Insets GetFrameInsets() const OVERRIDE; |
192 virtual void HideWithApp() OVERRIDE; | 194 virtual void HideWithApp() OVERRIDE; |
193 virtual void ShowWithApp() OVERRIDE; | 195 virtual void ShowWithApp() OVERRIDE; |
194 virtual void UpdateWindowMinMaxSize() OVERRIDE; | 196 virtual void UpdateWindowMinMaxSize() OVERRIDE; |
195 | 197 |
196 // web_modal::WebContentsModalDialogHost implementation. | 198 // web_modal::WebContentsModalDialogHost implementation. |
197 virtual gfx::NativeView GetHostView() const OVERRIDE; | 199 virtual gfx::NativeView GetHostView() const OVERRIDE; |
198 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; | 200 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; |
199 virtual gfx::Size GetMaximumDialogSize() OVERRIDE; | 201 virtual gfx::Size GetMaximumDialogSize() OVERRIDE; |
200 virtual void AddObserver( | 202 virtual void AddObserver( |
201 web_modal::ModalDialogHostObserver* observer) OVERRIDE; | 203 web_modal::ModalDialogHostObserver* observer) OVERRIDE; |
202 virtual void RemoveObserver( | 204 virtual void RemoveObserver( |
203 web_modal::ModalDialogHostObserver* observer) OVERRIDE; | 205 web_modal::ModalDialogHostObserver* observer) OVERRIDE; |
204 | 206 |
205 content::WebContents* web_contents() { return app_window_->web_contents(); } | 207 content::WebContents* web_contents() { return app_window_->web_contents(); } |
206 | 208 |
207 apps::AppWindow* app_window_; // Not owned. | 209 apps::AppWindow* app_window_; // Not owned. |
208 views::WebView* web_view_; | 210 views::WebView* web_view_; |
209 views::Widget* window_; | 211 views::Widget* window_; |
210 bool is_fullscreen_; | 212 bool is_fullscreen_; |
211 | 213 |
212 // Custom shape of the window. If this is not set then the window has a | 214 // Custom shape of the window. If this is not set then the window has a |
213 // default shape, usually rectangular. | 215 // default shape, usually rectangular. |
214 scoped_ptr<SkRegion> shape_; | 216 scoped_ptr<SkRegion> shape_; |
215 | 217 |
216 scoped_ptr<SkRegion> draggable_region_; | 218 scoped_ptr<SkRegion> draggable_region_; |
217 | 219 |
218 bool frameless_; | 220 bool frameless_; |
| 221 bool has_frame_color_; |
| 222 SkColor frame_color_; |
219 bool transparent_background_; | 223 bool transparent_background_; |
220 gfx::Size preferred_size_; | 224 gfx::Size preferred_size_; |
221 bool resizable_; | 225 bool resizable_; |
222 | 226 |
223 // The class that registers for keyboard shortcuts for extension commands. | 227 // The class that registers for keyboard shortcuts for extension commands. |
224 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; | 228 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; |
225 | 229 |
226 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 230 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
227 | 231 |
228 #if defined(USE_ASH) | 232 #if defined(USE_ASH) |
229 // Used to put non-frameless windows into immersive fullscreen on ChromeOS. In | 233 // Used to put non-frameless windows into immersive fullscreen on ChromeOS. In |
230 // immersive fullscreen, the window header (title bar and window controls) | 234 // immersive fullscreen, the window header (title bar and window controls) |
231 // slides onscreen as an overlay when the mouse is hovered at the top of the | 235 // slides onscreen as an overlay when the mouse is hovered at the top of the |
232 // screen. | 236 // screen. |
233 scoped_ptr<ash::ImmersiveFullscreenController> | 237 scoped_ptr<ash::ImmersiveFullscreenController> |
234 immersive_fullscreen_controller_; | 238 immersive_fullscreen_controller_; |
235 #endif | 239 #endif |
236 | 240 |
237 ObserverList<web_modal::ModalDialogHostObserver> observer_list_; | 241 ObserverList<web_modal::ModalDialogHostObserver> observer_list_; |
238 | 242 |
239 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; | 243 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; |
240 | 244 |
241 // Used to show the system menu. | 245 // Used to show the system menu. |
242 scoped_ptr<views::MenuRunner> menu_runner_; | 246 scoped_ptr<views::MenuRunner> menu_runner_; |
243 | 247 |
244 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); | 248 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); |
245 }; | 249 }; |
246 | 250 |
247 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ | 251 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ |
OLD | NEW |