summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/extensions/extension_menu_manager.cc4
-rw-r--r--chrome/browser/renderer_host/gtk_im_context_wrapper.cc (renamed from content/browser/renderer_host/gtk_im_context_wrapper.cc)31
-rw-r--r--chrome/browser/renderer_host/gtk_im_context_wrapper.h (renamed from content/browser/renderer_host/gtk_im_context_wrapper.h)11
-rw-r--r--chrome/browser/renderer_host/gtk_key_bindings_handler.cc (renamed from content/browser/renderer_host/gtk_key_bindings_handler.cc)2
-rw-r--r--chrome/browser/renderer_host/gtk_key_bindings_handler.h (renamed from content/browser/renderer_host/gtk_key_bindings_handler.h)8
-rw-r--r--chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc (renamed from content/browser/renderer_host/gtk_key_bindings_handler_unittest.cc)10
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.cc (renamed from content/browser/renderer_host/render_widget_host_view_gtk.cc)35
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_gtk.h (renamed from content/browser/renderer_host/render_widget_host_view_gtk.h)14
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_views.cc4
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_win.cc3
-rw-r--r--chrome/browser/speech/speech_input_bubble_gtk.cc2
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc5
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu_gtk.cc28
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.cc2
-rw-r--r--chrome/browser/tab_contents/tab_contents_view_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc6
-rw-r--r--chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/browser_toolbar_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/constrained_window_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/custom_button.h2
-rw-r--r--chrome/browser/ui/gtk/download/download_item_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/download/download_shelf_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/extensions/extension_view_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/find_bar_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/global_bookmark_menu.h2
-rw-r--r--chrome/browser/ui/gtk/global_history_menu.cc2
-rw-r--r--chrome/browser/ui/gtk/global_history_menu.h2
-rw-r--r--chrome/browser/ui/gtk/global_menu_bar.h2
-rw-r--r--chrome/browser/ui/gtk/gtk_theme_service.h2
-rw-r--r--chrome/browser/ui/gtk/gtk_util.cc5
-rw-r--r--chrome/browser/ui/gtk/infobars/infobar_container_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/infobars/infobar_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/location_bar_view_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/overflow_button.h2
-rw-r--r--chrome/browser/ui/gtk/owned_widget_gtk.cc (renamed from ui/base/gtk/owned_widget_gtk.cc)2
-rw-r--r--chrome/browser/ui/gtk/owned_widget_gtk.h (renamed from ui/base/gtk/owned_widget_gtk.h)6
-rw-r--r--chrome/browser/ui/gtk/profile_menu_button.h2
-rw-r--r--chrome/browser/ui/gtk/reload_button_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/sad_tab_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/slide_animator_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/ssl_client_certificate_selector.cc2
-rw-r--r--chrome/browser/ui/gtk/status_bubble_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/tab_contents_container_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/tab_contents_container_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h2
-rw-r--r--chrome/browser/ui/gtk/tabs/tab_strip_gtk.h2
-rw-r--r--chrome/browser/ui/omnibox/location_bar_util.cc3
-rw-r--r--chrome/browser/ui/views/extensions/extension_view.cc2
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view_host.cc2
-rw-r--r--chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc2
-rw-r--r--chrome/chrome_browser.gypi14
-rw-r--r--chrome/chrome_tests.gypi2
-rw-r--r--chrome/common/chrome_switches.cc5
-rw-r--r--chrome/common/chrome_switches.h4
-rw-r--r--chrome/test/data/gtk_key_bindings_test_gtkrc (renamed from content/test/data/gtk_key_bindings_test_gtkrc)0
-rw-r--r--content/common/content_paths.cc17
-rw-r--r--content/common/content_paths.h3
-rw-r--r--content/common/content_switches.cc5
-rw-r--r--content/common/content_switches.h4
-rw-r--r--content/content_browser.gypi20
-rw-r--r--content/content_tests.gypi6
-rw-r--r--content/test/content_test_suite.cc5
-rw-r--r--ui/base/l10n/l10n_util.cc63
-rw-r--r--ui/base/l10n/l10n_util.h7
-rw-r--r--ui/base/l10n/l10n_util_unittest.cc30
-rw-r--r--ui/base/text/text_elider.cc66
-rw-r--r--ui/base/text/text_elider.h6
-rw-r--r--ui/base/text/text_elider_unittest.cc27
-rw-r--r--ui/ui.gyp2
74 files changed, 253 insertions, 286 deletions
diff --git a/chrome/browser/extensions/extension_menu_manager.cc b/chrome/browser/extensions/extension_menu_manager.cc
index 8cc81c2..a510392 100644
--- a/chrome/browser/extensions/extension_menu_manager.cc
+++ b/chrome/browser/extensions/extension_menu_manager.cc
@@ -18,7 +18,7 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "content/common/notification_service.h"
-#include "ui/base/text/text_elider.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/favicon_size.h"
#include "webkit/glue/context_menu.h"
@@ -76,7 +76,7 @@ string16 ExtensionMenuItem::TitleWithReplacement(
ReplaceSubstringsAfterOffset(&result, 0, ASCIIToUTF16("%s"), selection);
if (result.length() > max_length)
- result = ui::TruncateString(result, max_length);
+ result = l10n_util::TruncateString(result, max_length);
return result;
}
diff --git a/content/browser/renderer_host/gtk_im_context_wrapper.cc b/chrome/browser/renderer_host/gtk_im_context_wrapper.cc
index c5c4e03..529e5b1 100644
--- a/content/browser/renderer_host/gtk_im_context_wrapper.cc
+++ b/chrome/browser/renderer_host/gtk_im_context_wrapper.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/renderer_host/gtk_im_context_wrapper.h"
+#include "chrome/browser/renderer_host/gtk_im_context_wrapper.h"
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
@@ -12,15 +12,26 @@
#include "base/logging.h"
#include "base/string_util.h"
+#include "base/third_party/icu/icu_utf.h"
#include "base/utf_string_conversions.h"
+#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/ui/gtk/gtk_util.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
+#include "chrome/common/render_messages.h"
#include "content/browser/renderer_host/render_widget_host.h"
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
#include "content/common/native_web_keyboard_event.h"
+#include "grit/generated_resources.h"
+#include "third_party/skia/include/core/SkColor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
#include "ui/base/gtk/gtk_im_context_util.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/gtk_util.h"
#include "ui/gfx/rect.h"
+#if !defined(TOOLKIT_VIEWS)
+#include "chrome/browser/ui/gtk/menu_gtk.h"
+#endif
+
namespace {
// Copied from third_party/WebKit/Source/WebCore/page/EventHandler.cpp
//
@@ -308,11 +319,23 @@ void GtkIMContextWrapper::OnFocusOut() {
#if !defined(TOOLKIT_VIEWS)
// Not defined for views because the views context menu doesn't
// implement input methods yet.
-GtkWidget* GtkIMContextWrapper::BuildInputMethodsGtkMenu() {
+void GtkIMContextWrapper::AppendInputMethodsContextMenu(MenuGtk* menu) {
+ gboolean show_input_method_menu = TRUE;
+
+ g_object_get(gtk_widget_get_settings(GTK_WIDGET(host_view_->native_view())),
+ "gtk-show-input-method-menu", &show_input_method_menu, NULL);
+ if (!show_input_method_menu)
+ return;
+
+ std::string label = gfx::ConvertAcceleratorsFromWindowsStyle(
+ l10n_util::GetStringUTF8(IDS_CONTENT_CONTEXT_INPUT_METHODS_MENU));
+ GtkWidget* menuitem = gtk_menu_item_new_with_mnemonic(label.c_str());
GtkWidget* submenu = gtk_menu_new();
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu);
gtk_im_multicontext_append_menuitems(GTK_IM_MULTICONTEXT(context_),
GTK_MENU_SHELL(submenu));
- return submenu;
+ menu->AppendSeparator();
+ menu->AppendMenuItem(IDC_INPUT_METHODS_MENU, menuitem);
}
#endif
diff --git a/content/browser/renderer_host/gtk_im_context_wrapper.h b/chrome/browser/renderer_host/gtk_im_context_wrapper.h
index a783296..4caa63d 100644
--- a/content/browser/renderer_host/gtk_im_context_wrapper.h
+++ b/chrome/browser/renderer_host/gtk_im_context_wrapper.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_
-#define CONTENT_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_
+#ifndef CHROME_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_
+#define CHROME_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_
#pragma once
#include <gdk/gdk.h>
@@ -21,6 +21,9 @@ namespace gfx {
class Rect;
}
+#if !defined(TOOLKIT_VIEWS)
+class MenuGtk;
+#endif
class RenderWidgetHostViewGtk;
struct NativeWebKeyboardEvent;
typedef struct _GtkIMContext GtkIMContext;
@@ -55,7 +58,7 @@ class GtkIMContextWrapper {
#if !defined(TOOLKIT_VIEWS)
// Not defined for views because the views context menu doesn't
// implement input methods yet.
- GtkWidget* BuildInputMethodsGtkMenu();
+ void AppendInputMethodsContextMenu(MenuGtk* menu);
#endif
void CancelComposition();
@@ -194,4 +197,4 @@ class GtkIMContextWrapper {
DISALLOW_COPY_AND_ASSIGN(GtkIMContextWrapper);
};
-#endif // CONTENT_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_
+#endif // CHROME_BROWSER_RENDERER_HOST_GTK_IM_CONTEXT_WRAPPER_H_
diff --git a/content/browser/renderer_host/gtk_key_bindings_handler.cc b/chrome/browser/renderer_host/gtk_key_bindings_handler.cc
index 94e3234..9a0179d 100644
--- a/content/browser/renderer_host/gtk_key_bindings_handler.cc
+++ b/chrome/browser/renderer_host/gtk_key_bindings_handler.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/renderer_host/gtk_key_bindings_handler.h"
+#include "chrome/browser/renderer_host/gtk_key_bindings_handler.h"
#include <gdk/gdkkeysyms.h>
diff --git a/content/browser/renderer_host/gtk_key_bindings_handler.h b/chrome/browser/renderer_host/gtk_key_bindings_handler.h
index 071a3b1..9875933 100644
--- a/content/browser/renderer_host/gtk_key_bindings_handler.h
+++ b/chrome/browser/renderer_host/gtk_key_bindings_handler.h
@@ -2,16 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_RENDERER_HOST_GTK_KEY_BINDINGS_HANDLER_H_
-#define CONTENT_BROWSER_RENDERER_HOST_GTK_KEY_BINDINGS_HANDLER_H_
+#ifndef CHROME_BROWSER_RENDERER_HOST_GTK_KEY_BINDINGS_HANDLER_H_
+#define CHROME_BROWSER_RENDERER_HOST_GTK_KEY_BINDINGS_HANDLER_H_
#pragma once
#include <gtk/gtk.h>
#include <string>
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/common/edit_command.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
struct NativeWebKeyboardEvent;
@@ -125,4 +125,4 @@ class GtkKeyBindingsHandler {
EditCommands edit_commands_;
};
-#endif // CONTENT_BROWSER_RENDERER_HOST_GTK_KEY_BINDINGS_HANDLER_H_
+#endif // CHROME_BROWSER_RENDERER_HOST_GTK_KEY_BINDINGS_HANDLER_H_
diff --git a/content/browser/renderer_host/gtk_key_bindings_handler_unittest.cc b/chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc
index 10c824f..e574194 100644
--- a/content/browser/renderer_host/gtk_key_bindings_handler_unittest.cc
+++ b/chrome/browser/renderer_host/gtk_key_bindings_handler_unittest.cc
@@ -1,8 +1,7 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
-#include "content/browser/renderer_host/gtk_key_bindings_handler.h"
+#include "chrome/browser/renderer_host/gtk_key_bindings_handler.h"
#include <gdk/gdkkeysyms.h>
#include <string>
@@ -14,7 +13,7 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "base/string_util.h"
-#include "content/common/content_paths.h"
+#include "chrome/common/chrome_paths.h"
#include "content/common/edit_command.h"
#include "content/common/native_web_keyboard_event.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -30,9 +29,8 @@ class GtkKeyBindingsHandlerTest : public testing::Test {
: window_(gtk_window_new(GTK_WINDOW_TOPLEVEL)),
handler_(NULL) {
FilePath gtkrc;
- PathService::Get(content::DIR_TEST_DATA, &gtkrc);
+ PathService::Get(chrome::DIR_TEST_DATA, &gtkrc);
gtkrc = gtkrc.AppendASCII("gtk_key_bindings_test_gtkrc");
- EXPECT_TRUE(file_util::PathExists(gtkrc));
gtk_rc_parse(gtkrc.value().c_str());
diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
index 403ed10..8f46c9f 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc
@@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
// If this gets included after the gtk headers, then a bunch of compiler
// errors happen because of a "#define Status int" in Xlib.h, which interacts
// badly with net::URLRequestStatus::Status.
+#include "chrome/common/render_messages.h"
#include "content/common/view_messages.h"
#include <cairo/cairo.h>
@@ -25,18 +26,19 @@
#include "base/string_number_conversions.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/renderer_host/gtk_im_context_wrapper.h"
+#include "chrome/browser/ui/gtk/gtk_util.h"
+#include "chrome/common/chrome_switches.h"
#include "content/browser/renderer_host/backing_store_x.h"
-#include "content/browser/renderer_host/gtk_im_context_wrapper.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host.h"
-#include "content/common/content_switches.h"
#include "content/common/native_web_keyboard_event.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.h"
-#include "ui/base/text/text_elider.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/base/x/x11_util.h"
-#include "ui/gfx/gtk_native_view_id_manager.h"
#include "ui/gfx/gtk_preserve_window.h"
+#include "ui/gfx/gtk_native_view_id_manager.h"
#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webcursor_gtk_data.h"
#include "webkit/plugins/npapi/webplugin.h"
@@ -44,7 +46,7 @@
#if defined(OS_CHROMEOS)
#include "views/widget/tooltip_window_gtk.h"
#else
-#include "content/browser/renderer_host/gtk_key_bindings_handler.h"
+#include "chrome/browser/renderer_host/gtk_key_bindings_handler.h"
#endif // defined(OS_CHROMEOS)
namespace {
@@ -67,13 +69,6 @@ const float kDefaultScrollPixelsPerTick = 20;
const float kDefaultScrollPixelsPerTick = 160.0f / 3.0f;
#endif
-const GdkColor kBGColor =
-#if defined(NDEBUG)
- { 0, 0xff * 257, 0xff * 257, 0xff * 257 };
-#else
- { 0, 0x00 * 257, 0xff * 257, 0x00 * 257 };
-#endif
-
// Returns the spinning cursor used for loading state.
GdkCursor* GetMozSpinningCursor() {
static GdkCursor* moz_spinning_cursor = NULL;
@@ -108,7 +103,11 @@ class RenderWidgetHostViewGtkWidget {
// called in repsonse to an "expose-event" signal.
gtk_widget_set_double_buffered(widget, FALSE);
gtk_widget_set_redraw_on_allocate(widget, FALSE);
- gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &kBGColor);
+#if defined(NDEBUG)
+ gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &gtk_util::kGdkWhite);
+#else
+ gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &gtk_util::kGdkGreen);
+#endif
// Allow the browser window to be resized freely.
gtk_widget_set_size_request(widget, 0, 0);
@@ -821,8 +820,8 @@ void RenderWidgetHostViewGtk::SetTooltipText(const std::wstring& tooltip_text) {
// this itself).
// I filed https://bugzilla.gnome.org/show_bug.cgi?id=604641 upstream.
const string16 clamped_tooltip =
- ui::TruncateString(WideToUTF16Hack(tooltip_text),
- kMaxTooltipLength);
+ l10n_util::TruncateString(WideToUTF16Hack(tooltip_text),
+ kMaxTooltipLength);
if (clamped_tooltip.empty()) {
gtk_widget_set_has_tooltip(view_.get(), FALSE);
@@ -850,8 +849,8 @@ void RenderWidgetHostViewGtk::ShowingContextMenu(bool showing) {
}
#if !defined(TOOLKIT_VIEWS)
-GtkWidget* RenderWidgetHostViewGtk::BuildInputMethodsGtkMenu() {
- return im_context_->BuildInputMethodsGtkMenu();
+void RenderWidgetHostViewGtk::AppendInputMethodsContextMenu(MenuGtk* menu) {
+ im_context_->AppendInputMethodsContextMenu(menu);
}
#endif
diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.h b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
index c857651..40824e9 100644
--- a/content/browser/renderer_host/render_widget_host_view_gtk.h
+++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
-#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
+#ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
+#define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_GTK_H_
#pragma once
#include <gdk/gdk.h>
@@ -13,11 +13,11 @@
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/rect.h"
#include "webkit/glue/webcursor.h"
@@ -25,6 +25,9 @@
class RenderWidgetHost;
class GtkIMContextWrapper;
+#if !defined(TOOLKIT_VIEWS)
+class MenuGtk;
+#endif
struct NativeWebKeyboardEvent;
#if defined(OS_CHROMEOS)
@@ -131,8 +134,9 @@ class RenderWidgetHostViewGtk : public RenderWidgetHostView,
}
#if !defined(TOOLKIT_VIEWS)
- // Builds a submenu containing all the gtk input method commands.
- GtkWidget* BuildInputMethodsGtkMenu();
+ // Appends the input methods context menu to the specified |menu| object as a
+ // submenu.
+ void AppendInputMethodsContextMenu(MenuGtk* menu);
#endif
private:
diff --git a/chrome/browser/renderer_host/render_widget_host_view_views.cc b/chrome/browser/renderer_host/render_widget_host_view_views.cc
index 66e3b3d..510b295 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_views.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc
@@ -23,7 +23,7 @@
#include "content/common/view_messages.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.h"
-#include "ui/base/text/text_elider.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/canvas_skia.h"
#include "views/events/event.h"
@@ -300,7 +300,7 @@ void RenderWidgetHostViewViews::SetTooltipText(const std::wstring& tip) {
// Clamp the tooltip length to kMaxTooltipLength so that we don't
// accidentally DOS the user with a mega tooltip.
tooltip_text_ =
- ui::TruncateString(WideToUTF16Hack(tip), kMaxTooltipLength);
+ l10n_util::TruncateString(WideToUTF16Hack(tip), kMaxTooltipLength);
if (GetWidget())
GetWidget()->TooltipTextChanged(this);
}
diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc
index 059f06a..d3a95b1 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_win.cc
+++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc
@@ -49,7 +49,6 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_win.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/base/text/text_elider.h"
#include "ui/base/view_prop.h"
#include "ui/base/win/hwnd_util.h"
#include "ui/gfx/canvas.h"
@@ -752,7 +751,7 @@ void RenderWidgetHostViewWin::SetTooltipText(const std::wstring& tooltip_text) {
// accidentally DOS the user with a mega tooltip (since Windows doesn't seem
// to do this itself).
const std::wstring& new_tooltip_text =
- ui::TruncateString(tooltip_text, kMaxTooltipLength);
+ l10n_util::TruncateString(tooltip_text, kMaxTooltipLength);
if (new_tooltip_text != tooltip_text_) {
tooltip_text_ = new_tooltip_text;
diff --git a/chrome/browser/speech/speech_input_bubble_gtk.cc b/chrome/browser/speech/speech_input_bubble_gtk.cc
index 03aa028..6853422d 100644
--- a/chrome/browser/speech/speech_input_bubble_gtk.cc
+++ b/chrome/browser/speech/speech_input_bubble_gtk.cc
@@ -14,11 +14,11 @@
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "chrome/browser/ui/gtk/location_bar_view_gtk.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "media/audio/audio_manager.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/gtk_util.h"
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 41be22c..bd9e069 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -65,7 +65,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/text/text_elider.h"
#include "ui/gfx/favicon_size.h"
#include "webkit/glue/webmenuitem.h"
@@ -1789,8 +1788,8 @@ bool RenderViewContextMenu::IsDevCommandEnabled(int id) const {
}
string16 RenderViewContextMenu::PrintableSelectionText() {
- return ui::TruncateString(params_.selection_text,
- kMaxSelectionTextLength);
+ return l10n_util::TruncateString(params_.selection_text,
+ kMaxSelectionTextLength);
}
// Controller functions --------------------------------------------------------
diff --git a/chrome/browser/tab_contents/render_view_context_menu_gtk.cc b/chrome/browser/tab_contents/render_view_context_menu_gtk.cc
index 569bf53..f2e9f94 100644
--- a/chrome/browser/tab_contents/render_view_context_menu_gtk.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu_gtk.cc
@@ -8,12 +8,8 @@
#include "base/string_util.h"
#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/ui/gtk/gtk_util.h"
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "grit/generated_resources.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/gfx/gtk_util.h"
#include "webkit/glue/context_menu.h"
RenderViewContextMenuGtk::RenderViewContextMenuGtk(
@@ -33,26 +29,8 @@ void RenderViewContextMenuGtk::PlatformInit() {
if (params_.is_editable) {
RenderWidgetHostViewGtk* rwhv = static_cast<RenderWidgetHostViewGtk*>(
source_tab_contents_->GetRenderWidgetHostView());
-#if !defined(TOOLKIT_VIEWS)
- if (rwhv) {
- MenuGtk* menu = menu_gtk_.get();
- gboolean show_input_method_menu = TRUE;
-
- g_object_get(
- gtk_widget_get_settings(GTK_WIDGET(rwhv->native_view())),
- "gtk-show-input-method-menu", &show_input_method_menu, NULL);
- if (!show_input_method_menu)
- return;
-
- std::string label = gfx::ConvertAcceleratorsFromWindowsStyle(
- l10n_util::GetStringUTF8(IDS_CONTENT_CONTEXT_INPUT_METHODS_MENU));
- GtkWidget* menuitem = gtk_menu_item_new_with_mnemonic(label.c_str());
- GtkWidget* submenu = rwhv->BuildInputMethodsGtkMenu();
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), submenu);
- menu->AppendSeparator();
- menu->AppendMenuItem(IDC_INPUT_METHODS_MENU, menuitem);
- }
-#endif
+ if (rwhv)
+ rwhv->AppendInputMethodsContextMenu(menu_gtk_.get());
}
}
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
index 6172d6d..6de5a95 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.cc
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.cc
@@ -13,6 +13,7 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "build/build_config.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#include "chrome/browser/tab_contents/render_view_context_menu_gtk.h"
#include "chrome/browser/tab_contents/web_drag_dest_gtk.h"
#include "chrome/browser/ui/gtk/browser_window_gtk.h"
@@ -25,7 +26,6 @@
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_view_host_factory.h"
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
#include "content/browser/tab_contents/interstitial_page.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_delegate.h"
diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.h b/chrome/browser/tab_contents/tab_contents_view_gtk.h
index 09ecb15..5a91659 100644
--- a/chrome/browser/tab_contents/tab_contents_view_gtk.h
+++ b/chrome/browser/tab_contents/tab_contents_view_gtk.h
@@ -13,11 +13,11 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/tab_contents/render_view_host_delegate_helper.h"
#include "chrome/browser/ui/gtk/focus_store_gtk.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/browser/tab_contents/tab_contents_view.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
class ConstrainedWindowGtk;
class RenderViewContextMenuGtk;
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h
index 17a9065..245166a 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.h
@@ -19,6 +19,7 @@
#include "chrome/browser/ui/bookmarks/bookmark_bar.h"
#include "chrome/browser/ui/gtk/bookmarks/bookmark_bar_instructions_gtk.h"
#include "chrome/browser/ui/gtk/menu_bar_helper.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/browser/ui/gtk/view_id_util.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
@@ -26,7 +27,6 @@
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/gfx/point.h"
#include "ui/gfx/size.h"
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h b/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h
index c91fa03..0c79d2b 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_menu_controller_gtk.h
@@ -11,10 +11,10 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/bookmarks/base_bookmark_model_observer.h"
#include "chrome/browser/bookmarks/bookmark_context_menu_controller.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "ui/base/gtk/gtk_integers.h"
#include "ui/base/gtk/gtk_signal.h"
#include "ui/base/gtk/gtk_signal_registrar.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "webkit/glue/window_open_disposition.h"
class Browser;
diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
index 90721a1..aceebc8 100644
--- a/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
+++ b/chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "ui/base/dragdrop/gtk_dnd_util.h"
-#include "ui/base/text/text_elider.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas_skia_paint.h"
#include "ui/gfx/font.h"
@@ -253,10 +253,10 @@ std::string BuildMenuLabelFor(const BookmarkNode* node) {
// This breaks on word boundaries. Ideally we would break on character
// boundaries.
std::string elided_name = UTF16ToUTF8(
- ui::TruncateString(node->GetTitle(), kMaxCharsOnAMenuLabel));
+ l10n_util::TruncateString(node->GetTitle(), kMaxCharsOnAMenuLabel));
if (elided_name.empty()) {
- elided_name = UTF16ToUTF8(ui::TruncateString(
+ elided_name = UTF16ToUTF8(l10n_util::TruncateString(
UTF8ToUTF16(node->url().possibly_invalid_spec()),
kMaxCharsOnAMenuLabel));
}
diff --git a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h
index d8f6000..2b720cb 100644
--- a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h
+++ b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h
@@ -15,13 +15,13 @@
#include "chrome/browser/ui/gtk/custom_button.h"
#include "chrome/browser/ui/gtk/menu_gtk.h"
#include "chrome/browser/ui/gtk/overflow_button.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/gtk/gtk_signal.h"
#include "ui/base/gtk/gtk_signal_registrar.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/base/models/simple_menu_model.h"
class Browser;
diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.h b/chrome/browser/ui/gtk/browser_toolbar_gtk.h
index 1d553cd..00e14d9 100644
--- a/chrome/browser/ui/gtk/browser_toolbar_gtk.h
+++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.h
@@ -14,12 +14,12 @@
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/ui/gtk/custom_button.h"
#include "chrome/browser/ui/gtk/menu_gtk.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/browser/ui/toolbar/wrench_menu_model.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/gtk/gtk_signal.h"
#include "ui/base/gtk/gtk_signal_registrar.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/base/models/accelerator.h"
#include "ui/base/models/simple_menu_model.h"
diff --git a/chrome/browser/ui/gtk/constrained_window_gtk.h b/chrome/browser/ui/gtk/constrained_window_gtk.h
index fb4a546..700f47c 100644
--- a/chrome/browser/ui/gtk/constrained_window_gtk.h
+++ b/chrome/browser/ui/gtk/constrained_window_gtk.h
@@ -10,9 +10,9 @@
#include "base/basictypes.h"
#include "base/task.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/browser/tab_contents/constrained_window.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
class TabContents;
typedef struct _GdkColor GdkColor;
diff --git a/chrome/browser/ui/gtk/custom_button.h b/chrome/browser/ui/gtk/custom_button.h
index b3e65fa..611e3b7 100644
--- a/chrome/browser/ui/gtk/custom_button.h
+++ b/chrome/browser/ui/gtk/custom_button.h
@@ -9,13 +9,13 @@
#include <gtk/gtk.h>
#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/gfx/rect.h"
class CairoCachedSurface;
diff --git a/chrome/browser/ui/gtk/download/download_item_gtk.h b/chrome/browser/ui/gtk/download/download_item_gtk.h
index cabbe83..3b530a8 100644
--- a/chrome/browser/ui/gtk/download/download_item_gtk.h
+++ b/chrome/browser/ui/gtk/download/download_item_gtk.h
@@ -13,13 +13,13 @@
#include "base/memory/scoped_ptr.h"
#include "base/time.h"
#include "chrome/browser/icon_manager.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/browser/download/download_item.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
class BaseDownloadItemModel;
class DownloadShelfContextMenuGtk;
diff --git a/chrome/browser/ui/gtk/download/download_shelf_gtk.h b/chrome/browser/ui/gtk/download/download_shelf_gtk.h
index 116be4c..8088cca 100644
--- a/chrome/browser/ui/gtk/download/download_shelf_gtk.h
+++ b/chrome/browser/ui/gtk/download/download_shelf_gtk.h
@@ -13,11 +13,11 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "chrome/browser/download/download_shelf.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/browser/ui/gtk/slide_animator_gtk.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/gfx/native_widget_types.h"
class BaseDownloadItemModel;
diff --git a/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc
index 80a4af1..84393dd 100644
--- a/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc
@@ -14,12 +14,12 @@
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
#include "content/common/notification_details.h"
#include "content/common/notification_source.h"
#include "googleurl/src/gurl.h"
diff --git a/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
index 6f2689c..5917793 100644
--- a/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_view_gtk.cc
@@ -5,9 +5,9 @@
#include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h"
#include "chrome/browser/extensions/extension_host.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
ExtensionViewGtk::ExtensionViewGtk(ExtensionHost* extension_host,
Browser* browser)
diff --git a/chrome/browser/ui/gtk/find_bar_gtk.h b/chrome/browser/ui/gtk/find_bar_gtk.h
index 810b8f7..27cc018 100644
--- a/chrome/browser/ui/gtk/find_bar_gtk.h
+++ b/chrome/browser/ui/gtk/find_bar_gtk.h
@@ -12,11 +12,11 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/ui/find_bar/find_bar.h"
#include "chrome/browser/ui/gtk/focus_store_gtk.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/browser/ui/gtk/slide_animator_gtk.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/gfx/point.h"
class Browser;
diff --git a/chrome/browser/ui/gtk/global_bookmark_menu.h b/chrome/browser/ui/gtk/global_bookmark_menu.h
index ae80e4f..b8434ba 100644
--- a/chrome/browser/ui/gtk/global_bookmark_menu.h
+++ b/chrome/browser/ui/gtk/global_bookmark_menu.h
@@ -11,10 +11,10 @@
#include "base/task.h"
#include "chrome/browser/bookmarks/bookmark_model_observer.h"
#include "chrome/browser/ui/gtk/global_menu_owner.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
class Browser;
class Profile;
diff --git a/chrome/browser/ui/gtk/global_history_menu.cc b/chrome/browser/ui/gtk/global_history_menu.cc
index e5271c5..4913435 100644
--- a/chrome/browser/ui/gtk/global_history_menu.cc
+++ b/chrome/browser/ui/gtk/global_history_menu.cc
@@ -19,11 +19,11 @@
#include "chrome/browser/ui/gtk/global_menu_bar.h"
#include "chrome/browser/ui/gtk/gtk_theme_service.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/url_constants.h"
#include "content/common/notification_service.h"
#include "grit/generated_resources.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/text/text_elider.h"
#include "ui/gfx/codec/png_codec.h"
diff --git a/chrome/browser/ui/gtk/global_history_menu.h b/chrome/browser/ui/gtk/global_history_menu.h
index d685b53..9ddf74e 100644
--- a/chrome/browser/ui/gtk/global_history_menu.h
+++ b/chrome/browser/ui/gtk/global_history_menu.h
@@ -11,11 +11,11 @@
#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/sessions/tab_restore_service_observer.h"
#include "chrome/browser/ui/gtk/global_menu_owner.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/browser/cancelable_request.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
class Browser;
diff --git a/chrome/browser/ui/gtk/global_menu_bar.h b/chrome/browser/ui/gtk/global_menu_bar.h
index cc81a27..b5c4854 100644
--- a/chrome/browser/ui/gtk/global_menu_bar.h
+++ b/chrome/browser/ui/gtk/global_menu_bar.h
@@ -10,10 +10,10 @@
#include "chrome/browser/command_updater.h"
#include "chrome/browser/ui/gtk/global_bookmark_menu.h"
#include "chrome/browser/ui/gtk/global_history_menu.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
class Browser;
struct GlobalMenuBarCommand;
diff --git a/chrome/browser/ui/gtk/gtk_theme_service.h b/chrome/browser/ui/gtk/gtk_theme_service.h
index 5abf6c4..0875cbf 100644
--- a/chrome/browser/ui/gtk/gtk_theme_service.h
+++ b/chrome/browser/ui/gtk/gtk_theme_service.h
@@ -12,10 +12,10 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/browser/themes/theme_service.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/common/notification_observer.h"
#include "ui/base/gtk/gtk_integers.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/gfx/color_utils.h"
class CairoCachedSurface;
diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc
index 2a8160d..2fec735 100644
--- a/chrome/browser/ui/gtk/gtk_util.cc
+++ b/chrome/browser/ui/gtk/gtk_util.cc
@@ -37,7 +37,6 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/base/text/text_elider.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/gtk_util.h"
#include "ui/gfx/image/image.h"
@@ -781,7 +780,7 @@ std::string BuildTooltipTitleFor(string16 title, const GURL& url) {
const std::string& url_str = url.possibly_invalid_spec();
const std::string& title_str = UTF16ToUTF8(title);
- std::string truncated_url = UTF16ToUTF8(ui::TruncateString(
+ std::string truncated_url = UTF16ToUTF8(l10n_util::TruncateString(
UTF8ToUTF16(url_str), kMaxTooltipURLLength));
gchar* escaped_url_cstr = g_markup_escape_text(truncated_url.c_str(),
truncated_url.size());
@@ -792,7 +791,7 @@ std::string BuildTooltipTitleFor(string16 title, const GURL& url) {
if (url_str == title_str || title.empty()) {
return escaped_url;
} else {
- std::string truncated_title = UTF16ToUTF8(ui::TruncateString(
+ std::string truncated_title = UTF16ToUTF8(l10n_util::TruncateString(
title, kMaxTooltipTitleLength));
gchar* escaped_title_cstr = g_markup_escape_text(truncated_title.c_str(),
truncated_title.size());
diff --git a/chrome/browser/ui/gtk/infobars/infobar_container_gtk.h b/chrome/browser/ui/gtk/infobars/infobar_container_gtk.h
index 7f0d80b..2252493 100644
--- a/chrome/browser/ui/gtk/infobars/infobar_container_gtk.h
+++ b/chrome/browser/ui/gtk/infobars/infobar_container_gtk.h
@@ -11,7 +11,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "chrome/browser/tab_contents/infobar_container.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
class InfoBar;
class InfoBarGtk;
diff --git a/chrome/browser/ui/gtk/infobars/infobar_gtk.h b/chrome/browser/ui/gtk/infobars/infobar_gtk.h
index 4f39abf..a84a962 100644
--- a/chrome/browser/ui/gtk/infobars/infobar_gtk.h
+++ b/chrome/browser/ui/gtk/infobars/infobar_gtk.h
@@ -12,11 +12,11 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/tab_contents/infobar_delegate.h"
#include "chrome/browser/tab_contents/infobar.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
class CustomDrawButton;
class GtkThemeService;
diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.h b/chrome/browser/ui/gtk/location_bar_view_gtk.h
index 4bfd267..f18ed96 100644
--- a/chrome/browser/ui/gtk/location_bar_view_gtk.h
+++ b/chrome/browser/ui/gtk/location_bar_view_gtk.h
@@ -22,6 +22,7 @@
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
#include "chrome/browser/ui/gtk/menu_gtk.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/browser/ui/omnibox/location_bar.h"
#include "chrome/common/content_settings_types.h"
#include "content/common/notification_observer.h"
@@ -31,7 +32,6 @@
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "webkit/glue/window_open_disposition.h"
class OmniboxViewGtk;
diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc b/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc
index 2f3da9d..8dfd2dd 100644
--- a/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc
+++ b/chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.cc
@@ -5,9 +5,9 @@
#include "chrome/browser/ui/gtk/notifications/balloon_view_host_gtk.h"
#include "chrome/browser/notifications/balloon.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
BalloonViewHost::BalloonViewHost(Balloon* balloon)
: BalloonHost(balloon),
diff --git a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h
index 94b76a8..f52e03b 100644
--- a/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h
+++ b/chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h
@@ -15,6 +15,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/string_util.h"
#include "chrome/browser/autocomplete/autocomplete_match.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/browser/ui/omnibox/omnibox_view.h"
#include "chrome/browser/ui/toolbar/toolbar_model.h"
#include "content/common/notification_observer.h"
@@ -23,7 +24,6 @@
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/gtk/gtk_signal.h"
#include "ui/base/gtk/gtk_signal_registrar.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/gfx/rect.h"
#include "webkit/glue/window_open_disposition.h"
diff --git a/chrome/browser/ui/gtk/overflow_button.h b/chrome/browser/ui/gtk/overflow_button.h
index 34b427f..9f4f099 100644
--- a/chrome/browser/ui/gtk/overflow_button.h
+++ b/chrome/browser/ui/gtk/overflow_button.h
@@ -6,9 +6,9 @@
#define CHROME_BROWSER_UI_GTK_OVERFLOW_BUTTON_H_
#pragma once
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
typedef struct _GtkWidget GtkWidget;
class Profile;
diff --git a/ui/base/gtk/owned_widget_gtk.cc b/chrome/browser/ui/gtk/owned_widget_gtk.cc
index 51ee1cc..0d2d020 100644
--- a/ui/base/gtk/owned_widget_gtk.cc
+++ b/chrome/browser/ui/gtk/owned_widget_gtk.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/base/gtk/owned_widget_gtk.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include <gtk/gtk.h>
diff --git a/ui/base/gtk/owned_widget_gtk.h b/chrome/browser/ui/gtk/owned_widget_gtk.h
index d98604e..07952b1 100644
--- a/ui/base/gtk/owned_widget_gtk.h
+++ b/chrome/browser/ui/gtk/owned_widget_gtk.h
@@ -46,8 +46,8 @@
// gtk_destroy_widget(widget); // Ask all code to destroy their references.
// g_object_unref(widget); // Destroy the initial reference we had claimed.
-#ifndef UI_BASE_GTK_OWNED_WIDGET_GTK_H_
-#define UI_BASE_GTK_OWNED_WIDGET_GTK_H_
+#ifndef CHROME_BROWSER_UI_GTK_OWNED_WIDGET_GTK_H_
+#define CHROME_BROWSER_UI_GTK_OWNED_WIDGET_GTK_H_
#pragma once
#include "base/basictypes.h"
@@ -88,4 +88,4 @@ class OwnedWidgetGtk {
DISALLOW_COPY_AND_ASSIGN(OwnedWidgetGtk);
};
-#endif // UI_BASE_GTK_OWNED_WIDGET_GTK_H_
+#endif // CHROME_BROWSER_UI_GTK_OWNED_WIDGET_GTK_H_
diff --git a/chrome/browser/ui/gtk/profile_menu_button.h b/chrome/browser/ui/gtk/profile_menu_button.h
index 35a79d7..346534b 100644
--- a/chrome/browser/ui/gtk/profile_menu_button.h
+++ b/chrome/browser/ui/gtk/profile_menu_button.h
@@ -11,7 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/string16.h"
#include "chrome/browser/ui/gtk/menu_gtk.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
class Browser;
class ProfileMenuModel;
diff --git a/chrome/browser/ui/gtk/reload_button_gtk.h b/chrome/browser/ui/gtk/reload_button_gtk.h
index dd24cd3..8f7700e 100644
--- a/chrome/browser/ui/gtk/reload_button_gtk.h
+++ b/chrome/browser/ui/gtk/reload_button_gtk.h
@@ -11,10 +11,10 @@
#include "base/basictypes.h"
#include "base/timer.h"
#include "chrome/browser/ui/gtk/custom_button.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
class Browser;
class GtkThemeService;
diff --git a/chrome/browser/ui/gtk/sad_tab_gtk.h b/chrome/browser/ui/gtk/sad_tab_gtk.h
index 8025051..a3547e6 100644
--- a/chrome/browser/ui/gtk/sad_tab_gtk.h
+++ b/chrome/browser/ui/gtk/sad_tab_gtk.h
@@ -8,8 +8,8 @@
typedef struct _GtkWidget GtkWidget;
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
class TabContents;
diff --git a/chrome/browser/ui/gtk/slide_animator_gtk.h b/chrome/browser/ui/gtk/slide_animator_gtk.h
index ed8add9..ff0e276 100644
--- a/chrome/browser/ui/gtk/slide_animator_gtk.h
+++ b/chrome/browser/ui/gtk/slide_animator_gtk.h
@@ -18,8 +18,8 @@
#include <gtk/gtk.h>
#include "base/memory/scoped_ptr.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "ui/base/animation/animation_delegate.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
namespace ui {
class SlideAnimation;
diff --git a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc
index 2676d97..6b1b2f8 100644
--- a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc
+++ b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/ui/crypto_module_password_dialog.h"
#include "chrome/browser/ui/gtk/constrained_window_gtk.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/common/net/x509_certificate_model.h"
#include "content/browser/browser_thread.h"
#include "content/browser/ssl/ssl_client_auth_handler.h"
@@ -23,7 +24,6 @@
#include "grit/generated_resources.h"
#include "net/base/x509_certificate.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/native_widget_types.h"
diff --git a/chrome/browser/ui/gtk/status_bubble_gtk.h b/chrome/browser/ui/gtk/status_bubble_gtk.h
index 76976fe2..46c4837 100644
--- a/chrome/browser/ui/gtk/status_bubble_gtk.h
+++ b/chrome/browser/ui/gtk/status_bubble_gtk.h
@@ -13,13 +13,13 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/timer.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/browser/ui/status_bubble.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "googleurl/src/gurl.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/gfx/point.h"
class GtkThemeService;
diff --git a/chrome/browser/ui/gtk/tab_contents_container_gtk.cc b/chrome/browser/ui/gtk/tab_contents_container_gtk.cc
index 9eb3f10..026d11a 100644
--- a/chrome/browser/ui/gtk/tab_contents_container_gtk.cc
+++ b/chrome/browser/ui/gtk/tab_contents_container_gtk.cc
@@ -7,11 +7,11 @@
#include <algorithm>
#include "base/i18n/rtl.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#include "chrome/browser/ui/gtk/gtk_expanded_container.h"
#include "chrome/browser/ui/gtk/gtk_floating_container.h"
#include "chrome/browser/ui/gtk/status_bubble_gtk.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/common/notification_source.h"
#include "ui/gfx/native_widget_types.h"
diff --git a/chrome/browser/ui/gtk/tab_contents_container_gtk.h b/chrome/browser/ui/gtk/tab_contents_container_gtk.h
index f717ff2..de70475 100644
--- a/chrome/browser/ui/gtk/tab_contents_container_gtk.h
+++ b/chrome/browser/ui/gtk/tab_contents_container_gtk.h
@@ -9,11 +9,11 @@
#include <gtk/gtk.h>
#include "base/basictypes.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/browser/ui/gtk/view_id_util.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
class RenderViewHost;
class StatusBubbleGtk;
diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h
index ea0bfe4..2ea309e 100644
--- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h
+++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h
@@ -12,12 +12,12 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "base/string16.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "content/common/notification_observer.h"
#include "content/common/notification_registrar.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/font.h"
#include "ui/gfx/rect.h"
diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h
index 1a2187e..98c7a85 100644
--- a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h
+++ b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h
@@ -13,13 +13,13 @@
#include "base/message_loop.h"
#include "base/task.h"
#include "chrome/browser/tabs/tab_strip_model.h"
+#include "chrome/browser/ui/gtk/owned_widget_gtk.h"
#include "chrome/browser/ui/gtk/tabs/tab_gtk.h"
#include "chrome/browser/ui/gtk/tabstrip_origin_provider.h"
#include "chrome/browser/ui/gtk/view_id_util.h"
#include "chrome/browser/ui/tabs/hover_tab_selector.h"
#include "content/common/notification_observer.h"
#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/owned_widget_gtk.h"
#include "ui/gfx/rect.h"
class BrowserWindowGtk;
diff --git a/chrome/browser/ui/omnibox/location_bar_util.cc b/chrome/browser/ui/omnibox/location_bar_util.cc
index 018553e..bb18ca7 100644
--- a/chrome/browser/ui/omnibox/location_bar_util.cc
+++ b/chrome/browser/ui/omnibox/location_bar_util.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/search_engines/template_url_service.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/text/text_elider.h"
namespace location_bar_util {
@@ -35,7 +34,7 @@ std::wstring CalculateMinString(const std::wstring& description) {
string16 min_string;
if (chop_index == std::wstring::npos) {
// No dot or whitespace, truncate to at most 3 chars.
- min_string = ui::TruncateString(WideToUTF16Hack(description), 3);
+ min_string = l10n_util::TruncateString(WideToUTF16Hack(description), 3);
} else {
min_string = WideToUTF16(description.substr(0, chop_index));
}
diff --git a/chrome/browser/ui/views/extensions/extension_view.cc b/chrome/browser/ui/views/extensions/extension_view.cc
index 2b65409..dfccb31 100644
--- a/chrome/browser/ui/views/extensions/extension_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_view.cc
@@ -15,7 +15,7 @@
#elif defined(TOUCH_UI)
#include "chrome/browser/renderer_host/render_widget_host_view_views.h"
#elif defined(TOOLKIT_USES_GTK)
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#endif
ExtensionView::ExtensionView(ExtensionHost* host, Browser* browser)
diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.cc b/chrome/browser/ui/views/notifications/balloon_view_host.cc
index f014985..aef58df 100644
--- a/chrome/browser/ui/views/notifications/balloon_view_host.cc
+++ b/chrome/browser/ui/views/notifications/balloon_view_host.cc
@@ -14,7 +14,7 @@
#if defined(TOUCH_UI)
#include "chrome/browser/renderer_host/render_widget_host_view_views.h"
#else
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#endif
#endif
#include "views/widget/widget.h"
diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc
index f0566e6..d79f6f5 100644
--- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc
+++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc
@@ -5,12 +5,12 @@
#include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
#include "chrome/browser/tab_contents/web_drag_dest_gtk.h"
#include "chrome/browser/ui/gtk/constrained_window_gtk.h"
#include "chrome/browser/ui/gtk/tab_contents_drag_source.h"
#include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate.h"
#include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_views.h"
-#include "content/browser/renderer_host/render_widget_host_view_gtk.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/tab_contents/tab_contents_view.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebDragData.h"
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 9fd39ea..d2719b9 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1864,8 +1864,14 @@
'browser/renderer_host/chrome_resource_dispatcher_host_delegate.h',
'browser/renderer_host/chrome_url_request_user_data.cc',
'browser/renderer_host/chrome_url_request_user_data.h',
+ 'browser/renderer_host/gtk_im_context_wrapper.cc',
+ 'browser/renderer_host/gtk_im_context_wrapper.h',
+ 'browser/renderer_host/gtk_key_bindings_handler.cc',
+ 'browser/renderer_host/gtk_key_bindings_handler.h',
'browser/renderer_host/offline_resource_handler.cc',
'browser/renderer_host/offline_resource_handler.h',
+ 'browser/renderer_host/render_widget_host_view_gtk.cc',
+ 'browser/renderer_host/render_widget_host_view_gtk.h',
'browser/renderer_host/render_widget_host_view_mac.h',
'browser/renderer_host/render_widget_host_view_mac.mm',
'browser/renderer_host/render_widget_host_view_views.cc',
@@ -2907,6 +2913,8 @@
'browser/ui/gtk/omnibox/omnibox_view_gtk.h',
'browser/ui/gtk/overflow_button.cc',
'browser/ui/gtk/overflow_button.h',
+ 'browser/ui/gtk/owned_widget_gtk.cc',
+ 'browser/ui/gtk/owned_widget_gtk.h',
'browser/ui/gtk/page_info_bubble_gtk.cc',
'browser/ui/gtk/process_singleton_dialog.cc',
'browser/ui/gtk/process_singleton_dialog.h',
@@ -3838,6 +3846,8 @@
'browser/platform_util_linux.cc',
'browser/printing/print_dialog_gtk.cc',
'browser/printing/print_dialog_gtk.h',
+ 'browser/renderer_host/gtk_key_bindings_handler.cc',
+ 'browser/renderer_host/gtk_key_bindings_handler.h',
'browser/upgrade_detector_impl.cc',
'browser/upgrade_detector_impl.h',
],
@@ -3897,6 +3907,8 @@
'sources/': [
['include', '^browser/ui/touch/*'],
['exclude', '^browser/chromeos/frame/browser_non_client_frame_view_factory_chromeos.cc'],
+ ['exclude', '^browser/renderer_host/gtk_im_context_wrapper.cc'],
+ ['exclude', '^browser/renderer_host/gtk_im_context_wrapper.h'],
['exclude', '^browser/renderer_host/render_widget_host_view_gtk.cc'],
['exclude', '^browser/renderer_host/render_widget_host_view_gtk.h'],
['exclude', '^browser/ui/views/frame/browser_non_client_frame_view_factory_gtk.cc'],
@@ -4319,6 +4331,8 @@
['include', '^browser/ui/gtk/nine_box.h'],
['include', '^browser/ui/gtk/omnibox/omnibox_view_gtk.cc'],
['include', '^browser/ui/gtk/omnibox/omnibox_view_gtk.h'],
+ ['include', '^browser/ui/gtk/owned_widget_gtk.cc'],
+ ['include', '^browser/ui/gtk/owned_widget_gtk.h'],
['include', '^browser/ui/gtk/repost_form_warning_gtk.cc'],
['include', '^browser/ui/gtk/repost_form_warning_gtk.h'],
['include', '^browser/ui/gtk/ssl_client_certificate_selector.cc'],
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index dd0dc8b..23e9411 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -1612,6 +1612,7 @@
'browser/profiles/profile_manager_unittest.cc',
'browser/remoting/firewall_traversal_tab_helper_unittest.cc',
'browser/renderer_host/accelerated_plugin_view_mac_unittest.mm',
+ 'browser/renderer_host/gtk_key_bindings_handler_unittest.cc',
'browser/renderer_host/render_widget_host_view_mac_unittest.mm',
'browser/renderer_host/text_input_client_mac_unittest.mm',
'browser/renderer_host/web_cache_manager_unittest.cc',
@@ -2124,6 +2125,7 @@
['chromeos==1', {
'sources/': [
['exclude', '^browser/password_manager/native_backend_gnome_x_unittest.cc'],
+ ['exclude', '^browser/renderer_host/gtk_key_bindings_handler_unittest.cc'],
# TODO(thestig) Enable PrintPreviewUI tests on CrOS when
# print preview is enabled on CrOS.
['exclude', '^browser/ui/webui/print_preview_ui_unittest.cc'],
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index af19ac8..db5d74e 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -1128,6 +1128,11 @@ const char kFileManagerExtensionPath[] = "filemgr-ext-path";
#endif
#endif
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
+// Specify the amount the trackpad should scroll by.
+const char kScrollPixels[] = "scroll-pixels";
+#endif
+
#if defined(OS_MACOSX) || defined(OS_WIN)
// Use the system SSL library (Secure Transport on Mac, SChannel on Windows)
// instead of NSS for SSL.
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index e2c9fc8..a5e1098 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -315,6 +315,10 @@ extern const char kFileManagerExtensionPath[];
#endif
#endif
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
+extern const char kScrollPixels[];
+#endif
+
#if defined(OS_MACOSX) || defined(OS_WIN)
extern const char kUseSystemSSL[];
#endif
diff --git a/content/test/data/gtk_key_bindings_test_gtkrc b/chrome/test/data/gtk_key_bindings_test_gtkrc
index 812971c..812971c 100644
--- a/content/test/data/gtk_key_bindings_test_gtkrc
+++ b/chrome/test/data/gtk_key_bindings_test_gtkrc
diff --git a/content/common/content_paths.cc b/content/common/content_paths.cc
index 2664349..4e9b32b 100644
--- a/content/common/content_paths.cc
+++ b/content/common/content_paths.cc
@@ -4,7 +4,6 @@
#include "content/common/content_paths.h"
-#include "base/file_util.h"
#include "base/path_service.h"
namespace content {
@@ -13,22 +12,8 @@ bool PathProvider(int key, FilePath* result) {
switch (key) {
case CHILD_PROCESS_EXE:
return PathService::Get(base::FILE_EXE, result);
- case DIR_TEST_DATA: {
- FilePath cur;
- if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur))
- return false;
- cur = cur.Append(FILE_PATH_LITERAL("content"));
- cur = cur.Append(FILE_PATH_LITERAL("test"));
- cur = cur.Append(FILE_PATH_LITERAL("data"));
- if (!file_util::PathExists(cur)) // we don't want to create this
- return false;
-
- *result = cur;
- return true;
- break;
- }
default:
- return false;
+ break;
}
return false;
diff --git a/content/common/content_paths.h b/content/common/content_paths.h
index cdf07a7..49720a0 100644
--- a/content/common/content_paths.h
+++ b/content/common/content_paths.h
@@ -17,9 +17,6 @@ enum {
// Path and filename to the executable to use for child processes.
CHILD_PROCESS_EXE = PATH_START,
- // Valid only in development environment
- DIR_TEST_DATA,
-
PATH_END
};
diff --git a/content/common/content_switches.cc b/content/common/content_switches.cc
index 4058d4e..20dca2a 100644
--- a/content/common/content_switches.cc
+++ b/content/common/content_switches.cc
@@ -471,11 +471,6 @@ const char kAuditHandles[] = "enable-handle-auditing";
const char kAuditAllHandles[] = "enable-handle-auditing-all";
#endif
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
-// Specify the amount the trackpad should scroll by.
-const char kScrollPixels[] = "scroll-pixels";
-#endif
-
#if !defined(OFFICIAL_BUILD)
// Causes the renderer process to throw an assertion on launch.
const char kRendererCheckFalseTest[] = "renderer-check-false-test";
diff --git a/content/common/content_switches.h b/content/common/content_switches.h
index adc93dd..a61a35b 100644
--- a/content/common/content_switches.h
+++ b/content/common/content_switches.h
@@ -152,10 +152,6 @@ extern const char kAuditHandles[];
extern const char kAuditAllHandles[];
#endif
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
-extern const char kScrollPixels[];
-#endif
-
#if !defined(OFFICIAL_BUILD)
extern const char kRendererCheckFalseTest[];
#endif
diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index b96735b..c4ac49d 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -322,10 +322,6 @@
'browser/renderer_host/global_request_id.h',
'browser/renderer_host/gpu_message_filter.cc',
'browser/renderer_host/gpu_message_filter.h',
- 'browser/renderer_host/gtk_im_context_wrapper.cc',
- 'browser/renderer_host/gtk_im_context_wrapper.h',
- 'browser/renderer_host/gtk_key_bindings_handler.cc',
- 'browser/renderer_host/gtk_key_bindings_handler.h',
'browser/renderer_host/media/audio_common.cc',
'browser/renderer_host/media/audio_common.h',
'browser/renderer_host/media/audio_input_device_manager.cc',
@@ -391,8 +387,6 @@
'browser/renderer_host/render_widget_host_mac.cc',
'browser/renderer_host/render_widget_host_view.cc',
'browser/renderer_host/render_widget_host_view.h',
- 'browser/renderer_host/render_widget_host_view_gtk.cc',
- 'browser/renderer_host/render_widget_host_view_gtk.h',
'browser/renderer_host/resource_dispatcher_host.cc',
'browser/renderer_host/resource_dispatcher_host.h',
'browser/renderer_host/resource_dispatcher_host_delegate.h',
@@ -572,20 +566,6 @@
'../sandbox/sandbox.gyp:sandbox',
],
}],
- ['chromeos==1', {
- 'sources!': [
- 'browser/renderer_host/gtk_key_bindings_handler.cc',
- 'browser/renderer_host/gtk_key_bindings_handler.h',
- ],
- }],
- ['touchui==1', {
- 'sources/': [
- ['exclude', '^browser/renderer_host/gtk_im_context_wrapper.cc'],
- ['exclude', '^browser/renderer_host/gtk_im_context_wrapper.h'],
- ['exclude', '^browser/renderer_host/render_widget_host_view_gtk.cc'],
- ['exclude', '^browser/renderer_host/render_widget_host_view_gtk.h'],
- ],
- }],
],
},
],
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index b06c848..1c59e934 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -50,7 +50,6 @@
'sources': [
'browser/browser_thread_unittest.cc',
'browser/child_process_security_policy_unittest.cc',
- 'browser/renderer_host/gtk_key_bindings_handler_unittest.cc',
'browser/ssl/ssl_host_state_unittest.cc',
'browser/trace_subscriber_stdio_unittest.cc',
'common/process_watcher_unittest.cc',
@@ -80,11 +79,6 @@
'../base/allocator/allocator.gyp:allocator',
],
}],
- ['chromeos==1', {
- 'sources/': [
- ['exclude', '^browser/renderer_host/gtk_key_bindings_handler_unittest.cc'],
- ],
- }],
],
},
],
diff --git a/content/test/content_test_suite.cc b/content/test/content_test_suite.cc
index a6ebf01..2cfc1e5 100644
--- a/content/test/content_test_suite.cc
+++ b/content/test/content_test_suite.cc
@@ -7,10 +7,8 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "content/common/content_client.h"
-#include "content/common/content_paths.h"
#include "content/test/test_content_client.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "ui/base/ui_base_paths.h"
namespace {
@@ -49,9 +47,6 @@ ContentTestSuite::~ContentTestSuite() {
void ContentTestSuite::Initialize() {
base::TestSuite::Initialize();
- content::RegisterPathProvider();
- ui::RegisterPathProvider();
-
testing::TestEventListeners& listeners =
testing::UnitTest::GetInstance()->listeners();
listeners.Append(new TestContentClientInitializer);
diff --git a/ui/base/l10n/l10n_util.cc b/ui/base/l10n/l10n_util.cc
index cabda81..ae7e710 100644
--- a/ui/base/l10n/l10n_util.cc
+++ b/ui/base/l10n/l10n_util.cc
@@ -741,6 +741,69 @@ string16 GetStringFUTF16Int(int message_id, int64 a) {
return GetStringFUTF16(message_id, UTF8ToUTF16(base::Int64ToString(a)));
}
+string16 TruncateString(const string16& string, size_t length) {
+ if (string.size() <= length)
+ // String fits, return it.
+ return string;
+
+ if (length == 0) {
+ // No room for the elide string, return an empty string.
+ return string16();
+ }
+ size_t max = length - 1;
+
+ // Added to the end of strings that are too big.
+ static const char16 kElideString[] = { 0x2026, 0 };
+
+ if (max == 0) {
+ // Just enough room for the elide string.
+ return kElideString;
+ }
+
+ // Use a line iterator to find the first boundary.
+ UErrorCode status = U_ZERO_ERROR;
+ scoped_ptr<icu::RuleBasedBreakIterator> bi(
+ static_cast<icu::RuleBasedBreakIterator*>(
+ icu::RuleBasedBreakIterator::createLineInstance(
+ icu::Locale::getDefault(), status)));
+ if (U_FAILURE(status))
+ return string.substr(0, max) + kElideString;
+ bi->setText(string.c_str());
+ int32_t index = bi->preceding(static_cast<int32_t>(max));
+ if (index == icu::BreakIterator::DONE) {
+ index = static_cast<int32_t>(max);
+ } else {
+ // Found a valid break (may be the beginning of the string). Now use
+ // a character iterator to find the previous non-whitespace character.
+ icu::StringCharacterIterator char_iterator(string.c_str());
+ if (index == 0) {
+ // No valid line breaks. Start at the end again. This ensures we break
+ // on a valid character boundary.
+ index = static_cast<int32_t>(max);
+ }
+ char_iterator.setIndex(index);
+ while (char_iterator.hasPrevious()) {
+ char_iterator.previous();
+ if (!(u_isspace(char_iterator.current()) ||
+ u_charType(char_iterator.current()) == U_CONTROL_CHAR ||
+ u_charType(char_iterator.current()) == U_NON_SPACING_MARK)) {
+ // Not a whitespace character. Advance the iterator so that we
+ // include the current character in the truncated string.
+ char_iterator.next();
+ break;
+ }
+ }
+ if (char_iterator.hasPrevious()) {
+ // Found a valid break point.
+ index = char_iterator.getIndex();
+ } else {
+ // String has leading whitespace, return the elide string.
+ return kElideString;
+ }
+ }
+ return string.substr(0, index) + kElideString;
+}
+
// Compares the character data stored in two different string16 strings by
// specified Collator instance.
UCollationResult CompareString16WithCollator(const icu::Collator* collator,
diff --git a/ui/base/l10n/l10n_util.h b/ui/base/l10n/l10n_util.h
index 48ec68a..8fd0240 100644
--- a/ui/base/l10n/l10n_util.h
+++ b/ui/base/l10n/l10n_util.h
@@ -131,6 +131,13 @@ UI_EXPORT string16 GetStringFUTF16(int message_id,
UI_EXPORT string16 GetStringFUTF16Int(int message_id, int a);
string16 GetStringFUTF16Int(int message_id, int64 a);
+// Truncates the string to length characters. This breaks the string at
+// the first word break before length, adding the horizontal ellipsis
+// character (unicode character 0x2026) to render ...
+// The supplied string is returned if the string has length characters or
+// less.
+UI_EXPORT string16 TruncateString(const string16& string, size_t length);
+
// In place sorting of string16 strings using collation rules for |locale|.
UI_EXPORT void SortStrings16(const std::string& locale,
std::vector<string16>* strings);
diff --git a/ui/base/l10n/l10n_util_unittest.cc b/ui/base/l10n/l10n_util_unittest.cc
index 778476c..dda3efe 100644
--- a/ui/base/l10n/l10n_util_unittest.cc
+++ b/ui/base/l10n/l10n_util_unittest.cc
@@ -65,6 +65,36 @@ TEST_F(L10nUtilTest, DISABLED_GetString) {
}
#endif // defined(OS_WIN)
+TEST_F(L10nUtilTest, TruncateString) {
+ string16 string = ASCIIToUTF16("foooooey bxxxar baz");
+
+ // Make sure it doesn't modify the string if length > string length.
+ EXPECT_EQ(string, l10n_util::TruncateString(string, 100));
+
+ // Test no characters.
+ EXPECT_EQ(L"", UTF16ToWide(l10n_util::TruncateString(string, 0)));
+
+ // Test 1 character.
+ EXPECT_EQ(L"\x2026", UTF16ToWide(l10n_util::TruncateString(string, 1)));
+
+ // Test adds ... at right spot when there is enough room to break at a
+ // word boundary.
+ EXPECT_EQ(L"foooooey\x2026",
+ UTF16ToWide(l10n_util::TruncateString(string, 14)));
+
+ // Test adds ... at right spot when there is not enough space in first word.
+ EXPECT_EQ(L"f\x2026", UTF16ToWide(l10n_util::TruncateString(string, 2)));
+
+ // Test adds ... at right spot when there is not enough room to break at a
+ // word boundary.
+ EXPECT_EQ(L"foooooey\x2026",
+ UTF16ToWide(l10n_util::TruncateString(string, 11)));
+
+ // Test completely truncates string if break is on initial whitespace.
+ EXPECT_EQ(L"\x2026",
+ UTF16ToWide(l10n_util::TruncateString(ASCIIToUTF16(" "), 2)));
+}
+
void SetICUDefaultLocale(const std::string& locale_string) {
icu::Locale locale(locale_string.c_str());
UErrorCode error_code = U_ZERO_ERROR;
diff --git a/ui/base/text/text_elider.cc b/ui/base/text/text_elider.cc
index 8cbfb3c..1a4b79d 100644
--- a/ui/base/text/text_elider.cc
+++ b/ui/base/text/text_elider.cc
@@ -10,7 +10,6 @@
#include "base/i18n/break_iterator.h"
#include "base/i18n/char_iterator.h"
#include "base/i18n/rtl.h"
-#include "base/scoped_ptr.h"
#include "base/string_split.h"
#include "base/string_util.h"
#include "base/sys_string_conversions.h"
@@ -20,8 +19,6 @@
#include "net/base/net_util.h"
#include "net/base/registry_controlled_domain.h"
#include "ui/gfx/font.h"
-#include "unicode/rbbi.h"
-#include "unicode/uloc.h"
namespace ui {
@@ -676,67 +673,4 @@ bool ElideRectangleString(const string16& input, size_t max_rows,
return rect.Finalize();
}
-string16 TruncateString(const string16& string, size_t length) {
- if (string.size() <= length)
- // String fits, return it.
- return string;
-
- if (length == 0) {
- // No room for the elide string, return an empty string.
- return string16();
- }
- size_t max = length - 1;
-
- // Added to the end of strings that are too big.
- static const char16 kElideString[] = { 0x2026, 0 };
-
- if (max == 0) {
- // Just enough room for the elide string.
- return kElideString;
- }
-
- // Use a line iterator to find the first boundary.
- UErrorCode status = U_ZERO_ERROR;
- scoped_ptr<icu::RuleBasedBreakIterator> bi(
- static_cast<icu::RuleBasedBreakIterator*>(
- icu::RuleBasedBreakIterator::createLineInstance(
- icu::Locale::getDefault(), status)));
- if (U_FAILURE(status))
- return string.substr(0, max) + kElideString;
- bi->setText(string.c_str());
- int32_t index = bi->preceding(static_cast<int32_t>(max));
- if (index == icu::BreakIterator::DONE) {
- index = static_cast<int32_t>(max);
- } else {
- // Found a valid break (may be the beginning of the string). Now use
- // a character iterator to find the previous non-whitespace character.
- icu::StringCharacterIterator char_iterator(string.c_str());
- if (index == 0) {
- // No valid line breaks. Start at the end again. This ensures we break
- // on a valid character boundary.
- index = static_cast<int32_t>(max);
- }
- char_iterator.setIndex(index);
- while (char_iterator.hasPrevious()) {
- char_iterator.previous();
- if (!(u_isspace(char_iterator.current()) ||
- u_charType(char_iterator.current()) == U_CONTROL_CHAR ||
- u_charType(char_iterator.current()) == U_NON_SPACING_MARK)) {
- // Not a whitespace character. Advance the iterator so that we
- // include the current character in the truncated string.
- char_iterator.next();
- break;
- }
- }
- if (char_iterator.hasPrevious()) {
- // Found a valid break point.
- index = char_iterator.getIndex();
- } else {
- // String has leading whitespace, return the elide string.
- return kElideString;
- }
- }
- return string.substr(0, index) + kElideString;
-}
-
} // namespace ui
diff --git a/ui/base/text/text_elider.h b/ui/base/text/text_elider.h
index eb4f7a4..fe2a141 100644
--- a/ui/base/text/text_elider.h
+++ b/ui/base/text/text_elider.h
@@ -119,12 +119,6 @@ UI_EXPORT bool ElideRectangleString(const string16& input, size_t max_rows,
size_t max_cols, bool strict,
string16* output);
-// Truncates the string to length characters. This breaks the string at
-// the first word break before length, adding the horizontal ellipsis
-// character (unicode character 0x2026) to render ...
-// The supplied string is returned if the string has length characters or
-// less.
-UI_EXPORT string16 TruncateString(const string16& string, size_t length);
} // namespace ui
diff --git a/ui/base/text/text_elider_unittest.cc b/ui/base/text/text_elider_unittest.cc
index 60ab1f7..0ff70e4 100644
--- a/ui/base/text/text_elider_unittest.cc
+++ b/ui/base/text/text_elider_unittest.cc
@@ -547,31 +547,4 @@ TEST(TextEliderTest, ElideRectangleWide32) {
EXPECT_EQ(out, output);
}
-TEST(TextEliderTest, TruncateString) {
- string16 string = ASCIIToUTF16("foooooey bxxxar baz");
-
- // Make sure it doesn't modify the string if length > string length.
- EXPECT_EQ(string, ui::TruncateString(string, 100));
-
- // Test no characters.
- EXPECT_EQ(L"", UTF16ToWide(ui::TruncateString(string, 0)));
-
- // Test 1 character.
- EXPECT_EQ(L"\x2026", UTF16ToWide(ui::TruncateString(string, 1)));
-
- // Test adds ... at right spot when there is enough room to break at a
- // word boundary.
- EXPECT_EQ(L"foooooey\x2026", UTF16ToWide(ui::TruncateString(string, 14)));
-
- // Test adds ... at right spot when there is not enough space in first word.
- EXPECT_EQ(L"f\x2026", UTF16ToWide(ui::TruncateString(string, 2)));
-
- // Test adds ... at right spot when there is not enough room to break at a
- // word boundary.
- EXPECT_EQ(L"foooooey\x2026", UTF16ToWide(ui::TruncateString(string, 11)));
-
- // Test completely truncates string if break is on initial whitespace.
- EXPECT_EQ(L"\x2026", UTF16ToWide(ui::TruncateString(ASCIIToUTF16(" "), 2)));
-}
-
} // namespace ui
diff --git a/ui/ui.gyp b/ui/ui.gyp
index 9dce600..7ee709d 100644
--- a/ui/ui.gyp
+++ b/ui/ui.gyp
@@ -113,8 +113,6 @@
'base/gtk/gtk_signal_registrar.h',
'base/gtk/gtk_windowing.cc',
'base/gtk/gtk_windowing.h',
- 'base/gtk/owned_widget_gtk.cc',
- 'base/gtk/owned_widget_gtk.h',
'base/ime/composition_text.cc',
'base/ime/composition_text.h',
'base/ime/composition_underline.h',