| 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_NATIVE_APP_WINDOW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_NATIVE_APP_WINDOW_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_NATIVE_APP_WINDOW_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_NATIVE_APP_WINDOW_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/observer_list.h" |
| 8 #include "chrome/browser/ui/base_window.h" | 9 #include "chrome/browser/ui/base_window.h" |
| 9 #include "chrome/browser/ui/extensions/native_app_window.h" | 10 #include "chrome/browser/ui/extensions/native_app_window.h" |
| 10 #include "chrome/browser/ui/extensions/shell_window.h" | 11 #include "chrome/browser/ui/extensions/shell_window.h" |
| 11 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" | 12 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" |
| 12 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
| 13 #include "third_party/skia/include/core/SkRegion.h" | 14 #include "third_party/skia/include/core/SkRegion.h" |
| 14 #include "ui/gfx/image/image_skia.h" | 15 #include "ui/gfx/image/image_skia.h" |
| 15 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 16 #include "ui/views/widget/widget_delegate.h" | 17 #include "ui/views/widget/widget_delegate.h" |
| 17 #include "ui/views/widget/widget_observer.h" | 18 #include "ui/views/widget/widget_observer.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 virtual bool IsFullscreenOrPending() const OVERRIDE; | 129 virtual bool IsFullscreenOrPending() const OVERRIDE; |
| 129 virtual void UpdateWindowIcon() OVERRIDE; | 130 virtual void UpdateWindowIcon() OVERRIDE; |
| 130 virtual void UpdateWindowTitle() OVERRIDE; | 131 virtual void UpdateWindowTitle() OVERRIDE; |
| 131 virtual void UpdateDraggableRegions( | 132 virtual void UpdateDraggableRegions( |
| 132 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; | 133 const std::vector<extensions::DraggableRegion>& regions) OVERRIDE; |
| 133 virtual void HandleKeyboardEvent( | 134 virtual void HandleKeyboardEvent( |
| 134 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 135 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
| 135 virtual void RenderViewHostChanged() OVERRIDE; | 136 virtual void RenderViewHostChanged() OVERRIDE; |
| 136 virtual gfx::Insets GetFrameInsets() const OVERRIDE; | 137 virtual gfx::Insets GetFrameInsets() const OVERRIDE; |
| 137 | 138 |
| 139 // WebContentsModalDialogHost implementation. |
| 140 virtual gfx::Point GetDialogPosition(const gfx::Size& size) OVERRIDE; |
| 141 |
| 142 virtual void AddObserver( |
| 143 WebContentsModalDialogHostObserver* observer) OVERRIDE; |
| 144 virtual void RemoveObserver( |
| 145 WebContentsModalDialogHostObserver* observer) OVERRIDE; |
| 146 |
| 138 Profile* profile() { return shell_window_->profile(); } | 147 Profile* profile() { return shell_window_->profile(); } |
| 139 content::WebContents* web_contents() { | 148 content::WebContents* web_contents() { |
| 140 return shell_window_->web_contents(); | 149 return shell_window_->web_contents(); |
| 141 } | 150 } |
| 142 const extensions::Extension* extension() { | 151 const extensions::Extension* extension() { |
| 143 return shell_window_->extension(); | 152 return shell_window_->extension(); |
| 144 } | 153 } |
| 145 | 154 |
| 146 ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow. | 155 ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow. |
| 147 views::WebView* web_view_; | 156 views::WebView* web_view_; |
| 148 views::Widget* window_; | 157 views::Widget* window_; |
| 149 bool is_fullscreen_; | 158 bool is_fullscreen_; |
| 150 | 159 |
| 151 scoped_ptr<SkRegion> draggable_region_; | 160 scoped_ptr<SkRegion> draggable_region_; |
| 152 | 161 |
| 153 const bool frameless_; | 162 const bool frameless_; |
| 154 const bool transparent_background_; | 163 const bool transparent_background_; |
| 155 gfx::Size minimum_size_; | 164 gfx::Size minimum_size_; |
| 156 gfx::Size maximum_size_; | 165 gfx::Size maximum_size_; |
| 157 gfx::Size preferred_size_; | 166 gfx::Size preferred_size_; |
| 158 bool resizable_; | 167 bool resizable_; |
| 159 | 168 |
| 160 // The class that registers for keyboard shortcuts for extension commands. | 169 // The class that registers for keyboard shortcuts for extension commands. |
| 161 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; | 170 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; |
| 162 | 171 |
| 163 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 172 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
| 164 | 173 |
| 165 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; | 174 base::WeakPtrFactory<NativeAppWindowViews> weak_ptr_factory_; |
| 166 | 175 |
| 176 ObserverList<WebContentsModalDialogHostObserver> observer_list_; |
| 177 |
| 167 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); | 178 DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); |
| 168 }; | 179 }; |
| 169 | 180 |
| 170 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_NATIVE_APP_WINDOW_VIEWS_H_ | 181 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_NATIVE_APP_WINDOW_VIEWS_H_ |
| OLD | NEW |