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

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

Issue 192017: Convert std::wstring encoding names to std::string in a bunch of files. (Closed)
Patch Set: mac and linux fixes 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
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | webkit/tools/test_shell/layout_test_controller.cc » ('j') | 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 1382 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 const std::wstring& WebViewImpl::GetInspectorSettings() const { 1393 const std::wstring& WebViewImpl::GetInspectorSettings() const {
1394 return inspector_settings_; 1394 return inspector_settings_;
1395 } 1395 }
1396 1396
1397 void WebViewImpl::SetInspectorSettings(const std::wstring& settings) { 1397 void WebViewImpl::SetInspectorSettings(const std::wstring& settings) {
1398 inspector_settings_ = settings; 1398 inspector_settings_ = settings;
1399 } 1399 }
1400 1400
1401 // Set the encoding of the current main frame to the one selected by 1401 // Set the encoding of the current main frame to the one selected by
1402 // a user in the encoding menu. 1402 // a user in the encoding menu.
1403 void WebViewImpl::SetPageEncoding(const std::wstring& encoding_name) { 1403 void WebViewImpl::SetPageEncoding(const std::string& encoding_name) {
1404 if (!page_.get()) 1404 if (!page_.get())
1405 return; 1405 return;
1406 1406
1407 if (!encoding_name.empty()) { 1407 if (!encoding_name.empty()) {
1408 // only change override encoding, don't change default encoding 1408 // only change override encoding, don't change default encoding
1409 // TODO(brettw) use std::string for encoding names. 1409 // TODO(brettw) use std::string for encoding names.
1410 String new_encoding_name(webkit_glue::StdWStringToString(encoding_name)); 1410 String new_encoding_name(webkit_glue::StdStringToString(encoding_name));
1411 page_->mainFrame()->loader()->reloadWithOverrideEncoding(new_encoding_name); 1411 page_->mainFrame()->loader()->reloadWithOverrideEncoding(new_encoding_name);
1412 } 1412 }
1413 } 1413 }
1414 1414
1415 // Return the canonical encoding name of current main webframe in webview. 1415 // Return the canonical encoding name of current main webframe in webview.
1416 std::wstring WebViewImpl::GetMainFrameEncodingName() { 1416 std::string WebViewImpl::GetMainFrameEncodingName() {
1417 if (!page_.get()) 1417 if (!page_.get())
1418 return std::wstring(); 1418 return std::string();
1419 1419
1420 String encoding_name = page_->mainFrame()->loader()->encoding(); 1420 String encoding_name = page_->mainFrame()->loader()->encoding();
1421 return webkit_glue::StringToStdWString(encoding_name); 1421 return webkit_glue::StringToStdString(encoding_name);
1422 } 1422 }
1423 1423
1424 void WebViewImpl::ZoomIn(bool text_only) { 1424 void WebViewImpl::ZoomIn(bool text_only) {
1425 Frame* frame = main_frame()->frame(); 1425 Frame* frame = main_frame()->frame();
1426 double multiplier = std::min(std::pow(kTextSizeMultiplierRatio, 1426 double multiplier = std::min(std::pow(kTextSizeMultiplierRatio,
1427 zoom_level_ + 1), 1427 zoom_level_ + 1),
1428 kMaxTextSizeMultiplier); 1428 kMaxTextSizeMultiplier);
1429 float zoom_factor = static_cast<float>(multiplier); 1429 float zoom_factor = static_cast<float>(multiplier);
1430 if (zoom_factor != frame->zoomFactor()) { 1430 if (zoom_factor != frame->zoomFactor()) {
1431 ++zoom_level_; 1431 ++zoom_level_;
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
1896 1896
1897 return document->focusedNode(); 1897 return document->focusedNode();
1898 } 1898 }
1899 1899
1900 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) { 1900 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) {
1901 IntPoint doc_point( 1901 IntPoint doc_point(
1902 page_->mainFrame()->view()->windowToContents(pos)); 1902 page_->mainFrame()->view()->windowToContents(pos));
1903 return page_->mainFrame()->eventHandler()-> 1903 return page_->mainFrame()->eventHandler()->
1904 hitTestResultAtPoint(doc_point, false); 1904 hitTestResultAtPoint(doc_point, false);
1905 } 1905 }
OLDNEW
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | webkit/tools/test_shell/layout_test_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698