Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2564)

Unified Diff: chrome/browser/web_contents.h

Issue 7647: Character encoding override (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tab_contents.h ('k') | chrome/browser/web_contents.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_contents.h
===================================================================
--- chrome/browser/web_contents.h (revision 3674)
+++ chrome/browser/web_contents.h (working copy)
@@ -72,6 +72,11 @@
bool is_starred() const { return is_starred_; }
+ const std::wstring& encoding() const { return encoding_; }
+ void set_encoding(const std::wstring& encoding) {
+ encoding_ = encoding;
+ }
+
// TabContents (public overrides) --------------------------------------------
virtual void Destroy();
@@ -188,6 +193,16 @@
// Returns true if this WebContents will notify about disconnection.
bool notify_disconnection() const { return notify_disconnection_; }
+ // Override the encoding and reload the page by sending down
+ // ViewMsg_SetPageEncoding to the renderer. |UpdateEncoding| is kinda
+ // the opposite of this, by which 'browser' is notified of
+ // the encoding of the current tab from 'renderer' (determined by
+ // auto-detect, http header, meta, bom detection, etc).
+ void override_encoding(const std::wstring& encoding) {
+ set_encoding(encoding);
+ render_view_host()->SetPageEncoding(encoding);
+ }
+
protected:
// Should be deleted via CloseContents.
virtual ~WebContents();
@@ -219,7 +234,7 @@
int32 page_id,
const std::wstring& title);
virtual void UpdateEncoding(RenderViewHost* render_view_host,
- const std::wstring& encoding_name);
+ const std::wstring& encoding);
virtual void UpdateTargetURL(int32 page_id, const GURL& url);
virtual void UpdateThumbnail(const GURL& url,
const SkBitmap& bitmap,
@@ -362,6 +377,7 @@
GearsCreateShortcutCallbackFunctor* callback_functor;
};
+
// NotificationObserver ------------------------------------------------------
virtual void Observe(NotificationType type,
@@ -521,6 +537,9 @@
// used to check whether we can do something for some special contents.
std::string contents_mime_type_;
+ // Character encoding. TODO(jungshik) : convert to std::string
+ std::wstring encoding_;
+
PendingInstall pending_install_;
// The last time that the download shelf was made visible.
« no previous file with comments | « chrome/browser/tab_contents.h ('k') | chrome/browser/web_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698