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 CONTENT_SHELL_SHELL_H_ | 5 #ifndef CONTENT_SHELL_SHELL_H_ |
6 #define CONTENT_SHELL_SHELL_H_ | 6 #define CONTENT_SHELL_SHELL_H_ |
7 | 7 |
8 #pragma once | 8 #pragma once |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 23 matching lines...) Expand all Loading... |
34 class Shell : public WebContentsDelegate { | 34 class Shell : public WebContentsDelegate { |
35 public: | 35 public: |
36 virtual ~Shell(); | 36 virtual ~Shell(); |
37 | 37 |
38 void LoadURL(const GURL& url); | 38 void LoadURL(const GURL& url); |
39 void GoBackOrForward(int offset); | 39 void GoBackOrForward(int offset); |
40 void Reload(); | 40 void Reload(); |
41 void Stop(); | 41 void Stop(); |
42 void UpdateNavigationControls(); | 42 void UpdateNavigationControls(); |
43 | 43 |
| 44 void SetDumpAsText(bool dump_as_text); |
| 45 |
44 // Do one time initialization at application startup. | 46 // Do one time initialization at application startup. |
45 static void PlatformInitialize(); | 47 static void PlatformInitialize(); |
46 | 48 |
47 // This is called indirectly by the modules that need access resources. | 49 // This is called indirectly by the modules that need access resources. |
48 static base::StringPiece PlatformResourceProvider(int key); | 50 static base::StringPiece PlatformResourceProvider(int key); |
49 | 51 |
50 static Shell* CreateNewWindow(content::BrowserContext* browser_context, | 52 static Shell* CreateNewWindow(content::BrowserContext* browser_context, |
51 const GURL& url, | 53 const GURL& url, |
52 SiteInstance* site_instance, | 54 SiteInstance* site_instance, |
53 int routing_id, | 55 int routing_id, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 void PlatformEnableUIControl(UIControl control, bool is_enabled); | 94 void PlatformEnableUIControl(UIControl control, bool is_enabled); |
93 // Updates the url in the url bar. | 95 // Updates the url in the url bar. |
94 void PlatformSetAddressBarURL(const GURL& url); | 96 void PlatformSetAddressBarURL(const GURL& url); |
95 // Sets whether the spinner is spinning. | 97 // Sets whether the spinner is spinning. |
96 void PlatformSetIsLoading(bool loading); | 98 void PlatformSetIsLoading(bool loading); |
97 | 99 |
98 gfx::NativeView GetContentView(); | 100 gfx::NativeView GetContentView(); |
99 | 101 |
100 // content::WebContentsDelegate | 102 // content::WebContentsDelegate |
101 virtual void LoadingStateChanged(WebContents* source) OVERRIDE; | 103 virtual void LoadingStateChanged(WebContents* source) OVERRIDE; |
| 104 virtual void DidFinishLoad(WebContents* source) OVERRIDE; |
102 virtual void WebContentsCreated(WebContents* source_contents, | 105 virtual void WebContentsCreated(WebContents* source_contents, |
103 int64 source_frame_id, | 106 int64 source_frame_id, |
104 const GURL& target_url, | 107 const GURL& target_url, |
105 WebContents* new_contents) OVERRIDE; | 108 WebContents* new_contents) OVERRIDE; |
106 virtual void DidNavigateMainFramePostCommit(WebContents* tab) OVERRIDE; | 109 virtual void DidNavigateMainFramePostCommit(WebContents* tab) OVERRIDE; |
107 virtual void UpdatePreferredSize(WebContents* source, | 110 virtual void UpdatePreferredSize(WebContents* source, |
108 const gfx::Size& pref_size) OVERRIDE; | 111 const gfx::Size& pref_size) OVERRIDE; |
109 | 112 |
110 #if defined(OS_WIN) | 113 #if defined(OS_WIN) |
111 static ATOM RegisterWindowClass(); | 114 static ATOM RegisterWindowClass(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 GtkWidget* spinner_; | 147 GtkWidget* spinner_; |
145 GtkToolItem* spinner_item_; | 148 GtkToolItem* spinner_item_; |
146 | 149 |
147 int content_width_; | 150 int content_width_; |
148 int content_height_; | 151 int content_height_; |
149 #endif | 152 #endif |
150 | 153 |
151 // A container of all the open windows. We use a vector so we can keep track | 154 // A container of all the open windows. We use a vector so we can keep track |
152 // of ordering. | 155 // of ordering. |
153 static std::vector<Shell*> windows_; | 156 static std::vector<Shell*> windows_; |
| 157 |
| 158 // True if we should dump the page as text once it finished loading. |
| 159 bool dump_as_text_; |
154 }; | 160 }; |
155 | 161 |
156 } // namespace content | 162 } // namespace content |
157 | 163 |
158 #endif // CONTENT_SHELL_SHELL_H_ | 164 #endif // CONTENT_SHELL_SHELL_H_ |
OLD | NEW |