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 APPS_SHELL_WINDOW_H_ | 5 #ifndef APPS_SHELL_WINDOW_H_ |
6 #define APPS_SHELL_WINDOW_H_ | 6 #define APPS_SHELL_WINDOW_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/extensions/extension_icon_image.h" | 10 #include "chrome/browser/extensions/extension_icon_image.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 ShellWindow(Profile* profile, | 174 ShellWindow(Profile* profile, |
175 Delegate* delegate, | 175 Delegate* delegate, |
176 const extensions::Extension* extension); | 176 const extensions::Extension* extension); |
177 | 177 |
178 // Initializes the render interface, web contents, and native window. | 178 // Initializes the render interface, web contents, and native window. |
179 // |shell_window_contents| will become owned by ShellWindow. | 179 // |shell_window_contents| will become owned by ShellWindow. |
180 void Init(const GURL& url, | 180 void Init(const GURL& url, |
181 ShellWindowContents* shell_window_contents, | 181 ShellWindowContents* shell_window_contents, |
182 const CreateParams& params); | 182 const CreateParams& params); |
183 | 183 |
184 | |
185 const std::string& window_key() const { return window_key_; } | 184 const std::string& window_key() const { return window_key_; } |
186 const SessionID& session_id() const { return session_id_; } | 185 const SessionID& session_id() const { return session_id_; } |
187 const extensions::Extension* extension() const { return extension_; } | 186 const extensions::Extension* extension() const { return extension_; } |
188 const std::string& extension_id() const { return extension_id_; } | 187 const std::string& extension_id() const { return extension_id_; } |
189 content::WebContents* web_contents() const; | 188 content::WebContents* web_contents() const; |
190 WindowType window_type() const { return window_type_; } | 189 WindowType window_type() const { return window_type_; } |
191 bool window_type_is_panel() const { | 190 bool window_type_is_panel() const { |
192 return (window_type_ == WINDOW_TYPE_PANEL || | 191 return (window_type_ == WINDOW_TYPE_PANEL || |
193 window_type_ == WINDOW_TYPE_V1_PANEL); | 192 window_type_ == WINDOW_TYPE_V1_PANEL); |
194 } | 193 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 virtual void Observe(int type, | 291 virtual void Observe(int type, |
293 const content::NotificationSource& source, | 292 const content::NotificationSource& source, |
294 const content::NotificationDetails& details) OVERRIDE; | 293 const content::NotificationDetails& details) OVERRIDE; |
295 | 294 |
296 // web_modal::WebContentsModalDialogManagerDelegate implementation. | 295 // web_modal::WebContentsModalDialogManagerDelegate implementation. |
297 virtual void SetWebContentsBlocked(content::WebContents* web_contents, | 296 virtual void SetWebContentsBlocked(content::WebContents* web_contents, |
298 bool blocked) OVERRIDE; | 297 bool blocked) OVERRIDE; |
299 virtual bool IsWebContentsVisible( | 298 virtual bool IsWebContentsVisible( |
300 content::WebContents* web_contents) OVERRIDE; | 299 content::WebContents* web_contents) OVERRIDE; |
301 | 300 |
| 301 // Remove the window from the ShellWindowRegistry and tell the native |
| 302 // window to close. The native window won't be actually closed until |
| 303 // OnNativeClose(). |
| 304 void Close(); |
| 305 |
302 // Helper method to add a message to the renderer's DevTools console. | 306 // Helper method to add a message to the renderer's DevTools console. |
303 void AddMessageToDevToolsConsole(content::ConsoleMessageLevel level, | 307 void AddMessageToDevToolsConsole(content::ConsoleMessageLevel level, |
304 const std::string& message); | 308 const std::string& message); |
305 | 309 |
306 // Saves the window geometry/position/screen bounds. | 310 // Saves the window geometry/position/screen bounds. |
307 void SaveWindowPosition(); | 311 void SaveWindowPosition(); |
308 | 312 |
309 // Helper method to adjust the cached bounds so that we can make sure it can | 313 // Helper method to adjust the cached bounds so that we can make sure it can |
310 // be visible on the screen. See http://crbug.com/145752 . | 314 // be visible on the screen. See http://crbug.com/145752 . |
311 void AdjustBoundsToBeVisibleOnScreen( | 315 void AdjustBoundsToBeVisibleOnScreen( |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 bool fullscreen_for_window_api_; | 374 bool fullscreen_for_window_api_; |
371 // Fullscreen entered by HTML requestFullscreen. | 375 // Fullscreen entered by HTML requestFullscreen. |
372 bool fullscreen_for_tab_; | 376 bool fullscreen_for_tab_; |
373 | 377 |
374 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 378 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
375 }; | 379 }; |
376 | 380 |
377 } // namespace apps | 381 } // namespace apps |
378 | 382 |
379 #endif // APPS_SHELL_WINDOW_H_ | 383 #endif // APPS_SHELL_WINDOW_H_ |
OLD | NEW |