Chromium Code Reviews| 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/native_app_window.h" | 8 #include "apps/native_app_window.h" |
| 9 #include "apps/shell_window.h" | 9 #include "apps/shell_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 class ExtensionKeybindingRegistryViews; | 23 class ExtensionKeybindingRegistryViews; |
| 24 class Profile; | 24 class Profile; |
| 25 | 25 |
| 26 namespace apps { | |
| 27 class ShellWindowFrameView; | |
| 28 } | |
| 29 | |
| 26 namespace content { | 30 namespace content { |
| 27 class RenderViewHost; | 31 class RenderViewHost; |
| 28 class WebContents; | 32 class WebContents; |
| 29 } | 33 } |
| 30 | 34 |
| 31 namespace extensions { | 35 namespace extensions { |
| 32 class Extension; | 36 class Extension; |
| 33 } | 37 } |
| 34 | 38 |
| 35 namespace views { | 39 namespace views { |
| 36 class WebView; | 40 class WebView; |
| 37 } | 41 } |
| 38 | 42 |
| 39 class NativeAppWindowViews : public apps::NativeAppWindow, | 43 class NativeAppWindowViews : public apps::NativeAppWindow, |
| 40 public views::WidgetDelegateView, | 44 public views::WidgetDelegateView, |
| 41 public views::WidgetObserver, | 45 public views::WidgetObserver, |
| 42 public content::WebContentsObserver { | 46 public content::WebContentsObserver { |
| 43 public: | 47 public: |
| 44 NativeAppWindowViews(apps::ShellWindow* shell_window, | 48 NativeAppWindowViews(apps::ShellWindow* shell_window, |
| 45 const apps::ShellWindow::CreateParams& params); | 49 const apps::ShellWindow::CreateParams& params); |
| 46 virtual ~NativeAppWindowViews(); | 50 virtual ~NativeAppWindowViews(); |
| 47 | 51 |
| 48 bool frameless() const { return frameless_; } | 52 bool frameless() const { return frameless_; } |
| 49 SkRegion* draggable_region() { return draggable_region_.get(); } | 53 SkRegion* draggable_region() { return draggable_region_.get(); } |
|
stevenjb
2013/10/12 00:16:42
These two are the only additional public interface
| |
| 50 | 54 |
| 51 private: | 55 private: |
| 52 void InitializeDefaultWindow( | 56 void InitializeDefaultWindow( |
| 53 const apps::ShellWindow::CreateParams& create_params); | 57 const apps::ShellWindow::CreateParams& create_params); |
| 54 void InitializePanelWindow( | 58 void InitializePanelWindow( |
| 55 const apps::ShellWindow::CreateParams& create_params); | 59 const apps::ShellWindow::CreateParams& create_params); |
| 56 void OnViewWasResized(); | 60 void OnViewWasResized(); |
| 57 | 61 |
| 58 bool ShouldUseChromeStyleFrame() const; | 62 bool ShouldUseChromeStyleFrame() const; |
| 59 | 63 |
| 64 // Caller owns the returned object. | |
| 65 apps::ShellWindowFrameView* CreateShellWindowFrameView(); | |
| 66 | |
| 60 #if defined(OS_WIN) | 67 #if defined(OS_WIN) |
| 61 void OnShortcutInfoLoaded( | 68 void OnShortcutInfoLoaded( |
| 62 const ShellIntegration::ShortcutInfo& shortcut_info); | 69 const ShellIntegration::ShortcutInfo& shortcut_info); |
| 63 HWND GetNativeAppWindowHWND() const; | 70 HWND GetNativeAppWindowHWND() const; |
| 64 #endif | 71 #endif |
| 65 | 72 |
| 66 // ui::BaseWindow implementation. | 73 // ui::BaseWindow implementation. |
| 67 virtual bool IsActive() const OVERRIDE; | 74 virtual bool IsActive() const OVERRIDE; |
| 68 virtual bool IsMaximized() const OVERRIDE; | 75 virtual bool IsMaximized() const OVERRIDE; |
| 69 virtual bool IsMinimized() const OVERRIDE; | 76 virtual bool IsMinimized() const OVERRIDE; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 197 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
| 191 | 198 |
| 192 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; | 199 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; |
| 193 | 200 |
| 194 ObserverList<web_modal::ModalDialogHostObserver> observer_list_; | 201 ObserverList<web_modal::ModalDialogHostObserver> observer_list_; |
| 195 | 202 |
| 196 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); | 203 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); |
| 197 }; | 204 }; |
| 198 | 205 |
| 199 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ | 206 #endif // CHROME_BROWSER_UI_VIEWS_APPS_NATIVE_APP_WINDOW_VIEWS_H_ |
| OLD | NEW |