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