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