| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 APPS_UI_VIEWS_NATIVE_APP_WINDOW_VIEWS_H_ | 5 #ifndef APPS_UI_VIEWS_NATIVE_APP_WINDOW_VIEWS_H_ |
| 6 #define APPS_UI_VIEWS_NATIVE_APP_WINDOW_VIEWS_H_ | 6 #define APPS_UI_VIEWS_NATIVE_APP_WINDOW_VIEWS_H_ |
| 7 | 7 |
| 8 #include "apps/size_constraints.h" | 8 #include "apps/size_constraints.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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 class NativeAppWindowViews : public NativeAppWindow, | 45 class NativeAppWindowViews : public NativeAppWindow, |
| 46 public content::WebContentsObserver, | 46 public content::WebContentsObserver, |
| 47 public views::WidgetDelegateView, | 47 public views::WidgetDelegateView, |
| 48 public views::WidgetObserver { | 48 public views::WidgetObserver { |
| 49 public: | 49 public: |
| 50 NativeAppWindowViews(); | 50 NativeAppWindowViews(); |
| 51 virtual ~NativeAppWindowViews(); | 51 virtual ~NativeAppWindowViews(); |
| 52 void Init(AppWindow* app_window, | 52 void Init(AppWindow* app_window, |
| 53 const AppWindow::CreateParams& create_params); | 53 const AppWindow::CreateParams& create_params); |
| 54 | 54 |
| 55 // Signal that CanHaveTransparentBackground has changed. |
| 56 void OnCanHaveAlphaEnabledChanged(); |
| 57 |
| 55 views::Widget* widget() { return widget_; } | 58 views::Widget* widget() { return widget_; } |
| 56 | 59 |
| 57 void set_window_for_testing(views::Widget* window) { widget_ = window; } | 60 void set_window_for_testing(views::Widget* window) { widget_ = window; } |
| 58 void set_web_view_for_testing(views::WebView* view) { web_view_ = view; } | 61 void set_web_view_for_testing(views::WebView* view) { web_view_ = view; } |
| 59 | 62 |
| 60 protected: | 63 protected: |
| 61 AppWindow* app_window() { return app_window_; } | 64 AppWindow* app_window() { return app_window_; } |
| 62 const AppWindow* app_window() const { return app_window_; } | 65 const AppWindow* app_window() const { return app_window_; } |
| 63 | 66 |
| 64 const views::Widget* widget() const { return widget_; } | 67 const views::Widget* widget() const { return widget_; } |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 virtual SkColor ActiveFrameColor() const OVERRIDE; | 152 virtual SkColor ActiveFrameColor() const OVERRIDE; |
| 150 virtual SkColor InactiveFrameColor() const OVERRIDE; | 153 virtual SkColor InactiveFrameColor() const OVERRIDE; |
| 151 virtual gfx::Insets GetFrameInsets() const OVERRIDE; | 154 virtual gfx::Insets GetFrameInsets() const OVERRIDE; |
| 152 virtual void HideWithApp() OVERRIDE; | 155 virtual void HideWithApp() OVERRIDE; |
| 153 virtual void ShowWithApp() OVERRIDE; | 156 virtual void ShowWithApp() OVERRIDE; |
| 154 virtual void UpdateShelfMenu() OVERRIDE; | 157 virtual void UpdateShelfMenu() OVERRIDE; |
| 155 virtual gfx::Size GetContentMinimumSize() const OVERRIDE; | 158 virtual gfx::Size GetContentMinimumSize() const OVERRIDE; |
| 156 virtual gfx::Size GetContentMaximumSize() const OVERRIDE; | 159 virtual gfx::Size GetContentMaximumSize() const OVERRIDE; |
| 157 virtual void SetContentSizeConstraints(const gfx::Size& min_size, | 160 virtual void SetContentSizeConstraints(const gfx::Size& min_size, |
| 158 const gfx::Size& max_size) OVERRIDE; | 161 const gfx::Size& max_size) OVERRIDE; |
| 162 virtual bool CanHaveAlphaEnabled() const OVERRIDE; |
| 159 | 163 |
| 160 // web_modal::WebContentsModalDialogHost implementation. | 164 // web_modal::WebContentsModalDialogHost implementation. |
| 161 virtual gfx::NativeView GetHostView() const OVERRIDE; | 165 virtual gfx::NativeView GetHostView() const OVERRIDE; |
| 162 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; | 166 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; |
| 163 virtual gfx::Size GetMaximumDialogSize() OVERRIDE; | 167 virtual gfx::Size GetMaximumDialogSize() OVERRIDE; |
| 164 virtual void AddObserver( | 168 virtual void AddObserver( |
| 165 web_modal::ModalDialogHostObserver* observer) OVERRIDE; | 169 web_modal::ModalDialogHostObserver* observer) OVERRIDE; |
| 166 virtual void RemoveObserver( | 170 virtual void RemoveObserver( |
| 167 web_modal::ModalDialogHostObserver* observer) OVERRIDE; | 171 web_modal::ModalDialogHostObserver* observer) OVERRIDE; |
| 168 | 172 |
| 169 private: | 173 private: |
| 170 // Informs modal dialogs that they need to update their positions. | 174 // Informs modal dialogs that they need to update their positions. |
| 171 void OnViewWasResized(); | 175 void OnViewWasResized(); |
| 172 | 176 |
| 173 AppWindow* app_window_; // Not owned. | 177 AppWindow* app_window_; // Not owned. |
| 174 views::WebView* web_view_; | 178 views::WebView* web_view_; |
| 175 views::Widget* widget_; | 179 views::Widget* widget_; |
| 176 | 180 |
| 177 scoped_ptr<SkRegion> draggable_region_; | 181 scoped_ptr<SkRegion> draggable_region_; |
| 178 | 182 |
| 179 bool frameless_; | 183 bool frameless_; |
| 180 bool transparent_background_; | |
| 181 bool resizable_; | 184 bool resizable_; |
| 182 apps::SizeConstraints size_constraints_; | 185 apps::SizeConstraints size_constraints_; |
| 183 | 186 |
| 184 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 187 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
| 185 | 188 |
| 186 ObserverList<web_modal::ModalDialogHostObserver> observer_list_; | 189 ObserverList<web_modal::ModalDialogHostObserver> observer_list_; |
| 187 | 190 |
| 188 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); | 191 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); |
| 189 }; | 192 }; |
| 190 | 193 |
| 191 } // namespace apps | 194 } // namespace apps |
| 192 | 195 |
| 193 #endif // APPS_UI_VIEWS_NATIVE_APP_WINDOW_VIEWS_H_ | 196 #endif // APPS_UI_VIEWS_NATIVE_APP_WINDOW_VIEWS_H_ |
| OLD | NEW |