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

Unified Diff: chrome/browser/ui/views/status_bubble_views.cc

Issue 7686015: ui: Pass the parameter |languages| of StatusBubble::SetURL() as std::string. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/status_bubble_views.cc
diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc
index d57e1d51ff22358de5312321067b12f031a0ec66..4569a514099aaacefdd47903701c879ea3e1264f 100644
--- a/chrome/browser/ui/views/status_bubble_views.cc
+++ b/chrome/browser/ui/views/status_bubble_views.cc
@@ -621,9 +621,9 @@ void StatusBubbleViews::SetStatus(const string16& status_text) {
}
}
-void StatusBubbleViews::SetURL(const GURL& url, const string16& languages) {
- languages_ = languages;
+void StatusBubbleViews::SetURL(const GURL& url, const std::string& languages) {
url_ = url;
+ languages_ = languages;
if (size_.IsEmpty())
return; // We have no bounds, don't attempt to show the popup.
@@ -648,11 +648,10 @@ void StatusBubbleViews::SetURL(const GURL& url, const string16& languages) {
gfx::Rect popup_bounds = popup_->GetWindowScreenBounds();
int text_width = static_cast<int>(popup_bounds.width() -
(kShadowThickness * 2) - kTextPositionX - kTextHorizPadding - 1);
- url_text_ = ui::ElideUrl(url, view_->Label::font(),
- text_width, UTF16ToUTF8(languages));
+ url_text_ = ui::ElideUrl(url, view_->Label::font(), text_width, languages);
std::wstring original_url_text =
- UTF16ToWideHack(net::FormatUrl(url, UTF16ToUTF8(languages)));
+ UTF16ToWideHack(net::FormatUrl(url, languages));
// An URL is always treated as a left-to-right string. On right-to-left UIs
// we need to explicitly mark the URL as LTR to make sure it is displayed
@@ -803,7 +802,7 @@ void StatusBubbleViews::ExpandBubble() {
gfx::Rect popup_bounds = popup_->GetWindowScreenBounds();
int max_status_bubble_width = GetMaxStatusBubbleWidth();
url_text_ = ui::ElideUrl(url_, view_->Label::font(),
- max_status_bubble_width, UTF16ToUTF8(languages_));
+ max_status_bubble_width, languages_);
int expanded_bubble_width =std::max(GetStandardStatusBubbleWidth(),
std::min(view_->Label::font().GetStringWidth(url_text_) +
(kShadowThickness * 2) + kTextPositionX +

Powered by Google App Engine
This is Rietveld 408576698