diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-19 01:58:51 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-19 01:58:51 +0000 |
commit | 3332977cf064c71b0d25f83bc6e35d8856059d56 (patch) | |
tree | ad9443a60d95c2e48f39c0c75a63562b19f9601a /chrome/browser/gtk/status_bubble_gtk.cc | |
parent | b26c6df09911b5cba8b944bb8dc75ffd479b37ad (diff) | |
download | chromium_src-3332977cf064c71b0d25f83bc6e35d8856059d56.zip chromium_src-3332977cf064c71b0d25f83bc6e35d8856059d56.tar.gz chromium_src-3332977cf064c71b0d25f83bc6e35d8856059d56.tar.bz2 |
Revert 18730 in attempt to repair Linux UI build bustage.
tbr=tc
Review URL: http://codereview.chromium.org/132055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18782 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/status_bubble_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/status_bubble_gtk.cc | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/chrome/browser/gtk/status_bubble_gtk.cc b/chrome/browser/gtk/status_bubble_gtk.cc index 6bceeb2..7b377b1 100644 --- a/chrome/browser/gtk/status_bubble_gtk.cc +++ b/chrome/browser/gtk/status_bubble_gtk.cc @@ -6,7 +6,6 @@ #include <gtk/gtk.h> -#include "app/gfx/text_elider.h" #include "base/gfx/gtk_util.h" #include "base/message_loop.h" #include "base/string_util.h" @@ -42,15 +41,14 @@ StatusBubbleGtk::~StatusBubbleGtk() { } void StatusBubbleGtk::SetStatus(const std::string& status) { - if (status_text_ == status) + if (status.empty()) { + HideInASecond(); return; - - status_text_ = status; - if (!status_text_.empty()) { - UpdateWidgetText(status_text_); - } else { - UpdateWidgetText(url_text_); } + + gtk_label_set_text(GTK_LABEL(label_), status.c_str()); + + Show(); } void StatusBubbleGtk::SetStatus(const std::wstring& status) { @@ -58,34 +56,7 @@ void StatusBubbleGtk::SetStatus(const std::wstring& status) { } void StatusBubbleGtk::SetURL(const GURL& url, const std::wstring& languages) { - // If we want to clear a displayed URL but there is a status still to - // display, display that status instead. - if (url.is_empty() && !status_text_.empty()) { - url_text_.clear(); - UpdateWidgetText(status_text_); - return; - } - - // Set Elided Text corresponding to the GURL object. We limit the width of - // the URL to a third of the width of the browser window (matching the width - // on windows). - GdkWindow* window = gtk_widget_get_parent_window(container_.get()); - int window_width; - gdk_drawable_get_size(GDK_DRAWABLE(window), &window_width, NULL); - // TODO(tc): We don't actually use gfx::Font as the font in the status - // bubble. We should extend gfx::ElideUrl to take some sort of pango font. - url_text_ = WideToUTF8(gfx::ElideUrl(url, gfx::Font(), window_width / 3, - languages)); - UpdateWidgetText(url_text_); -} - -void StatusBubbleGtk::UpdateWidgetText(const std::string& text) { - if (text.empty()) { - HideInASecond(); - } else { - gtk_label_set_text(GTK_LABEL(label_), text.c_str()); - Show(); - } + SetStatus(url.possibly_invalid_spec()); } void StatusBubbleGtk::Show() { |