| 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 #ifndef CONTENT_SHELL_BROWSER_SHELL_H_ | 4 #ifndef CONTENT_SHELL_BROWSER_SHELL_H_ |
| 5 #define CONTENT_SHELL_BROWSER_SHELL_H_ | 5 #define CONTENT_SHELL_BROWSER_SHELL_H_ |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 const std::string& data, | 69 const std::string& data, |
| 70 const GURL& base_url); | 70 const GURL& base_url); |
| 71 #endif | 71 #endif |
| 72 void GoBackOrForward(int offset); | 72 void GoBackOrForward(int offset); |
| 73 void Reload(); | 73 void Reload(); |
| 74 void ReloadBypassingCache(); | 74 void ReloadBypassingCache(); |
| 75 void Stop(); | 75 void Stop(); |
| 76 void UpdateNavigationControls(bool to_different_document); | 76 void UpdateNavigationControls(bool to_different_document); |
| 77 void Close(); | 77 void Close(); |
| 78 void ShowDevTools(); | 78 void ShowDevTools(); |
| 79 void ShowDevToolsForElementAt(int x, int y); | |
| 80 void CloseDevTools(); | 79 void CloseDevTools(); |
| 81 #if defined(OS_MACOSX) | 80 #if defined(OS_MACOSX) |
| 82 // Resizes the web content view to the given dimensions. | 81 // Resizes the web content view to the given dimensions. |
| 83 void SizeTo(const gfx::Size& content_size); | 82 void SizeTo(const gfx::Size& content_size); |
| 84 #endif | 83 #endif |
| 85 | 84 |
| 86 // Do one time initialization at application startup. | 85 // Do one time initialization at application startup. |
| 87 static void Initialize(); | 86 static void Initialize(); |
| 88 | 87 |
| 89 static Shell* CreateNewWindow(BrowserContext* browser_context, | 88 static Shell* CreateNewWindow(BrowserContext* browser_context, |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 void HandleKeyboardEvent(WebContents* source, | 151 void HandleKeyboardEvent(WebContents* source, |
| 153 const NativeWebKeyboardEvent& event) override; | 152 const NativeWebKeyboardEvent& event) override; |
| 154 #endif | 153 #endif |
| 155 bool AddMessageToConsole(WebContents* source, | 154 bool AddMessageToConsole(WebContents* source, |
| 156 int32_t level, | 155 int32_t level, |
| 157 const base::string16& message, | 156 const base::string16& message, |
| 158 int32_t line_no, | 157 int32_t line_no, |
| 159 const base::string16& source_id) override; | 158 const base::string16& source_id) override; |
| 160 void RendererUnresponsive(WebContents* source) override; | 159 void RendererUnresponsive(WebContents* source) override; |
| 161 void ActivateContents(WebContents* contents) override; | 160 void ActivateContents(WebContents* contents) override; |
| 162 bool HandleContextMenu(const content::ContextMenuParams& params) override; | |
| 163 | 161 |
| 164 static gfx::Size GetShellDefaultSize(); | 162 static gfx::Size GetShellDefaultSize(); |
| 165 | 163 |
| 166 private: | 164 private: |
| 167 enum UIControl { | 165 enum UIControl { |
| 168 BACK_BUTTON, | 166 BACK_BUTTON, |
| 169 FORWARD_BUTTON, | 167 FORWARD_BUTTON, |
| 170 STOP_BUTTON | 168 STOP_BUTTON |
| 171 }; | 169 }; |
| 172 | 170 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 198 // Resize the content area and GUI. | 196 // Resize the content area and GUI. |
| 199 void PlatformResizeSubViews(); | 197 void PlatformResizeSubViews(); |
| 200 // Enable/disable a button. | 198 // Enable/disable a button. |
| 201 void PlatformEnableUIControl(UIControl control, bool is_enabled); | 199 void PlatformEnableUIControl(UIControl control, bool is_enabled); |
| 202 // Updates the url in the url bar. | 200 // Updates the url in the url bar. |
| 203 void PlatformSetAddressBarURL(const GURL& url); | 201 void PlatformSetAddressBarURL(const GURL& url); |
| 204 // Sets whether the spinner is spinning. | 202 // Sets whether the spinner is spinning. |
| 205 void PlatformSetIsLoading(bool loading); | 203 void PlatformSetIsLoading(bool loading); |
| 206 // Set the title of shell window | 204 // Set the title of shell window |
| 207 void PlatformSetTitle(const base::string16& title); | 205 void PlatformSetTitle(const base::string16& title); |
| 208 // User right-clicked on the web view | |
| 209 bool PlatformHandleContextMenu(const content::ContextMenuParams& params); | |
| 210 #if defined(OS_ANDROID) | 206 #if defined(OS_ANDROID) |
| 211 void PlatformToggleFullscreenModeForTab(WebContents* web_contents, | 207 void PlatformToggleFullscreenModeForTab(WebContents* web_contents, |
| 212 bool enter_fullscreen); | 208 bool enter_fullscreen); |
| 213 bool PlatformIsFullscreenForTabOrPending( | 209 bool PlatformIsFullscreenForTabOrPending( |
| 214 const WebContents* web_contents) const; | 210 const WebContents* web_contents) const; |
| 215 #endif | 211 #endif |
| 216 | 212 |
| 217 // Helper method for the two public LoadData methods. | 213 // Helper method for the two public LoadData methods. |
| 218 void LoadDataWithBaseURLInternal(const GURL& url, | 214 void LoadDataWithBaseURLInternal(const GURL& url, |
| 219 const std::string& data, | 215 const std::string& data, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 static base::Callback<void(Shell*)> shell_created_callback_; | 266 static base::Callback<void(Shell*)> shell_created_callback_; |
| 271 | 267 |
| 272 // True if the destructur of Shell should post a quit closure on the current | 268 // True if the destructur of Shell should post a quit closure on the current |
| 273 // message loop if the destructed Shell object was the last one. | 269 // message loop if the destructed Shell object was the last one. |
| 274 static bool quit_message_loop_; | 270 static bool quit_message_loop_; |
| 275 }; | 271 }; |
| 276 | 272 |
| 277 } // namespace content | 273 } // namespace content |
| 278 | 274 |
| 279 #endif // CONTENT_SHELL_BROWSER_SHELL_H_ | 275 #endif // CONTENT_SHELL_BROWSER_SHELL_H_ |
| OLD | NEW |