Chromium Code Reviews| Index: chrome/browser/ui/alternate_error_tab_observer.h |
| diff --git a/chrome/browser/ui/alternate_error_tab_observer.h b/chrome/browser/ui/alternate_error_tab_observer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..dbfb71c6fcc0077217aa4ab484cb34744cf01b2d |
| --- /dev/null |
| +++ b/chrome/browser/ui/alternate_error_tab_observer.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_ALTERNATE_ERROR_TAB_OBSERVER_H_ |
| +#define CHROME_BROWSER_UI_ALTERNATE_ERROR_TAB_OBSERVER_H_ |
| +#pragma once |
| + |
| +#include "chrome/browser/prefs/pref_change_registrar.h" |
| +#include "content/browser/tab_contents/tab_contents_observer.h" |
| +#include "content/public/browser/notification_registrar.h" |
| + |
| +class TabContentsWrapper; |
| + |
| +// Per-tab class to handle functionality that is core to the operation of tabs. |
|
Jói
2011/12/09 12:36:47
I think this is copy-pasted from the original chan
Avi (use Gerrit)
2011/12/09 16:12:11
Indeed.
|
| +class AlternateErrorPageTabObserver : public TabContentsObserver, |
| + public content::NotificationObserver { |
| + public: |
| + explicit AlternateErrorPageTabObserver(TabContentsWrapper* wrapper); |
| + virtual ~AlternateErrorPageTabObserver(); |
| + |
| + static void RegisterUserPrefs(PrefService* prefs); |
| + |
| + private: |
| + // TabContentsObserver overrides: |
| + virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; |
| + |
| + // content::NotificationObserver overrides: |
| + virtual void Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) OVERRIDE; |
| + |
| + // Internal helpers ---------------------------------------------------------- |
| + |
| + // Returns the server that can provide alternate error pages. If the returned |
| + // URL is empty, the default error page built into WebKit will be used. |
| + GURL GetAlternateErrorPageURL() const; |
| + |
| + // Send the alternate error page URL to the renderer. |
| + void UpdateAlternateErrorPageURL(RenderViewHost* rvh); |
| + |
| + // Our owning TabContentsWrapper. |
| + TabContentsWrapper* wrapper_; |
| + |
| + content::NotificationRegistrar registrar_; |
| + PrefChangeRegistrar pref_change_registrar_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AlternateErrorPageTabObserver); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_ALTERNATE_ERROR_TAB_OBSERVER_H_ |