OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ | 5 #ifndef CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ |
6 #define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ | 6 #define CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "chrome/browser/prefs/pref_change_registrar.h" |
15 #include "chrome/browser/printing/print_view_manager.h" | 16 #include "chrome/browser/printing/print_view_manager.h" |
16 #include "content/browser/tab_contents/tab_contents.h" | 17 #include "content/browser/tab_contents/tab_contents.h" |
17 #include "content/browser/tab_contents/tab_contents_observer.h" | 18 #include "content/browser/tab_contents/tab_contents_observer.h" |
18 #include "content/common/notification_registrar.h" | 19 #include "content/common/notification_registrar.h" |
19 | 20 |
20 namespace prerender { | 21 namespace prerender { |
21 class PrerenderObserver; | 22 class PrerenderObserver; |
22 } | 23 } |
23 | 24 |
24 namespace printing { | 25 namespace printing { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 return translate_tab_helper_.get(); | 168 return translate_tab_helper_.get(); |
168 } | 169 } |
169 | 170 |
170 prerender::PrerenderObserver* prerender_observer() { | 171 prerender::PrerenderObserver* prerender_observer() { |
171 return prerender_observer_.get(); | 172 return prerender_observer_.get(); |
172 } | 173 } |
173 | 174 |
174 // Overrides ----------------------------------------------------------------- | 175 // Overrides ----------------------------------------------------------------- |
175 | 176 |
176 // TabContentsObserver overrides: | 177 // TabContentsObserver overrides: |
| 178 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |
177 virtual void RenderViewGone() OVERRIDE; | 179 virtual void RenderViewGone() OVERRIDE; |
178 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 180 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
179 | 181 |
180 // NotificationObserver overrides: | 182 // NotificationObserver overrides: |
181 virtual void Observe(NotificationType type, | 183 virtual void Observe(NotificationType type, |
182 const NotificationSource& source, | 184 const NotificationSource& source, |
183 const NotificationDetails& details) OVERRIDE; | 185 const NotificationDetails& details) OVERRIDE; |
184 | 186 |
185 // Infobars ------------------------------------------------------------------ | 187 // Infobars ------------------------------------------------------------------ |
186 | 188 |
(...skipping 19 matching lines...) Expand all Loading... |
206 // Internal helpers ---------------------------------------------------------- | 208 // Internal helpers ---------------------------------------------------------- |
207 | 209 |
208 // Message handlers. | 210 // Message handlers. |
209 void OnJSOutOfMemory(); | 211 void OnJSOutOfMemory(); |
210 void OnRegisterProtocolHandler(const std::string& protocol, | 212 void OnRegisterProtocolHandler(const std::string& protocol, |
211 const GURL& url, | 213 const GURL& url, |
212 const string16& title); | 214 const string16& title); |
213 void OnSnapshot(const SkBitmap& bitmap); | 215 void OnSnapshot(const SkBitmap& bitmap); |
214 void OnPDFHasUnsupportedFeature(); | 216 void OnPDFHasUnsupportedFeature(); |
215 | 217 |
| 218 // Returns the server that can provide alternate error pages. If the returned |
| 219 // URL is empty, the default error page built into WebKit will be used. |
| 220 GURL GetAlternateErrorPageURL() const; |
| 221 |
| 222 // Send the alternate error page URL to the renderer. |
| 223 void UpdateAlternateErrorPageURL(RenderViewHost* rvh); |
| 224 |
| 225 // Update the RenderView's WebPreferences. |
| 226 void UpdateWebPreferences(); |
| 227 |
| 228 // Update the TabContents's RendererPreferences. |
| 229 void UpdateRendererPreferences(); |
| 230 |
216 // Data for core operation --------------------------------------------------- | 231 // Data for core operation --------------------------------------------------- |
217 | 232 |
218 // Delegate for notifying our owner about stuff. Not owned by us. | 233 // Delegate for notifying our owner about stuff. Not owned by us. |
219 TabContentsWrapperDelegate* delegate_; | 234 TabContentsWrapperDelegate* delegate_; |
220 | 235 |
221 // Delegates for InfoBars associated with this TabContentsWrapper. | 236 // Delegates for InfoBars associated with this TabContentsWrapper. |
222 std::vector<InfoBarDelegate*> infobar_delegates_; | 237 std::vector<InfoBarDelegate*> infobar_delegates_; |
223 bool infobars_enabled_; | 238 bool infobars_enabled_; |
224 | 239 |
225 NotificationRegistrar registrar_; | 240 NotificationRegistrar registrar_; |
| 241 PrefChangeRegistrar pref_change_registrar_; |
226 | 242 |
227 // Data for current page ----------------------------------------------------- | 243 // Data for current page ----------------------------------------------------- |
228 | 244 |
229 // Shows an info-bar to users when they search from a known search engine and | 245 // Shows an info-bar to users when they search from a known search engine and |
230 // have never used the omnibox for search before. | 246 // have never used the omnibox for search before. |
231 scoped_ptr<OmniboxSearchHint> omnibox_search_hint_; | 247 scoped_ptr<OmniboxSearchHint> omnibox_search_hint_; |
232 | 248 |
233 // Tab Helpers --------------------------------------------------------------- | 249 // Tab Helpers --------------------------------------------------------------- |
234 // (These provide API for callers and have a getter function listed in the | 250 // (These provide API for callers and have a getter function listed in the |
235 // "Tab Helpers" section in the member functions area, above.) | 251 // "Tab Helpers" section in the member functions area, above.) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 297 |
282 // The supporting objects need to outlive the TabContents dtor (as they may | 298 // The supporting objects need to outlive the TabContents dtor (as they may |
283 // be called upon during its execution). As a result, this must come last | 299 // be called upon during its execution). As a result, this must come last |
284 // in the list. | 300 // in the list. |
285 scoped_ptr<TabContents> tab_contents_; | 301 scoped_ptr<TabContents> tab_contents_; |
286 | 302 |
287 DISALLOW_COPY_AND_ASSIGN(TabContentsWrapper); | 303 DISALLOW_COPY_AND_ASSIGN(TabContentsWrapper); |
288 }; | 304 }; |
289 | 305 |
290 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ | 306 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_TAB_CONTENTS_WRAPPER_H_ |
OLD | NEW |