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

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: Created 7 years, 4 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
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 2537 matching lines...) Expand 10 before | Expand all | Expand 10 after
2548 2548
2549 WebString WebViewImpl::pageEncoding() const 2549 WebString WebViewImpl::pageEncoding() const
2550 { 2550 {
2551 if (!m_page) 2551 if (!m_page)
2552 return WebString(); 2552 return WebString();
2553 2553
2554 // FIXME: Is this check needed? 2554 // FIXME: Is this check needed?
2555 if (!m_page->mainFrame()->document()->loader()) 2555 if (!m_page->mainFrame()->document()->loader())
2556 return WebString(); 2556 return WebString();
2557 2557
2558 return m_page->mainFrame()->document()->encoding(); 2558 return m_page->mainFrame()->document()->encodingName();
2559 } 2559 }
2560 2560
2561 void WebViewImpl::setPageEncoding(const WebString& encodingName) 2561 void WebViewImpl::setPageEncoding(const WebString& encodingName)
2562 { 2562 {
2563 if (!m_page) 2563 if (!m_page)
2564 return; 2564 return;
2565 2565
2566 // Only change override encoding, don't change default encoding. 2566 // Only change override encoding, don't change default encoding.
2567 // Note that the new encoding must be 0 if it isn't supposed to be set. 2567 // Note that the new encoding must be 0 if it isn't supposed to be set.
2568 String newEncodingName; 2568 String newEncodingName;
(...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after
4124 } 4124 }
4125 4125
4126 bool WebViewImpl::shouldDisableDesktopWorkarounds() 4126 bool WebViewImpl::shouldDisableDesktopWorkarounds()
4127 { 4127 {
4128 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); 4128 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments();
4129 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom 4129 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom
4130 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); 4130 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto);
4131 } 4131 }
4132 4132
4133 } // namespace WebKit 4133 } // namespace WebKit
OLDNEW
« Source/core/html/parser/XSSAuditor.cpp ('K') | « Source/web/WebPageSerializerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698