Index: chrome/browser/ui/gtk/browser_titlebar.cc |
diff --git a/chrome/browser/ui/gtk/browser_titlebar.cc b/chrome/browser/ui/gtk/browser_titlebar.cc |
index 559045f725810389f225fdaa516ff0c9402ec387..35bda78c88683c98ca59ab2ca6ecce0369e53446 100644 |
--- a/chrome/browser/ui/gtk/browser_titlebar.cc |
+++ b/chrome/browser/ui/gtk/browser_titlebar.cc |
@@ -47,7 +47,6 @@ |
#include "grit/theme_resources.h" |
#include "grit/theme_resources_standard.h" |
#include "grit/ui_resources.h" |
-#include "ui/base/gtk/gtk_compat.h" |
#include "ui/base/gtk/gtk_hig_constants.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/base/resource/resource_bundle.h" |
@@ -615,16 +614,8 @@ void BrowserTitlebar::UpdateTitleAndIcon() { |
return; |
// Get the page title and elide it to the available space. |
- std::string title; |
- BrowserWindowGtk::TitleDecoration title_decoration = |
- browser_window_->GetWindowTitle(&title); |
- |
- if (title_decoration == BrowserWindowGtk::PANGO_MARKUP) { |
- gtk_label_set_markup(GTK_LABEL(app_mode_title_), title.c_str()); |
- } else { |
- DCHECK_EQ(BrowserWindowGtk::PLAIN_TEXT, title_decoration); |
- gtk_label_set_text(GTK_LABEL(app_mode_title_), title.c_str()); |
- } |
+ string16 title = browser_window_->browser()->GetWindowTitleForCurrentTab(); |
+ gtk_label_set_text(GTK_LABEL(app_mode_title_), UTF16ToUTF8(title).c_str()); |
if (browser_window_->browser()->is_app()) { |
switch (browser_window_->browser()->type()) { |
@@ -648,6 +639,7 @@ void BrowserTitlebar::UpdateTitleAndIcon() { |
break; |
} |
case Browser::TYPE_PANEL: { |
+ NOTREACHED(); |
break; |
} |
} |
@@ -958,50 +950,6 @@ void BrowserTitlebar::ShowContextMenu(GdkEventButton* event) { |
event->time); |
} |
-void BrowserTitlebar::SendEnterNotifyToCloseButtonIfUnderMouse() { |
- gint x; |
- gint y; |
- GtkAllocation widget_allocation = close_button_->WidgetAllocation(); |
- gtk_widget_get_pointer(GTK_WIDGET(close_button_->widget()), &x, &y); |
- |
- gfx::Rect button_rect(0, 0, widget_allocation.width, |
- widget_allocation.height); |
- if (!button_rect.Contains(x, y)) { |
- // Mouse is not over the close button. |
- return; |
- } |
- |
- // Create and emit an enter-notify-event on close button. |
- GValue return_value; |
- return_value.g_type = G_TYPE_BOOLEAN; |
- g_value_set_boolean(&return_value, false); |
- |
- GdkEvent* event = gdk_event_new(GDK_ENTER_NOTIFY); |
- event->crossing.window = |
- gtk_button_get_event_window(GTK_BUTTON(close_button_->widget())); |
- event->crossing.send_event = FALSE; |
- event->crossing.subwindow = gtk_widget_get_window(close_button_->widget()); |
- event->crossing.time = gtk_util::XTimeNow(); |
- event->crossing.x = x; |
- event->crossing.y = y; |
- event->crossing.x_root = widget_allocation.x; |
- event->crossing.y_root = widget_allocation.y; |
- event->crossing.mode = GDK_CROSSING_NORMAL; |
- event->crossing.detail = GDK_NOTIFY_ANCESTOR; |
- event->crossing.focus = true; |
- event->crossing.state = 0; |
- |
- g_signal_emit_by_name(GTK_OBJECT(close_button_->widget()), |
- "enter-notify-event", event, |
- &return_value); |
-} |
- |
-int BrowserTitlebar::IconOnlyWidth() { |
- GtkAllocation allocation; |
- gtk_widget_get_allocation(app_mode_favicon_, &allocation); |
- return 2 * kFrameBorderThickness + allocation.width; |
-} |
- |
bool BrowserTitlebar::IsCommandIdEnabled(int command_id) const { |
if (command_id == kShowWindowDecorationsCommand) |
return true; |