OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ | |
6 #define CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ | |
7 #pragma once | |
8 | |
9 #include "chrome/browser/prefs/pref_change_registrar.h" | |
10 #include "content/browser/tab_contents/tab_contents_observer.h" | |
11 #include "content/public/browser/notification_registrar.h" | |
12 | |
13 class CoreTabHelperDelegate; | |
14 class SkBitmap; | |
15 class TabContentsWrapper; | |
16 | |
17 // Per-tab class to handle functionality that is either core to the operation of | |
18 // tabs or doesn't have anywhere else to go. | |
19 class CoreTabHelper : public TabContentsObserver, | |
Jói
2011/12/08 11:23:37
Both the name of this class (...Helper) and its co
Avi (use Gerrit)
2011/12/08 15:27:38
I know.
Right now, TCW has on it random bits of f
Jói
2011/12/08 15:31:52
I'm fine with doing it this way for now, and maybe
| |
20 public content::NotificationObserver { | |
21 public: | |
22 explicit CoreTabHelper(TabContentsWrapper* wrapper); | |
23 virtual ~CoreTabHelper(); | |
24 | |
25 CoreTabHelperDelegate* delegate() const { return delegate_; } | |
26 void set_delegate(CoreTabHelperDelegate* d) { delegate_ = d; } | |
Jói
2011/12/08 11:23:37
A comment that caller must ensure lifetime of dele
Avi (use Gerrit)
2011/12/08 15:27:38
Is that comment found elsewhere with delegates? (A
Jói
2011/12/08 15:31:52
I've seen (and myself added) similar comments abou
| |
27 | |
28 static void RegisterUserPrefs(PrefService* prefs); | |
29 | |
30 // Initial title assigned to NavigationEntries from Navigate. | |
31 static string16 GetDefaultTitle(); | |
32 | |
33 // Returns a human-readable description the tab's loading state. | |
34 string16 GetStatusText() const; | |
35 | |
36 // Captures a snapshot of the page. | |
37 void CaptureSnapshot(); | |
38 | |
39 // Stop this tab rendering in fullscreen mode. | |
40 void ExitFullscreenMode(); | |
41 | |
42 private: | |
43 // TabContentsObserver overrides: | |
44 virtual void RenderViewCreated(RenderViewHost* render_view_host) OVERRIDE; | |
45 virtual void DidBecomeSelected() OVERRIDE; | |
46 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | |
47 | |
48 // content::NotificationObserver overrides: | |
49 virtual void Observe(int type, | |
50 const content::NotificationSource& source, | |
51 const content::NotificationDetails& details) OVERRIDE; | |
52 | |
53 // Internal helpers ---------------------------------------------------------- | |
54 | |
55 // Message handlers. | |
56 void OnSnapshot(const SkBitmap& bitmap); | |
57 void OnPDFHasUnsupportedFeature(); | |
58 | |
59 // Returns the server that can provide alternate error pages. If the returned | |
60 // URL is empty, the default error page built into WebKit will be used. | |
61 GURL GetAlternateErrorPageURL() const; | |
62 | |
63 // Send the alternate error page URL to the renderer. | |
64 void UpdateAlternateErrorPageURL(RenderViewHost* rvh); | |
65 | |
66 // Delegate for notifying our owner about stuff. Not owned by us. | |
67 CoreTabHelperDelegate* delegate_; | |
68 | |
69 // Our owning TabContentsWrapper. | |
70 TabContentsWrapper* wrapper_; | |
71 | |
72 content::NotificationRegistrar registrar_; | |
73 PrefChangeRegistrar pref_change_registrar_; | |
74 | |
75 DISALLOW_COPY_AND_ASSIGN(CoreTabHelper); | |
76 }; | |
77 | |
78 #endif // CHROME_BROWSER_UI_TAB_CONTENTS_CORE_TAB_HELPER_H_ | |
OLD | NEW |