summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-03 21:45:06 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-03 21:45:06 +0000
commit37d39aa90e3121030f129407a82d53e50a85837d (patch)
tree1be396760ac136abcd0d1397b3d8b8a127c59bc0
parent340943147a0cae34ab3dd20f0b97def51abab24e (diff)
downloadchromium_src-37d39aa90e3121030f129407a82d53e50a85837d.zip
chromium_src-37d39aa90e3121030f129407a82d53e50a85837d.tar.gz
chromium_src-37d39aa90e3121030f129407a82d53e50a85837d.tar.bz2
Remove the deprecated version of FixupURL and fix the callers.
BUG=None TEST=None Review URL: http://codereview.chromium.org/455022 Patch from tfarina. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33728 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/preferences_window_controller.mm15
-rw-r--r--chrome/browser/gtk/bookmark_editor_gtk.cc5
-rw-r--r--chrome/browser/net/url_fixer_upper.cc4
-rw-r--r--chrome/browser/net/url_fixer_upper.h3
-rw-r--r--chrome/browser/views/bookmark_editor_view.cc3
-rw-r--r--chrome/browser/views/options/general_page_view.cc6
-rw-r--r--chrome/browser/views/url_picker.cc2
7 files changed, 14 insertions, 24 deletions
diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm
index bcfb2f1..dbedda9a 100644
--- a/chrome/browser/cocoa/preferences_window_controller.mm
+++ b/chrome/browser/cocoa/preferences_window_controller.mm
@@ -48,9 +48,8 @@
namespace {
-std::wstring GetNewTabUIURLString() {
- std::wstring temp = UTF8ToWide(chrome::kChromeUINewTabURL);
- return URLFixerUpper::FixupURL(temp, std::wstring());
+std::string GetNewTabUIURLString() {
+ return URLFixerUpper::FixupURL(chrome::kChromeUINewTabURL, std::string());
}
// Helper to remove all but the last view from the view heirarchy.
@@ -785,12 +784,12 @@ class PrefObserverBridge : public NotificationObserver,
// observers not to fire, which is actually a good thing as we could end up in a
// state where setting the homepage to an empty url would automatically reset
// the prefs back to using the NTP, so we'd be never be able to change it.
-- (void)setHomepage:(const std::wstring&)homepage {
+- (void)setHomepage:(const std::string&)homepage {
if (homepage.empty() || homepage == GetNewTabUIURLString()) {
newTabPageIsHomePage_.SetValue(true);
} else {
newTabPageIsHomePage_.SetValue(false);
- homepage_.SetValue(homepage);
+ homepage_.SetValue(UTF8ToWide(homepage));
}
}
@@ -993,9 +992,9 @@ enum { kHomepageNewTabPage, kHomepageURL };
// to something valid ("http://google.com").
if (!urlString)
urlString = [NSString stringWithFormat:@"%s", chrome::kChromeUINewTabURL];
- std::wstring temp = base::SysNSStringToWide(urlString);
- std::wstring fixedString = URLFixerUpper::FixupURL(temp, std::wstring());
- if (GURL(WideToUTF8(fixedString)).is_valid())
+ std::string temp = base::SysNSStringToUTF8(urlString);
+ std::string fixedString = URLFixerUpper::FixupURL(temp, std::string());
+ if (GURL(fixedString).is_valid())
[self setHomepage:fixedString];
}
diff --git a/chrome/browser/gtk/bookmark_editor_gtk.cc b/chrome/browser/gtk/bookmark_editor_gtk.cc
index 6b32462..6dd3957 100644
--- a/chrome/browser/gtk/bookmark_editor_gtk.cc
+++ b/chrome/browser/gtk/bookmark_editor_gtk.cc
@@ -282,9 +282,8 @@ GURL BookmarkEditorGtk::GetInputURL() const {
if (!url_entry_)
return GURL(); // Happens when we're editing a folder.
- std::wstring input = URLFixerUpper::FixupURL(
- UTF8ToWide(gtk_entry_get_text(GTK_ENTRY(url_entry_))), L"");
- return GURL(WideToUTF8(input));
+ return GURL(URLFixerUpper::FixupURL(
+ gtk_entry_get_text(GTK_ENTRY(url_entry_)), ""));
}
std::wstring BookmarkEditorGtk::GetInputTitle() const {
diff --git a/chrome/browser/net/url_fixer_upper.cc b/chrome/browser/net/url_fixer_upper.cc
index a68bc34..6909ddf 100644
--- a/chrome/browser/net/url_fixer_upper.cc
+++ b/chrome/browser/net/url_fixer_upper.cc
@@ -578,10 +578,6 @@ wstring URLFixerUpper::SegmentURL(const wstring& text,
UTF8PartsToWideParts(text_utf8, parts_utf8, parts);
return UTF8ToWide(scheme_utf8);
}
-wstring URLFixerUpper::FixupURL(const wstring& text,
- const wstring& desired_tld) {
- return UTF8ToWide(FixupURL(WideToUTF8(text), WideToUTF8(desired_tld)));
-}
wstring URLFixerUpper::FixupRelativeFile(const wstring& base_dir,
const wstring& text) {
return UTF8ToWide(FixupRelativeFile(FilePath::FromWStringHack(base_dir),
diff --git a/chrome/browser/net/url_fixer_upper.h b/chrome/browser/net/url_fixer_upper.h
index 9a4b35b..29e6432 100644
--- a/chrome/browser/net/url_fixer_upper.h
+++ b/chrome/browser/net/url_fixer_upper.h
@@ -42,9 +42,6 @@ namespace URLFixerUpper {
// instead of ".com").
std::string FixupURL(const std::string& text,
const std::string& desired_tld);
- // Deprecated temporary compatibility function.
- std::wstring FixupURL(const std::wstring& text,
- const std::wstring& desired_tld);
// Converts |text| to a fixed-up URL, allowing it to be a relative path on
// the local filesystem. Begin searching in |base_dir|; if empty, use the
diff --git a/chrome/browser/views/bookmark_editor_view.cc b/chrome/browser/views/bookmark_editor_view.cc
index c3f8049b..8dc3906 100644
--- a/chrome/browser/views/bookmark_editor_view.cc
+++ b/chrome/browser/views/bookmark_editor_view.cc
@@ -413,8 +413,7 @@ void BookmarkEditorView::Reset() {
}
}
GURL BookmarkEditorView::GetInputURL() const {
- std::wstring input = URLFixerUpper::FixupURL(url_tf_.text(), L"");
- return GURL(input);
+ return GURL(URLFixerUpper::FixupURL(UTF16ToUTF8(url_tf_.text()), ""));
}
std::wstring BookmarkEditorView::GetInputTitle() const {
diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc
index 966144f..a6efdca 100644
--- a/chrome/browser/views/options/general_page_view.cc
+++ b/chrome/browser/views/options/general_page_view.cc
@@ -502,10 +502,10 @@ void GeneralPageView::ContentsChanged(views::Textfield* sender,
// If the text field contains a valid URL, sync it to prefs. We run it
// through the fixer upper to allow input like "google.com" to be converted
// to something valid ("http://google.com").
- std::wstring url_string = URLFixerUpper::FixupURL(
- homepage_use_url_textfield_->text(), std::wstring());
+ std::string url_string = URLFixerUpper::FixupURL(
+ UTF16ToUTF8(homepage_use_url_textfield_->text()), std::string());
if (GURL(url_string).is_valid())
- SetHomepage(url_string);
+ SetHomepage(UTF8ToWide(url_string));
}
}
diff --git a/chrome/browser/views/url_picker.cc b/chrome/browser/views/url_picker.cc
index 0133dbd..190411d 100644
--- a/chrome/browser/views/url_picker.cc
+++ b/chrome/browser/views/url_picker.cc
@@ -313,5 +313,5 @@ void UrlPicker::OnDoubleClick() {
}
GURL UrlPicker::GetInputURL() const {
- return GURL(URLFixerUpper::FixupURL(url_field_->text(), L""));
+ return GURL(URLFixerUpper::FixupURL(UTF16ToUTF8(url_field_->text()), ""));
}