| 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 #ifndef CONTENT_SHELL_SHELL_H_ | 4 #ifndef CONTENT_SHELL_SHELL_H_ |
| 5 #define CONTENT_SHELL_SHELL_H_ | 5 #define CONTENT_SHELL_SHELL_H_ |
| 6 | 6 |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 void LoadURL(const GURL& url); | 56 void LoadURL(const GURL& url); |
| 57 void GoBackOrForward(int offset); | 57 void GoBackOrForward(int offset); |
| 58 void Reload(); | 58 void Reload(); |
| 59 void Stop(); | 59 void Stop(); |
| 60 void UpdateNavigationControls(); | 60 void UpdateNavigationControls(); |
| 61 void Close(); | 61 void Close(); |
| 62 void ShowDevTools(); | 62 void ShowDevTools(); |
| 63 void CloseDevTools(); | 63 void CloseDevTools(); |
| 64 | 64 |
| 65 // Do one time initialization at application startup. | 65 // Do one time initialization at application startup. |
| 66 static void PlatformInitialize(); | 66 static void Initialize(); |
| 67 | 67 |
| 68 static Shell* CreateNewWindow(BrowserContext* browser_context, | 68 static Shell* CreateNewWindow(BrowserContext* browser_context, |
| 69 const GURL& url, | 69 const GURL& url, |
| 70 SiteInstance* site_instance, | 70 SiteInstance* site_instance, |
| 71 int routing_id, | 71 int routing_id, |
| 72 const gfx::Size& initial_size); | 72 const gfx::Size& initial_size); |
| 73 | 73 |
| 74 // Returns the Shell object corresponding to the given RenderViewHost. | 74 // Returns the Shell object corresponding to the given RenderViewHost. |
| 75 static Shell* FromRenderViewHost(RenderViewHost* rvh); | 75 static Shell* FromRenderViewHost(RenderViewHost* rvh); |
| 76 | 76 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 BACK_BUTTON, | 140 BACK_BUTTON, |
| 141 FORWARD_BUTTON, | 141 FORWARD_BUTTON, |
| 142 STOP_BUTTON | 142 STOP_BUTTON |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 explicit Shell(WebContents* web_contents); | 145 explicit Shell(WebContents* web_contents); |
| 146 | 146 |
| 147 // Helper to create a new Shell given a newly created WebContents. | 147 // Helper to create a new Shell given a newly created WebContents. |
| 148 static Shell* CreateShell(WebContents* web_contents); | 148 static Shell* CreateShell(WebContents* web_contents); |
| 149 | 149 |
| 150 // Helper for one time initialization of application |
| 151 static void PlatformInitialize(const gfx::Size& default_window_size); |
| 152 |
| 150 // All the methods that begin with Platform need to be implemented by the | 153 // All the methods that begin with Platform need to be implemented by the |
| 151 // platform specific Shell implementation. | 154 // platform specific Shell implementation. |
| 152 // Called from the destructor to let each platform do any necessary cleanup. | 155 // Called from the destructor to let each platform do any necessary cleanup. |
| 153 void PlatformCleanUp(); | 156 void PlatformCleanUp(); |
| 154 // Creates the main window GUI. | 157 // Creates the main window GUI. |
| 155 void PlatformCreateWindow(int width, int height); | 158 void PlatformCreateWindow(int width, int height); |
| 156 // Links the WebContents into the newly created window. | 159 // Links the WebContents into the newly created window. |
| 157 void PlatformSetContents(); | 160 void PlatformSetContents(); |
| 158 // Resize the content area and GUI. | 161 // Resize the content area and GUI. |
| 159 void PlatformResizeSubViews(); | 162 void PlatformResizeSubViews(); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 static base::Callback<void(Shell*)> shell_created_callback_; | 257 static base::Callback<void(Shell*)> shell_created_callback_; |
| 255 | 258 |
| 256 // True if the destructur of Shell should post a quit closure on the current | 259 // True if the destructur of Shell should post a quit closure on the current |
| 257 // message loop if the destructed Shell object was the last one. | 260 // message loop if the destructed Shell object was the last one. |
| 258 static bool quit_message_loop_; | 261 static bool quit_message_loop_; |
| 259 }; | 262 }; |
| 260 | 263 |
| 261 } // namespace content | 264 } // namespace content |
| 262 | 265 |
| 263 #endif // CONTENT_SHELL_SHELL_H_ | 266 #endif // CONTENT_SHELL_SHELL_H_ |
| OLD | NEW |