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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 22909053: Store the Document's encoding on the Document (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Set document encoding in DecodedDataDocumentParser instead of DocumentWriter Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/WebPageSerializerImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 2531 matching lines...) Expand 10 before | Expand all | Expand 10 after
2542 2542
2543 WebString WebViewImpl::pageEncoding() const 2543 WebString WebViewImpl::pageEncoding() const
2544 { 2544 {
2545 if (!m_page) 2545 if (!m_page)
2546 return WebString(); 2546 return WebString();
2547 2547
2548 // FIXME: Is this check needed? 2548 // FIXME: Is this check needed?
2549 if (!m_page->mainFrame()->document()->loader()) 2549 if (!m_page->mainFrame()->document()->loader())
2550 return WebString(); 2550 return WebString();
2551 2551
2552 return m_page->mainFrame()->document()->encoding(); 2552 return m_page->mainFrame()->document()->encodingName();
2553 } 2553 }
2554 2554
2555 void WebViewImpl::setPageEncoding(const WebString& encodingName) 2555 void WebViewImpl::setPageEncoding(const WebString& encodingName)
2556 { 2556 {
2557 if (!m_page) 2557 if (!m_page)
2558 return; 2558 return;
2559 2559
2560 // Only change override encoding, don't change default encoding. 2560 // Only change override encoding, don't change default encoding.
2561 // Note that the new encoding must be 0 if it isn't supposed to be set. 2561 // Note that the new encoding must be 0 if it isn't supposed to be set.
2562 String newEncodingName; 2562 String newEncodingName;
(...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after
4118 } 4118 }
4119 4119
4120 bool WebViewImpl::shouldDisableDesktopWorkarounds() 4120 bool WebViewImpl::shouldDisableDesktopWorkarounds()
4121 { 4121 {
4122 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); 4122 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments();
4123 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom 4123 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom
4124 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); 4124 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto);
4125 } 4125 }
4126 4126
4127 } // namespace WebKit 4127 } // namespace WebKit
OLDNEW
« no previous file with comments | « Source/web/WebPageSerializerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698