| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2007 Google Inc. All Rights Reserved. | 2 * Copyright 2007 Google Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * ***** BEGIN LICENSE BLOCK ***** | 6 * ***** BEGIN LICENSE BLOCK ***** |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 // Set the encoding of the current main frame to the one selected by | 1277 // Set the encoding of the current main frame to the one selected by |
| 1278 // a user in the encoding menu. | 1278 // a user in the encoding menu. |
| 1279 void WebViewImpl::SetPageEncoding(const std::wstring& encoding_name) { | 1279 void WebViewImpl::SetPageEncoding(const std::wstring& encoding_name) { |
| 1280 if (!page_.get()) | 1280 if (!page_.get()) |
| 1281 return; | 1281 return; |
| 1282 | 1282 |
| 1283 if (!encoding_name.empty()) { | 1283 if (!encoding_name.empty()) { |
| 1284 // only change override encoding, don't change default encoding | 1284 // only change override encoding, don't change default encoding |
| 1285 // TODO(brettw) use std::string for encoding names. | 1285 // TODO(brettw) use std::string for encoding names. |
| 1286 String new_encoding_name(webkit_glue::StdWStringToString(encoding_name)); | 1286 String new_encoding_name(webkit_glue::StdWStringToString(encoding_name)); |
| 1287 page_->mainFrame()->loader()->reloadAllowingStaleData(new_encoding_name); | 1287 page_->mainFrame()->loader()->reloadWithOverrideEncoding(new_encoding_name); |
| 1288 } | 1288 } |
| 1289 } | 1289 } |
| 1290 | 1290 |
| 1291 // Return the canonical encoding name of current main webframe in webview. | 1291 // Return the canonical encoding name of current main webframe in webview. |
| 1292 std::wstring WebViewImpl::GetMainFrameEncodingName() { | 1292 std::wstring WebViewImpl::GetMainFrameEncodingName() { |
| 1293 if (!page_.get()) | 1293 if (!page_.get()) |
| 1294 return std::wstring(); | 1294 return std::wstring(); |
| 1295 | 1295 |
| 1296 String encoding_name = page_->mainFrame()->loader()->encoding(); | 1296 String encoding_name = page_->mainFrame()->loader()->encoding(); |
| 1297 return webkit_glue::StringToStdWString(encoding_name); | 1297 return webkit_glue::StringToStdWString(encoding_name); |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1628 Frame* frame = page_->focusController()->focusedFrame(); | 1628 Frame* frame = page_->focusController()->focusedFrame(); |
| 1629 if (!frame) | 1629 if (!frame) |
| 1630 return NULL; | 1630 return NULL; |
| 1631 | 1631 |
| 1632 Document* document = frame->document(); | 1632 Document* document = frame->document(); |
| 1633 if (!document) | 1633 if (!document) |
| 1634 return NULL; | 1634 return NULL; |
| 1635 | 1635 |
| 1636 return document->focusedNode(); | 1636 return document->focusedNode(); |
| 1637 } | 1637 } |
| OLD | NEW |