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

Side by Side Diff: webkit/glue/webview_impl.cc

Issue 173265: Bugfix for 2932 (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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 | « chrome/renderer/render_view.cc ('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 // Copyright (c) 2007-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2007-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 MSVC_PUSH_WARNING_LEVEL(0); 9 MSVC_PUSH_WARNING_LEVEL(0);
10 #include "CSSStyleSelector.h" 10 #include "CSSStyleSelector.h"
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1398 void WebViewImpl::SetInspectorSettings(const std::wstring& settings) { 1398 void WebViewImpl::SetInspectorSettings(const std::wstring& settings) {
1399 inspector_settings_ = settings; 1399 inspector_settings_ = settings;
1400 } 1400 }
1401 1401
1402 // Set the encoding of the current main frame to the one selected by 1402 // Set the encoding of the current main frame to the one selected by
1403 // a user in the encoding menu. 1403 // a user in the encoding menu.
1404 void WebViewImpl::SetPageEncoding(const std::string& encoding_name) { 1404 void WebViewImpl::SetPageEncoding(const std::string& encoding_name) {
1405 if (!page_.get()) 1405 if (!page_.get())
1406 return; 1406 return;
1407 1407
1408 if (!encoding_name.empty()) { 1408 // Only change override encoding, don't change default encoding.
1409 // only change override encoding, don't change default encoding 1409 // Note that the new encoding must be NULL if it isn't supposed to be set.
1410 // TODO(brettw) use std::string for encoding names. 1410 String new_encoding_name;
1411 String new_encoding_name(webkit_glue::StdStringToString(encoding_name)); 1411 if (!encoding_name.empty())
1412 page_->mainFrame()->loader()->reloadWithOverrideEncoding(new_encoding_name); 1412 new_encoding_name = webkit_glue::StdStringToString(encoding_name);
1413 } 1413 page_->mainFrame()->loader()->reloadWithOverrideEncoding(new_encoding_name);
1414 } 1414 }
1415 1415
1416 // Return the canonical encoding name of current main webframe in webview. 1416 // Return the canonical encoding name of current main webframe in webview.
1417 std::string WebViewImpl::GetMainFrameEncodingName() { 1417 std::string WebViewImpl::GetMainFrameEncodingName() {
1418 if (!page_.get()) 1418 if (!page_.get())
1419 return std::string(); 1419 return std::string();
1420 1420
1421 String encoding_name = page_->mainFrame()->loader()->encoding(); 1421 String encoding_name = page_->mainFrame()->loader()->encoding();
1422 return webkit_glue::StringToStdString(encoding_name); 1422 return webkit_glue::StringToStdString(encoding_name);
1423 } 1423 }
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 1897
1898 return document->focusedNode(); 1898 return document->focusedNode();
1899 } 1899 }
1900 1900
1901 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) { 1901 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) {
1902 IntPoint doc_point( 1902 IntPoint doc_point(
1903 page_->mainFrame()->view()->windowToContents(pos)); 1903 page_->mainFrame()->view()->windowToContents(pos));
1904 return page_->mainFrame()->eventHandler()-> 1904 return page_->mainFrame()->eventHandler()->
1905 hitTestResultAtPoint(doc_point, false); 1905 hitTestResultAtPoint(doc_point, false);
1906 } 1906 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698