summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc31
-rw-r--r--chrome/browser/tab_contents/tab_contents.h5
2 files changed, 19 insertions, 17 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 3dba1a8..65e24e2 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -719,40 +719,41 @@ bool TabContents::ShouldDisplayFavIcon() {
return true;
}
-std::wstring TabContents::GetStatusText() const {
+string16 TabContents::GetStatusText() const {
if (!is_loading() || load_state_ == net::LOAD_STATE_IDLE)
- return std::wstring();
+ return string16();
switch (load_state_) {
case net::LOAD_STATE_WAITING_FOR_CACHE:
- return l10n_util::GetString(IDS_LOAD_STATE_WAITING_FOR_CACHE);
+ return l10n_util::GetStringUTF16(IDS_LOAD_STATE_WAITING_FOR_CACHE);
case net::LOAD_STATE_ESTABLISHING_PROXY_TUNNEL:
- return l10n_util::GetString(IDS_LOAD_STATE_ESTABLISHING_PROXY_TUNNEL);
+ return
+ l10n_util::GetStringUTF16(IDS_LOAD_STATE_ESTABLISHING_PROXY_TUNNEL);
case net::LOAD_STATE_RESOLVING_PROXY_FOR_URL:
- return l10n_util::GetString(IDS_LOAD_STATE_RESOLVING_PROXY_FOR_URL);
+ return l10n_util::GetStringUTF16(IDS_LOAD_STATE_RESOLVING_PROXY_FOR_URL);
case net::LOAD_STATE_RESOLVING_HOST:
- return l10n_util::GetString(IDS_LOAD_STATE_RESOLVING_HOST);
+ return l10n_util::GetStringUTF16(IDS_LOAD_STATE_RESOLVING_HOST);
case net::LOAD_STATE_CONNECTING:
- return l10n_util::GetString(IDS_LOAD_STATE_CONNECTING);
+ return l10n_util::GetStringUTF16(IDS_LOAD_STATE_CONNECTING);
case net::LOAD_STATE_SSL_HANDSHAKE:
- return l10n_util::GetString(IDS_LOAD_STATE_SSL_HANDSHAKE);
+ return l10n_util::GetStringUTF16(IDS_LOAD_STATE_SSL_HANDSHAKE);
case net::LOAD_STATE_SENDING_REQUEST:
if (upload_size_)
- return l10n_util::GetStringF(
+ return l10n_util::GetStringFUTF16Int(
IDS_LOAD_STATE_SENDING_REQUEST_WITH_PROGRESS,
static_cast<int>((100 * upload_position_) / upload_size_));
else
- return l10n_util::GetString(IDS_LOAD_STATE_SENDING_REQUEST);
+ return l10n_util::GetStringUTF16(IDS_LOAD_STATE_SENDING_REQUEST);
case net::LOAD_STATE_WAITING_FOR_RESPONSE:
- return l10n_util::GetStringF(IDS_LOAD_STATE_WAITING_FOR_RESPONSE,
- load_state_host_);
+ return l10n_util::GetStringFUTF16(IDS_LOAD_STATE_WAITING_FOR_RESPONSE,
+ load_state_host_);
// Ignore net::LOAD_STATE_READING_RESPONSE and net::LOAD_STATE_IDLE
case net::LOAD_STATE_IDLE:
case net::LOAD_STATE_READING_RESPONSE:
break;
}
- return std::wstring();
+ return string16();
}
void TabContents::AddNavigationObserver(WebNavigationObserver* observer) {
@@ -3076,8 +3077,8 @@ void TabContents::LoadStateChanged(const GURL& url,
std::wstring languages =
UTF8ToWide(profile()->GetPrefs()->GetString(prefs::kAcceptLanguages));
std::string host = url.host();
- load_state_host_ =
- net::IDNToUnicode(host.c_str(), host.size(), languages, NULL);
+ load_state_host_ = WideToUTF16Hack(
+ net::IDNToUnicode(host.c_str(), host.size(), languages, NULL));
if (load_state_ == net::LOAD_STATE_READING_RESPONSE)
SetNotWaitingForResponse();
if (is_loading())
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h
index 3352200..a791cc1 100644
--- a/chrome/browser/tab_contents/tab_contents.h
+++ b/chrome/browser/tab_contents/tab_contents.h
@@ -14,6 +14,7 @@
#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
#include "base/scoped_ptr.h"
+#include "base/string16.h"
#include "chrome/browser/dom_ui/dom_ui_factory.h"
#include "chrome/browser/download/save_package.h"
#include "chrome/browser/extensions/image_loading_tracker.h"
@@ -260,7 +261,7 @@ class TabContents : public PageNavigator,
virtual bool ShouldDisplayFavIcon();
// Returns a human-readable description the tab's loading state.
- virtual std::wstring GetStatusText() const;
+ virtual string16 GetStatusText() const;
// Add and remove observers for page navigation notifications. Adding or
// removing multiple times has no effect. The order in which notifications
@@ -1179,7 +1180,7 @@ class TabContents : public PageNavigator,
// The current load state and the URL associated with it.
net::LoadState load_state_;
- std::wstring load_state_host_;
+ string16 load_state_host_;
// Upload progress, for displaying in the status bar.
// Set to zero when there is no significant upload happening.
uint64 upload_size_;