diff options
293 files changed, 937 insertions, 845 deletions
diff --git a/app/gfx/gl/gl_context_linux.cc b/app/gfx/gl/gl_context_linux.cc index 9e4bfee..ec31ceb 100644 --- a/app/gfx/gl/gl_context_linux.cc +++ b/app/gfx/gl/gl_context_linux.cc @@ -17,10 +17,10 @@ extern "C" { #include "app/gfx/gl/gl_context_osmesa.h" #include "app/gfx/gl/gl_context_stub.h" #include "app/gfx/gl/gl_implementation.h" -#include "app/x11_util.h" #include "base/basictypes.h" #include "base/logging.h" #include "base/scoped_ptr.h" +#include "ui/base/x/x11_util.h" namespace { @@ -420,14 +420,14 @@ bool OSMesaViewGLContext::SwapBuffers() { // Copy the frame into the pixmap. XWindowAttributes attributes; XGetWindowAttributes(display, window_, &attributes); - x11_util::PutARGBImage(display, - attributes.visual, - attributes.depth, - pixmap_, - pixmap_graphics_context_, - static_cast<const uint8*>(osmesa_context_.buffer()), - size.width(), - size.height()); + ui::PutARGBImage(display, + attributes.visual, + attributes.depth, + pixmap_, + pixmap_graphics_context_, + static_cast<const uint8*>(osmesa_context_.buffer()), + size.width(), + size.height()); // Copy the pixmap to the window. XCopyArea(display, diff --git a/app/surface/transport_dib.h b/app/surface/transport_dib.h index d82c346..a55f624 100644 --- a/app/surface/transport_dib.h +++ b/app/surface/transport_dib.h @@ -15,7 +15,7 @@ #if defined(OS_WIN) #include <windows.h> #elif defined(USE_X11) -#include "app/x11_util.h" +#include "ui/base/x/x11_util.h" #endif namespace skia { diff --git a/app/surface/transport_dib_linux.cc b/app/surface/transport_dib_linux.cc index 9976e50..549ee52 100644 --- a/app/surface/transport_dib_linux.cc +++ b/app/surface/transport_dib_linux.cc @@ -8,11 +8,11 @@ #include <sys/shm.h> #include "app/surface/transport_dib.h" -#include "app/x11_util.h" #include "base/logging.h" #include "base/scoped_ptr.h" #include "gfx/size.h" #include "skia/ext/platform_canvas.h" +#include "ui/base/x/x11_util.h" // The shmat system call uses this as it's invalid return address static void *const kInvalidAddress = (void*) -1; @@ -33,7 +33,7 @@ TransportDIB::~TransportDIB() { if (x_shm_) { DCHECK(display_); - x11_util::DetachSharedMemory(display_, x_shm_); + ui::DetachSharedMemory(display_, x_shm_); } } @@ -128,7 +128,7 @@ TransportDIB::Handle TransportDIB::handle() const { XID TransportDIB::MapToX(Display* display) { if (!x_shm_) { - x_shm_ = x11_util::AttachSharedMemory(display, key_); + x_shm_ = ui::AttachSharedMemory(display, key_); display_ = display; } diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc index a8549a0..7507f8b 100644 --- a/chrome/app/chrome_main.cc +++ b/chrome/app/chrome_main.cc @@ -75,7 +75,7 @@ #include <gtk/gtk.h> #include <stdlib.h> #include <string.h> -#include "app/x11_util.h" +#include "ui/base/x/x11_util.h" #endif #if defined(USE_TCMALLOC) diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h index 2e45edc..ee61f0c 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view_gtk.h @@ -11,8 +11,6 @@ #include <algorithm> #include <string> -#include "app/gtk_signal.h" -#include "app/gtk_signal_registrar.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/string_util.h" @@ -24,6 +22,8 @@ #include "chrome/common/page_transition_types.h" #include "gfx/rect.h" #include "ui/base/animation/animation_delegate.h" +#include "ui/base/gtk/gtk_signal.h" +#include "ui/base/gtk/gtk_signal_registrar.h" #include "webkit/glue/window_open_disposition.h" class AccessibleWidgetHelper; @@ -534,7 +534,7 @@ class AutocompleteEditViewGtk : public AutocompleteEditView, // "focus-out" events. GtkWidget* going_to_focus_; - GtkSignalRegistrar signals_; + ui::GtkSignalRegistrar signals_; #if defined(TOOLKIT_VIEWS) scoped_ptr<AccessibleWidgetHelper> accessible_widget_helper_; diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm index 20a979e..3884bbb 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm @@ -7,7 +7,6 @@ #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" #include "app/resource_bundle.h" -#include "app/text_elider.h" #include "base/stl_util-inl.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" @@ -28,6 +27,7 @@ #include "skia/ext/skia_utils_mac.h" #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" +#include "ui/base/text/text_elider.h" namespace { @@ -163,7 +163,7 @@ NSMutableAttributedString* AutocompletePopupViewMac::ElideString( } // If ElideText() decides to do nothing, nothing to be done. - const std::wstring elided(UTF16ToWideHack(ElideText( + const std::wstring elided(UTF16ToWideHack(ui::ElideText( WideToUTF16Hack(originalString), font, width, false))); if (0 == elided.compare(originalString)) { return aString; diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac_unittest.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac_unittest.mm index 0e1bab7..3f3a535 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac_unittest.mm +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac_unittest.mm @@ -4,12 +4,12 @@ #import "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" -#include "app/text_elider.h" #include "base/scoped_ptr.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/browser/autocomplete/autocomplete.h" #include "testing/platform_test.h" +#include "ui/base/text/text_elider.h" namespace { @@ -461,7 +461,7 @@ TEST_F(AutocompletePopupViewMacTest, ElideString) { // When elided, result is the same as ElideText(). ret = AutocompletePopupViewMac::ElideString(as, wideContents, font_, kNarrow); - std::wstring elided(UTF16ToWideHack(ElideText(WideToUTF16Hack( + std::wstring elided(UTF16ToWideHack(ui::ElideText(WideToUTF16Hack( wideContents), font_, kNarrow, false))); EXPECT_TRUE(ret == as); EXPECT_FALSE([[as string] isEqualToString:contents]); @@ -469,7 +469,7 @@ TEST_F(AutocompletePopupViewMacTest, ElideString) { // When elided, result is the same as ElideText(). ret = AutocompletePopupViewMac::ElideString(as, wideContents, font_, 0.0); - elided = UTF16ToWideHack(ElideText(WideToUTF16Hack(wideContents), font_, + elided = UTF16ToWideHack(ui::ElideText(WideToUTF16Hack(wideContents), font_, 0.0, false)); EXPECT_TRUE(ret == as); EXPECT_FALSE([[as string] isEqualToString:contents]); diff --git a/chrome/browser/autofill/autofill_dialog_gtk.cc b/chrome/browser/autofill/autofill_dialog_gtk.cc index 387ba53..80ce045 100644 --- a/chrome/browser/autofill/autofill_dialog_gtk.cc +++ b/chrome/browser/autofill/autofill_dialog_gtk.cc @@ -10,7 +10,6 @@ #include <string> #include <vector> -#include "app/gtk_signal.h" #include "app/l10n_util.h" #include "base/logging.h" #include "base/message_loop.h" @@ -38,6 +37,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" +#include "ui/base/gtk/gtk_signal.h" // Shows the editor for adding/editing an AutoFillProfile. If // |auto_fill_profile| is NULL, a new AutoFillProfile should be created. diff --git a/chrome/browser/autofill/autofill_editor_gtk.cc b/chrome/browser/autofill/autofill_editor_gtk.cc index d1f7def..d7b2a84 100644 --- a/chrome/browser/autofill/autofill_editor_gtk.cc +++ b/chrome/browser/autofill/autofill_editor_gtk.cc @@ -6,7 +6,6 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/message_loop.h" @@ -23,6 +22,7 @@ #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" +#include "ui/base/gtk/gtk_signal.h" namespace { diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 49bee1d..f00a0a4 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -6,7 +6,6 @@ #include <set> -#include "app/message_box_flags.h" #include "base/callback.h" #include "base/debug/trace_event.h" #include "base/file_path.h" diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index def68fe..a4fc56a 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -4,7 +4,6 @@ #include "chrome/browser/automation/testing_automation_provider.h" -#include "app/message_box_flags.h" #include "base/command_line.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" @@ -75,6 +74,7 @@ #include "chrome/common/automation_messages.h" #include "net/base/cookie_store.h" #include "net/url_request/url_request_context.h" +#include "ui/base/message_box_flags.h" #include "views/event.h" #include "webkit/plugins/npapi/plugin_list.h" @@ -1780,7 +1780,7 @@ void TestingAutomationProvider::GetShowingAppModalDialog(bool* showing_dialog, AppModalDialogQueue::GetInstance()->active_dialog(); if (!active_dialog) { *showing_dialog = false; - *dialog_button = MessageBoxFlags::DIALOGBUTTON_NONE; + *dialog_button = ui::MessageBoxFlags::DIALOGBUTTON_NONE; return; } NativeAppModalDialog* native_dialog = active_dialog->native_dialog(); @@ -1788,7 +1788,7 @@ void TestingAutomationProvider::GetShowingAppModalDialog(bool* showing_dialog, if (*showing_dialog) *dialog_button = native_dialog->GetAppModalDialogButtons(); else - *dialog_button = MessageBoxFlags::DIALOGBUTTON_NONE; + *dialog_button = ui::MessageBoxFlags::DIALOGBUTTON_NONE; } void TestingAutomationProvider::ClickAppModalDialogButton(int button, @@ -1799,13 +1799,13 @@ void TestingAutomationProvider::ClickAppModalDialogButton(int button, AppModalDialogQueue::GetInstance()->active_dialog()->native_dialog(); if (native_dialog && (native_dialog->GetAppModalDialogButtons() & button) == button) { - if ((button & MessageBoxFlags::DIALOGBUTTON_OK) == - MessageBoxFlags::DIALOGBUTTON_OK) { + if ((button & ui::MessageBoxFlags::DIALOGBUTTON_OK) == + ui::MessageBoxFlags::DIALOGBUTTON_OK) { native_dialog->AcceptAppModalDialog(); *success = true; } - if ((button & MessageBoxFlags::DIALOGBUTTON_CANCEL) == - MessageBoxFlags::DIALOGBUTTON_CANCEL) { + if ((button & ui::MessageBoxFlags::DIALOGBUTTON_CANCEL) == + ui::MessageBoxFlags::DIALOGBUTTON_CANCEL) { DCHECK(!*success) << "invalid param, OK and CANCEL specified"; native_dialog->CancelAppModalDialog(); *success = true; diff --git a/chrome/browser/automation/ui_controls_linux.cc b/chrome/browser/automation/ui_controls_linux.cc index 02932b0..f3dd862 100644 --- a/chrome/browser/automation/ui_controls_linux.cc +++ b/chrome/browser/automation/ui_controls_linux.cc @@ -7,13 +7,13 @@ #include <gdk/gdkkeysyms.h> #include <gtk/gtk.h> -#include "app/event_synthesis_gtk.h" #include "base/logging.h" #include "base/message_loop.h" #include "chrome/browser/automation/ui_controls_internal.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "chrome/common/automation_constants.h" #include "gfx/rect.h" +#include "ui/base/gtk/event_synthesis_gtk.h" #if defined(TOOLKIT_VIEWS) #include "views/view.h" @@ -124,8 +124,7 @@ bool SendKeyPress(gfx::NativeWindow window, } std::vector<GdkEvent*> events; - app::SynthesizeKeyPressEvents(event_window, key, control, shift, alt, - &events); + ui::SynthesizeKeyPressEvents(event_window, key, control, shift, alt, &events); for (std::vector<GdkEvent*>::iterator iter = events.begin(); iter != events.end(); ++iter) { gdk_event_put(*iter); diff --git a/chrome/browser/browser_main_gtk.cc b/chrome/browser/browser_main_gtk.cc index ec73aaf..f80daa9 100644 --- a/chrome/browser/browser_main_gtk.cc +++ b/chrome/browser/browser_main_gtk.cc @@ -8,8 +8,6 @@ #include <sys/types.h> #include <unistd.h> -#include "app/x11_util.h" -#include "app/x11_util_internal.h" #include "base/command_line.h" #include "base/debug/debugger.h" #include "chrome/browser/browser_list.h" @@ -20,6 +18,8 @@ #include "chrome/browser/zygote_host_linux.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/result_codes.h" +#include "ui/base/x/x11_util.h" +#include "ui/base/x/x11_util_internal.h" #if defined(USE_NSS) #include "base/nss_util.h" @@ -36,7 +36,7 @@ bool g_in_x11_io_error_handler = false; int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) { if (!g_in_x11_io_error_handler) - LOG(ERROR) << x11_util::GetErrorEventDescription(d, error); + LOG(ERROR) << ui::GetErrorEventDescription(d, error); return 0; } @@ -128,9 +128,7 @@ void PrepareRestartOnCrashEnviroment(const CommandLine &parsed_command_line) { void SetBrowserX11ErrorHandlers() { // Set up error handlers to make sure profile gets written if X server // goes away. - x11_util::SetX11ErrorHandlers( - BrowserX11ErrorHandler, - BrowserX11IOErrorHandler); + ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler); } #if !defined(OS_CHROMEOS) diff --git a/chrome/browser/chromeos/external_protocol_dialog.cc b/chrome/browser/chromeos/external_protocol_dialog.cc index 521852f..f6c0813 100644 --- a/chrome/browser/chromeos/external_protocol_dialog.cc +++ b/chrome/browser/chromeos/external_protocol_dialog.cc @@ -5,8 +5,6 @@ #include "chrome/browser/chromeos/external_protocol_dialog.h" #include "app/l10n_util.h" -#include "app/message_box_flags.h" -#include "app/text_elider.h" #include "base/metrics/histogram.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -18,6 +16,8 @@ #include "googleurl/src/gurl.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +#include "ui/base/message_box_flags.h" +#include "ui/base/text/text_elider.h" #include "views/controls/message_box_view.h" #include "views/window/window.h" @@ -49,11 +49,11 @@ ExternalProtocolDialog::~ExternalProtocolDialog() { // ExternalProtocolDialog, views::DialogDelegate implementation: int ExternalProtocolDialog::GetDialogButtons() const { - return MessageBoxFlags::DIALOGBUTTON_OK; + return ui::MessageBoxFlags::DIALOGBUTTON_OK; } std::wstring ExternalProtocolDialog::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { + ui::MessageBoxFlags::DialogButton button) const { return UTF16ToWide( l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT)); } @@ -88,7 +88,7 @@ ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents, scheme_(url.scheme()) { const int kMaxUrlWithoutSchemeSize = 256; std::wstring elided_url_without_scheme; - gfx::ElideString(ASCIIToWide(url.possibly_invalid_spec()), + ui::ElideString(ASCIIToWide(url.possibly_invalid_spec()), kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); std::wstring message_text = UTF16ToWide(l10n_util::GetStringFUTF16( @@ -96,10 +96,11 @@ ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents, ASCIIToUTF16(url.scheme() + ":"), WideToUTF16(elided_url_without_scheme)) + ASCIIToUTF16("\n\n")); - message_box_view_ = new MessageBoxView(MessageBoxFlags::kIsConfirmMessageBox, - message_text, - std::wstring(), - kMessageWidth); + message_box_view_ = new MessageBoxView( + ui::MessageBoxFlags::kIsConfirmMessageBox, + message_text, + std::wstring(), + kMessageWidth); message_box_view_->SetCheckBoxLabel(UTF16ToWide( l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT))); diff --git a/chrome/browser/chromeos/frame/panel_browser_view.cc b/chrome/browser/chromeos/frame/panel_browser_view.cc index 4572781..0a4e8b5 100644 --- a/chrome/browser/chromeos/frame/panel_browser_view.cc +++ b/chrome/browser/chromeos/frame/panel_browser_view.cc @@ -96,7 +96,7 @@ void PanelBrowserView::ActivationChanged(bool activated) { void PanelBrowserView::SetCreatorView(PanelBrowserView* creator) { DCHECK(creator); GtkWindow* window = creator->GetNativeHandle(); - creator_xid_ = x11_util::GetX11WindowFromGtkWidget(GTK_WIDGET(window)); + creator_xid_ = ui::GetX11WindowFromGtkWidget(GTK_WIDGET(window)); } bool PanelBrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const { diff --git a/chrome/browser/chromeos/frame/panel_browser_view.h b/chrome/browser/chromeos/frame/panel_browser_view.h index 29132a0f..822d9d1 100644 --- a/chrome/browser/chromeos/frame/panel_browser_view.h +++ b/chrome/browser/chromeos/frame/panel_browser_view.h @@ -6,10 +6,10 @@ #define CHROME_BROWSER_CHROMEOS_FRAME_PANEL_BROWSER_VIEW_H_ #pragma once -#include "app/x11_util.h" #include "base/scoped_ptr.h" #include "chrome/browser/chromeos/frame/panel_controller.h" #include "chrome/browser/ui/views/frame/browser_view.h" +#include "ui/base/x/x11_util.h" class Browser; diff --git a/chrome/browser/chromeos/frame/panel_controller.cc b/chrome/browser/chromeos/frame/panel_controller.cc index 3b32d2e..5770c87 100644 --- a/chrome/browser/chromeos/frame/panel_controller.cc +++ b/chrome/browser/chromeos/frame/panel_controller.cc @@ -107,7 +107,7 @@ PanelController::PanelController(Delegate* delegate, GtkWindow* window) : delegate_(delegate), panel_(window), - panel_xid_(x11_util::GetX11WindowFromGtkWidget(GTK_WIDGET(panel_))), + panel_xid_(ui::GetX11WindowFromGtkWidget(GTK_WIDGET(panel_))), title_window_(NULL), title_(NULL), title_content_(NULL), @@ -129,7 +129,7 @@ void PanelController::Init(bool initial_focus, gtk_widget_set_size_request(title_window_->GetNativeView(), title_bounds.width(), title_bounds.height()); title_ = title_window_->GetNativeView(); - title_xid_ = x11_util::GetX11WindowFromGtkWidget(title_); + title_xid_ = ui::GetX11WindowFromGtkWidget(title_); WmIpc::instance()->SetWindowType( title_, diff --git a/chrome/browser/chromeos/frame/panel_controller.h b/chrome/browser/chromeos/frame/panel_controller.h index 2d039bc..ec27bf2 100644 --- a/chrome/browser/chromeos/frame/panel_controller.h +++ b/chrome/browser/chromeos/frame/panel_controller.h @@ -8,8 +8,8 @@ #include <gtk/gtk.h> -#include "app/x11_util.h" #include "third_party/cros/chromeos_wm_ipc_enums.h" +#include "ui/base/x/x11_util.h" #include "views/controls/button/button.h" class BrowserView; diff --git a/chrome/browser/chromeos/login/background_view.cc b/chrome/browser/chromeos/login/background_view.cc index 15a3b3e..b2da474 100644 --- a/chrome/browser/chromeos/login/background_view.cc +++ b/chrome/browser/chromeos/login/background_view.cc @@ -9,7 +9,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/x11_util.h" #include "base/string16.h" #include "base/string_util.h" #include "base/stringprintf.h" @@ -35,6 +34,7 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "third_party/cros/chromeos_wm_ipc_enums.h" +#include "ui/base/x/x11_util.h" #include "views/controls/button/text_button.h" #include "views/controls/label.h" #include "views/screen.h" @@ -98,9 +98,9 @@ class TextButtonWithHandCursorOver : public views::TextButton { // This gets rid of the ugly X default cursor. static void ResetXCursor() { // TODO(sky): nuke this once new window manager is in place. - Display* display = x11_util::GetXDisplay(); + Display* display = ui::GetXDisplay(); Cursor cursor = XCreateFontCursor(display, XC_left_ptr); - XID root_window = x11_util::GetX11RootWindow(); + XID root_window = ui::GetX11RootWindow(); XSetWindowAttributes attr; attr.cursor = cursor; XChangeWindowAttributes(display, root_window, CWCursor, &attr); diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 26615ad..152f402 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -14,7 +14,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/x11_util.h" #include "base/command_line.h" #include "base/lazy_instance.h" #include "base/metrics/histogram.h" @@ -49,6 +48,7 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "third_party/cros/chromeos_wm_ipc_enums.h" +#include "ui/base/x/x11_util.h" #include "views/screen.h" #include "views/widget/root_view.h" #include "views/widget/widget_gtk.h" @@ -405,7 +405,7 @@ void GrabWidget::TryUngrabOtherClients() { int event_base, error_base; int major, minor; // Make sure we have XTest extension. - DCHECK(XTestQueryExtension(x11_util::GetXDisplay(), + DCHECK(XTestQueryExtension(ui::GetXDisplay(), &event_base, &error_base, &major, &minor)); } @@ -419,12 +419,12 @@ void GrabWidget::TryUngrabOtherClients() { // Successfully grabbed the keyboard, but pointer is still // grabbed by other client. Another attempt to close supposedly // opened menu by emulating keypress at the left top corner. - Display* display = x11_util::GetXDisplay(); + Display* display = ui::GetXDisplay(); Window root, child; int root_x, root_y, win_x, winy; unsigned int mask; XQueryPointer(display, - x11_util::GetX11WindowFromGtkWidget(window_contents()), + ui::GetX11WindowFromGtkWidget(window_contents()), &root, &child, &root_x, &root_y, &win_x, &winy, &mask); XTestFakeMotionEvent(display, -1, -10000, -10000, CurrentTime); @@ -439,7 +439,7 @@ void GrabWidget::TryUngrabOtherClients() { // by other client. Another attempt to close supposedly opened // menu by emulating escape key. Such situation must be very // rare, but handling this just in case - Display* display = x11_util::GetXDisplay(); + Display* display = ui::GetXDisplay(); KeyCode escape = XKeysymToKeycode(display, XK_Escape); XTestFakeKeyEvent(display, escape, True, CurrentTime); XTestFakeKeyEvent(display, escape, False, CurrentTime); diff --git a/chrome/browser/chromeos/native_dialog_window.cc b/chrome/browser/chromeos/native_dialog_window.cc index 8f6cd90..160585a 100644 --- a/chrome/browser/chromeos/native_dialog_window.cc +++ b/chrome/browser/chromeos/native_dialog_window.cc @@ -6,11 +6,11 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/logging.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/frame/bubble_window.h" #include "chrome/browser/ui/views/window.h" +#include "ui/base/gtk/gtk_signal.h" #include "views/controls/native/native_view_host.h" #include "views/window/dialog_delegate.h" #include "views/window/non_client_view.h" diff --git a/chrome/browser/chromeos/notifications/notification_browsertest.cc b/chrome/browser/chromeos/notifications/notification_browsertest.cc index 82cd702..08c646d 100644 --- a/chrome/browser/chromeos/notifications/notification_browsertest.cc +++ b/chrome/browser/chromeos/notifications/notification_browsertest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/x11_util.h" #include "base/message_loop.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" @@ -21,6 +20,7 @@ #include "chrome/common/notification_service.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" +#include "ui/base/x/x11_util.h" namespace { @@ -49,7 +49,7 @@ class NotificationTest : public InProcessBrowserTest, // Detect if we're running under ChromeOS WindowManager. See // the description for "under_chromeos_" below for why we need this. std::string wm_name; - bool wm_name_valid = x11_util::GetWindowManagerName(&wm_name); + bool wm_name_valid = ui::GetWindowManagerName(&wm_name); // NOTE: On Chrome OS the wm and Chrome are started in parallel. This // means it's possible for us not to be able to get the name of the window // manager. We assume that when this happens we're on Chrome OS. diff --git a/chrome/browser/chromeos/wm_ipc.cc b/chrome/browser/chromeos/wm_ipc.cc index 3e856f3..f264a11 100644 --- a/chrome/browser/chromeos/wm_ipc.cc +++ b/chrome/browser/chromeos/wm_ipc.cc @@ -9,10 +9,10 @@ extern "C" { #include <X11/Xlib.h> } -#include "app/x11_util.h" #include "base/lazy_instance.h" #include "base/logging.h" #include "base/scoped_ptr.h" +#include "ui/base/x/x11_util.h" namespace chromeos { @@ -45,7 +45,7 @@ bool SetIntProperty(XID xid, Atom xatom, const std::vector<int>& values) { data[i] = values[i]; // TODO: Trap errors and return false on failure. - XChangeProperty(x11_util::GetXDisplay(), + XChangeProperty(ui::GetXDisplay(), xid, xatom, xatom, @@ -53,7 +53,7 @@ bool SetIntProperty(XID xid, Atom xatom, const std::vector<int>& values) { PropModeReplace, reinterpret_cast<const unsigned char*>(data.get()), values.size()); // num items - XFlush(x11_util::GetXDisplay()); + XFlush(ui::GetXDisplay()); return true; } @@ -73,15 +73,15 @@ bool WmIpc::SetWindowType(GtkWidget* widget, values.push_back(type); if (params) values.insert(values.end(), params->begin(), params->end()); - return SetIntProperty(x11_util::GetX11WindowFromGtkWidget(widget), + return SetIntProperty(ui::GetX11WindowFromGtkWidget(widget), type_to_atom_[ATOM_CHROME_WINDOW_TYPE], values); } WmIpcWindowType WmIpc::GetWindowType(GtkWidget* widget, std::vector<int>* params) { std::vector<int> properties; - if (x11_util::GetIntArrayProperty( - x11_util::GetX11WindowFromGtkWidget(widget), + if (ui::GetIntArrayProperty( + ui::GetX11WindowFromGtkWidget(widget), atom_to_string_[type_to_atom_[ATOM_CHROME_WINDOW_TYPE]], &properties)) { int type = properties.front(); @@ -109,7 +109,7 @@ void WmIpc::SendMessage(const Message& msg) { for (int i = 0; i < msg.max_params(); ++i) e.xclient.data.l[i+1] = msg.param(i); - XSendEvent(x11_util::GetXDisplay(), + XSendEvent(ui::GetXDisplay(), wm_, False, // propagate 0, // empty event mask @@ -177,7 +177,7 @@ WmIpc::WmIpc() { names[i] = const_cast<char*>(kAtomInfos[i].name); } - XInternAtoms(x11_util::GetXDisplay(), names.get(), kNumAtoms, + XInternAtoms(ui::GetXDisplay(), names.get(), kNumAtoms, False, // only_if_exists atoms.get()); @@ -200,7 +200,7 @@ WmIpc::WmIpc() { } void WmIpc::InitWmInfo() { - wm_ = XGetSelectionOwner(x11_util::GetXDisplay(), type_to_atom_[ATOM_WM_S0]); + wm_ = XGetSelectionOwner(ui::GetXDisplay(), type_to_atom_[ATOM_WM_S0]); // Let the window manager know which version of the IPC messages we support. Message msg(chromeos::WM_IPC_MESSAGE_WM_NOTIFY_IPC_VERSION); diff --git a/chrome/browser/chromeos/wm_overview_fav_icon.cc b/chrome/browser/chromeos/wm_overview_fav_icon.cc index ad9dfa8..68b5224 100644 --- a/chrome/browser/chromeos/wm_overview_fav_icon.cc +++ b/chrome/browser/chromeos/wm_overview_fav_icon.cc @@ -6,12 +6,12 @@ #include <vector> -#include "app/x11_util.h" #include "chrome/browser/chromeos/wm_ipc.h" #include "chrome/browser/chromeos/wm_overview_snapshot.h" #include "skia/ext/image_operations.h" #include "third_party/cros/chromeos_wm_ipc_enums.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/x/x11_util.h" #include "views/controls/image_view.h" #include "views/controls/label.h" #include "views/grid_layout.h" @@ -42,7 +42,7 @@ void WmOverviewFavIcon::Init(WmOverviewSnapshot* snapshot) { // Set the window type vector<int> params; - params.push_back(x11_util::GetX11WindowFromGtkWidget( + params.push_back(ui::GetX11WindowFromGtkWidget( GTK_WIDGET(snapshot->GetNativeView()))); WmIpc::instance()->SetWindowType( GetNativeView(), diff --git a/chrome/browser/chromeos/wm_overview_snapshot.cc b/chrome/browser/chromeos/wm_overview_snapshot.cc index 2182273..d59dda0 100644 --- a/chrome/browser/chromeos/wm_overview_snapshot.cc +++ b/chrome/browser/chromeos/wm_overview_snapshot.cc @@ -6,10 +6,10 @@ #include <vector> -#include "app/x11_util.h" #include "chrome/browser/browser_window.h" #include "chrome/browser/chromeos/wm_ipc.h" #include "chrome/browser/ui/browser.h" +#include "ui/base/x/x11_util.h" #include "views/controls/image_view.h" #include "views/controls/label.h" #include "views/grid_layout.h" @@ -44,7 +44,7 @@ void WmOverviewSnapshot::Init(const gfx::Size& size, void WmOverviewSnapshot::UpdateIndex(Browser* browser, int index) { vector<int> params; - params.push_back(x11_util::GetX11WindowFromGtkWidget( + params.push_back(ui::GetX11WindowFromGtkWidget( GTK_WIDGET(browser->window()->GetNativeHandle()))); params.push_back(index); WmIpc::instance()->SetWindowType( diff --git a/chrome/browser/chromeos/wm_overview_title.cc b/chrome/browser/chromeos/wm_overview_title.cc index 435cbd6..6b27e16 100644 --- a/chrome/browser/chromeos/wm_overview_title.cc +++ b/chrome/browser/chromeos/wm_overview_title.cc @@ -6,7 +6,6 @@ #include <vector> -#include "app/x11_util.h" #include "base/string16.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_window.h" @@ -15,6 +14,7 @@ #include "chrome/browser/chromeos/wm_overview_snapshot.h" #include "third_party/cros/chromeos_wm_ipc_enums.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/x/x11_util.h" #include "views/border.h" #include "views/grid_layout.h" #include "views/view.h" @@ -97,7 +97,7 @@ void WmOverviewTitle::Init(const gfx::Size& size, // Set the window type vector<int> params; - params.push_back(x11_util::GetX11WindowFromGtkWidget( + params.push_back(ui::GetX11WindowFromGtkWidget( GTK_WIDGET(snapshot->GetNativeView()))); WmIpc::instance()->SetWindowType( GetNativeView(), diff --git a/chrome/browser/dom_ui/bug_report_ui.cc b/chrome/browser/dom_ui/bug_report_ui.cc index a780c50..bd4bd15 100644 --- a/chrome/browser/dom_ui/bug_report_ui.cc +++ b/chrome/browser/dom_ui/bug_report_ui.cc @@ -38,7 +38,7 @@ #include "grit/locale_settings.h" #if defined(USE_X11) -#include "app/x11_util.h" +#include "ui/base/x/x11_util.h" #elif defined(OS_MACOSX) #include "base/mac/mac_util.h" #elif defined(OS_WIN) diff --git a/chrome/browser/dom_ui/dom_ui.cc b/chrome/browser/dom_ui/dom_ui.cc index fdefd38..aeb1da5 100644 --- a/chrome/browser/dom_ui/dom_ui.cc +++ b/chrome/browser/dom_ui/dom_ui.cc @@ -117,7 +117,7 @@ void DOMUI::CallJavascriptFunction( ExecuteJavascript(GetJavascript(function_name, args)); } -ThemeProvider* DOMUI::GetThemeProvider() const { +ui::ThemeProvider* DOMUI::GetThemeProvider() const { return GetProfile()->GetThemeProvider(); } diff --git a/chrome/browser/dom_ui/dom_ui.h b/chrome/browser/dom_ui/dom_ui.h index a74186d..f2463ab 100644 --- a/chrome/browser/dom_ui/dom_ui.h +++ b/chrome/browser/dom_ui/dom_ui.h @@ -21,10 +21,13 @@ class ListValue; class Profile; class RenderViewHost; class TabContents; -class ThemeProvider; class Value; struct ViewHostMsg_DomMessage_Params; +namespace ui { +class ThemeProvider; +} + // A DOMUI sets up the datasources and message handlers for a given HTML-based // UI. It is contained by a DOMUIManager. class DOMUI { @@ -125,7 +128,7 @@ class DOMUI { void CallJavascriptFunction(const std::wstring& function_name, const std::vector<const Value*>& args); - ThemeProvider* GetThemeProvider() const; + ui::ThemeProvider* GetThemeProvider() const; // May be overridden by DOMUI's which do not have a tab contents. virtual Profile* GetProfile() const; diff --git a/chrome/browser/dom_ui/dom_ui_theme_source.cc b/chrome/browser/dom_ui/dom_ui_theme_source.cc index cbddafd..f8238e4 100644 --- a/chrome/browser/dom_ui/dom_ui_theme_source.cc +++ b/chrome/browser/dom_ui/dom_ui_theme_source.cc @@ -5,7 +5,6 @@ #include "chrome/browser/dom_ui/dom_ui_theme_source.h" #include "app/resource_bundle.h" -#include "app/theme_provider.h" #include "base/message_loop.h" #include "base/ref_counted_memory.h" #include "chrome/browser/browser_thread.h" @@ -15,6 +14,7 @@ #include "chrome/browser/themes/browser_theme_provider.h" #include "chrome/common/url_constants.h" #include "googleurl/src/gurl.h" +#include "ui/base/theme_provider.h" // use a resource map rather than hard-coded strings. static const char* kNewTabCSSPath = "css/newtab.css"; @@ -100,7 +100,7 @@ MessageLoop* DOMUIThemeSource::MessageLoopForRequestPath( void DOMUIThemeSource::SendThemeBitmap(int request_id, int resource_id) { if (BrowserThemeProvider::IsThemeableImage(resource_id)) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - ThemeProvider* tp = profile_->GetThemeProvider(); + ui::ThemeProvider* tp = profile_->GetThemeProvider(); DCHECK(tp); scoped_refptr<RefCountedMemory> image_data(tp->GetRawData(resource_id)); diff --git a/chrome/browser/dom_ui/ntp_resource_cache.cc b/chrome/browser/dom_ui/ntp_resource_cache.cc index ee716eb..b94b4cd 100644 --- a/chrome/browser/dom_ui/ntp_resource_cache.cc +++ b/chrome/browser/dom_ui/ntp_resource_cache.cc @@ -9,7 +9,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/theme_provider.h" #include "base/command_line.h" #include "base/file_util.h" #include "base/ref_counted_memory.h" @@ -41,6 +40,7 @@ #include "grit/locale_settings.h" #include "grit/theme_resources.h" #include "ui/base/animation/animation.h" +#include "ui/base/theme_provider.h" #if defined(OS_WIN) || defined(TOOLKIT_VIEWS) #include "chrome/browser/ui/views/bookmark_bar_view.h" @@ -88,7 +88,7 @@ std::string SkColorToRGBAString(SkColor color) { // Get the CSS string for the background position on the new tab page for the // states when the bar is attached or detached. -std::string GetNewTabBackgroundCSS(const ThemeProvider* theme_provider, +std::string GetNewTabBackgroundCSS(const ui::ThemeProvider* theme_provider, bool bar_attached) { int alignment; theme_provider->GetDisplayProperty( @@ -129,7 +129,8 @@ std::string GetNewTabBackgroundCSS(const ThemeProvider* theme_provider, // How the background image on the new tab page should be tiled (see tiling // masks in browser_theme_provider.h). -std::string GetNewTabBackgroundTilingCSS(const ThemeProvider* theme_provider) { +std::string GetNewTabBackgroundTilingCSS( + const ui::ThemeProvider* theme_provider) { int repeat_mode; theme_provider->GetDisplayProperty( BrowserThemeProvider::NTP_BACKGROUND_TILING, &repeat_mode); @@ -415,7 +416,7 @@ void NTPResourceCache::CreateNewTabHTML() { } void NTPResourceCache::CreateNewTabIncognitoCSS() { - ThemeProvider* tp = profile_->GetThemeProvider(); + ui::ThemeProvider* tp = profile_->GetThemeProvider(); DCHECK(tp); // Get our theme colors @@ -451,7 +452,7 @@ void NTPResourceCache::CreateNewTabIncognitoCSS() { } void NTPResourceCache::CreateNewTabCSS() { - ThemeProvider* tp = profile_->GetThemeProvider(); + ui::ThemeProvider* tp = profile_->GetThemeProvider(); DCHECK(tp); // Get our theme colors diff --git a/chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc b/chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc index 3c1a871..7b89b50 100644 --- a/chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc +++ b/chrome/browser/dom_ui/options/advanced_options_utils_gtk.cc @@ -6,7 +6,6 @@ #include "chrome/browser/dom_ui/options/advanced_options_utils.h" -#include "app/gtk_signal.h" #include "base/file_util.h" #include "base/environment.h" #include "base/process_util.h" @@ -16,6 +15,7 @@ #include "chrome/browser/browser_thread.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/process_watcher.h" +#include "ui/base/gtk/gtk_signal.h" // Command used to configure GNOME proxy settings. The command was renamed // in January 2009, so both are used to work on both old and new systems. diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc index 54e54ee..e0341a5 100644 --- a/chrome/browser/extensions/extension_browser_event_router.cc +++ b/chrome/browser/extensions/extension_browser_event_router.cc @@ -114,7 +114,7 @@ void ExtensionBrowserEventRouter::Init() { #if defined(TOOLKIT_VIEWS) views::FocusManager::GetWidgetFocusManager()->AddFocusChangeListener(this); #elif defined(TOOLKIT_GTK) - ActiveWindowWatcherX::AddObserver(this); + ui::ActiveWindowWatcherX::AddObserver(this); #elif defined(OS_MACOSX) // Needed for when no suitable window can be passed to an extension as the // currently focused window. @@ -154,7 +154,7 @@ ExtensionBrowserEventRouter::~ExtensionBrowserEventRouter() { #if defined(TOOLKIT_VIEWS) views::FocusManager::GetWidgetFocusManager()->RemoveFocusChangeListener(this); #elif defined(TOOLKIT_GTK) - ActiveWindowWatcherX::RemoveObserver(this); + ui::ActiveWindowWatcherX::RemoveObserver(this); #endif } diff --git a/chrome/browser/extensions/extension_browser_event_router.h b/chrome/browser/extensions/extension_browser_event_router.h index a78dea8..27c562d 100644 --- a/chrome/browser/extensions/extension_browser_event_router.h +++ b/chrome/browser/extensions/extension_browser_event_router.h @@ -18,7 +18,7 @@ #include "views/view.h" #include "views/focus/focus_manager.h" #elif defined(TOOLKIT_GTK) -#include "app/active_window_watcher_x.h" +#include "ui/base/x/active_window_watcher_x.h" #endif // The ExtensionBrowserEventRouter listens to Browser window & tab events @@ -30,7 +30,7 @@ class ExtensionBrowserEventRouter : public TabStripModelObserver, #if defined(TOOLKIT_VIEWS) public views::WidgetFocusChangeListener, #elif defined(TOOLKIT_GTK) - public ActiveWindowWatcherX::Observer, + public ui::ActiveWindowWatcherX::Observer, #endif public BrowserList::Observer, public NotificationObserver { diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index a0882ee..19518c8 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -7,7 +7,6 @@ #include <string> #include "app/l10n_util.h" -#include "app/view_prop.h" #include "base/debug/trace_event.h" #include "base/i18n/rtl.h" #include "base/logging.h" @@ -46,11 +45,12 @@ #include "chrome/common/url_constants.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" +#include "ui/base/view_prop.h" #include "views/grid_layout.h" #include "views/widget/root_view.h" #include "views/window/window.h" -using app::ViewProp; +using ui::ViewProp; static const char kWindowObjectKey[] = "ChromeWindowObject"; diff --git a/chrome/browser/external_tab_container_win.h b/chrome/browser/external_tab_container_win.h index 9628a59..0495dde 100644 --- a/chrome/browser/external_tab_container_win.h +++ b/chrome/browser/external_tab_container_win.h @@ -31,7 +31,7 @@ class TabContentsContainer; class RenderViewContextMenuViews; struct NavigationInfo; -namespace app { +namespace ui { class ViewProp; } @@ -336,7 +336,7 @@ class ExternalTabContainer : public TabContentsDelegate, // page without chrome frame. bool route_all_top_level_navigations_; - scoped_ptr<app::ViewProp> prop_; + scoped_ptr<ui::ViewProp> prop_; DISALLOW_COPY_AND_ASSIGN(ExternalTabContainer); }; diff --git a/chrome/browser/gpu_process_host.cc b/chrome/browser/gpu_process_host.cc index 52d7fd4..332d23a 100644 --- a/chrome/browser/gpu_process_host.cc +++ b/chrome/browser/gpu_process_host.cc @@ -32,9 +32,9 @@ // These two #includes need to come after render_messages.h. #include <gdk/gdkwindow.h> // NOLINT #include <gdk/gdkx.h> // NOLINT -#include "app/x11_util.h" #include "gfx/gtk_native_view_id_manager.h" #include "gfx/size.h" +#include "ui/base/x/x11_util.h" #endif // defined(OS_LINUX) namespace { diff --git a/chrome/browser/ntp_background_util.cc b/chrome/browser/ntp_background_util.cc index b3926d5..41be57d 100644 --- a/chrome/browser/ntp_background_util.cc +++ b/chrome/browser/ntp_background_util.cc @@ -57,7 +57,7 @@ void PaintThemeBackground( // static void NtpBackgroundUtil::PaintBackgroundDetachedMode( - ThemeProvider* tp, gfx::Canvas* canvas, const gfx::Rect& area, + ui::ThemeProvider* tp, gfx::Canvas* canvas, const gfx::Rect& area, int tab_contents_height) { // Draw the background to match the new tab page. canvas->FillRectInt(tp->GetColor(BrowserThemeProvider::COLOR_NTP_BACKGROUND), diff --git a/chrome/browser/ntp_background_util.h b/chrome/browser/ntp_background_util.h index a4fa544..a9558ec 100644 --- a/chrome/browser/ntp_background_util.h +++ b/chrome/browser/ntp_background_util.h @@ -6,13 +6,15 @@ #define CHROME_BROWSER_NTP_BACKGROUND_UTIL_H_ #pragma once -class ThemeProvider; - namespace gfx { class Canvas; class Rect; } +namespace ui { +class ThemeProvider; +} + class NtpBackgroundUtil { public: // Paints the NTP background on |canvas|. |area| is the area of the canvas @@ -20,7 +22,7 @@ class NtpBackgroundUtil { // aligned images). |tab_contents_height| is necessary for correctly painting // bottom-aligned images since then the origin is the bottom of the web page. static void PaintBackgroundDetachedMode( - ThemeProvider* tp, gfx::Canvas* canvas, + ui::ThemeProvider* tp, gfx::Canvas* canvas, const gfx::Rect& area, int tab_contents_height); private: diff --git a/chrome/browser/possible_url_model.cc b/chrome/browser/possible_url_model.cc index e5af97e..068a793 100644 --- a/chrome/browser/possible_url_model.cc +++ b/chrome/browser/possible_url_model.cc @@ -5,7 +5,6 @@ #include "chrome/browser/possible_url_model.h" #include "app/resource_bundle.h" -#include "app/text_elider.h" #include "base/callback.h" #include "base/i18n/rtl.h" #include "base/string_util.h" @@ -20,6 +19,7 @@ #include "grit/generated_resources.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/models/table_model_observer.h" +#include "ui/base/text/text_elider.h" using base::Time; using base::TimeDelta; @@ -43,7 +43,7 @@ struct PossibleURLModel::Result { // fav_icon_map_ to lookup the favicon for the url, as well as the index // into results_ when the favicon is received. size_t index; - gfx::SortedDisplayURL display_url; + ui::SortedDisplayURL display_url; std::wstring title; }; @@ -87,7 +87,7 @@ void PossibleURLModel::OnHistoryQueryComplete(HistoryService::Handle h, results_[i].url = (*result)[i].url(); results_[i].index = i; results_[i].display_url = - gfx::SortedDisplayURL((*result)[i].url(), languages); + ui::SortedDisplayURL((*result)[i].url(), languages); results_[i].title = UTF16ToWide((*result)[i].title()); } diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc index edb16ef..14eaa55 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc @@ -4,7 +4,6 @@ #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" -#include "app/gfx/font_util.h" #include "base/json/json_writer.h" #include "base/singleton.h" #include "base/string_util.h" @@ -14,9 +13,6 @@ #include "chrome/browser/browser_thread.h" #include "chrome/browser/dom_ui/chrome_url_data_manager.h" #include "chrome/browser/dom_ui/dom_ui_util.h" -#if defined(TOOLKIT_GTK) -#include "chrome/browser/ui/gtk/html_dialog_gtk.h" -#endif // defined(TOOLKIT_GTK) #include "chrome/browser/platform_util.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" @@ -30,18 +26,23 @@ #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" -#if defined(TOOLKIT_VIEWS) -#include "chrome/browser/ui/views/browser_dialogs.h" -#endif // defined(TOOLKIT_GTK) #include "chrome/common/net/gaia/gaia_auth_fetcher.h" #include "chrome/common/net/gaia/gaia_constants.h" #include "chrome/common/net/gaia/google_service_auth_error.h" #include "chrome/common/pref_names.h" #include "chrome/common/service_messages.h" #include "gfx/font.h" - #include "grit/chromium_strings.h" #include "grit/locale_settings.h" +#include "ui/base/l10n/l10n_font_util.h" + +#if defined(TOOLKIT_GTK) +#include "chrome/browser/gtk/html_dialog_gtk.h" +#endif // defined(TOOLKIT_GTK) + +#if defined(TOOLKIT_VIEWS) +#include "chrome/browser/ui/views/browser_dialogs.h" +#endif // defined(TOOLKIT_GTK) static const wchar_t kGaiaLoginIFrameXPath[] = L"//iframe[@id='gaialogin']"; static const wchar_t kDoneIframeXPath[] = L"//iframe[@id='setupdone']"; @@ -137,12 +138,12 @@ void CloudPrintSetupFlow::GetDialogSize(gfx::Size* size) const { prefs->GetInteger(prefs::kWebKitDefaultFontSize)); if (setup_done_) { - *size = gfx::GetLocalizedContentsSizeForFont( + *size = ui::GetLocalizedContentsSizeForFont( IDS_CLOUD_PRINT_SETUP_WIZARD_DONE_WIDTH_CHARS, IDS_CLOUD_PRINT_SETUP_WIZARD_DONE_HEIGHT_LINES, approximate_web_font); } else { - *size = gfx::GetLocalizedContentsSizeForFont( + *size = ui::GetLocalizedContentsSizeForFont( IDS_CLOUD_PRINT_SETUP_WIZARD_WIDTH_CHARS, IDS_CLOUD_PRINT_SETUP_WIZARD_HEIGHT_LINES, approximate_web_font); @@ -284,7 +285,7 @@ void CloudPrintSetupFlow::ShowSetupDone() { gfx::Font approximate_web_font( UTF8ToUTF16(prefs->GetString(prefs::kWebKitSansSerifFontFamily)), prefs->GetInteger(prefs::kWebKitDefaultFontSize)); - gfx::Size done_size = gfx::GetLocalizedContentsSizeForFont( + gfx::Size done_size = ui::GetLocalizedContentsSizeForFont( IDS_CLOUD_PRINT_SETUP_WIZARD_DONE_WIDTH_CHARS, IDS_CLOUD_PRINT_SETUP_WIZARD_DONE_HEIGHT_LINES, approximate_web_font); diff --git a/chrome/browser/printing/print_dialog_gtk.h b/chrome/browser/printing/print_dialog_gtk.h index faeada9..4e610b3 100644 --- a/chrome/browser/printing/print_dialog_gtk.h +++ b/chrome/browser/printing/print_dialog_gtk.h @@ -8,9 +8,9 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/file_path.h" +#include "ui/base/gtk/gtk_signal.h" class Browser; diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h index db2f266..e13c0b3 100644 --- a/chrome/browser/profiles/profile.h +++ b/chrome/browser/profiles/profile.h @@ -91,7 +91,6 @@ class StatusTray; class TabRestoreService; class TemplateURLFetcher; class TemplateURLModel; -class ThemeProvider; class TokenService; class TransportSecurityPersister; class URLRequestContextGetter; diff --git a/chrome/browser/remoting/setup_flow.cc b/chrome/browser/remoting/setup_flow.cc index 4727cee..689049a 100644 --- a/chrome/browser/remoting/setup_flow.cc +++ b/chrome/browser/remoting/setup_flow.cc @@ -4,7 +4,6 @@ #include "chrome/browser/remoting/setup_flow.h" -#include "app/gfx/font_util.h" #include "app/l10n_util.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" @@ -23,6 +22,7 @@ #include "gfx/font.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" +#include "ui/base/l10n/l10n_font_util.h" namespace remoting { @@ -169,7 +169,7 @@ void SetupFlow::GetDialogSize(gfx::Size* size) const { prefs->GetInteger(prefs::kWebKitDefaultFontSize)); // TODO(pranavk) Replace the following SYNC resources with REMOTING Resources. - *size = gfx::GetLocalizedContentsSizeForFont( + *size = ui::GetLocalizedContentsSizeForFont( IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS, IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES, approximate_web_font); diff --git a/chrome/browser/renderer_host/backing_store_x.cc b/chrome/browser/renderer_host/backing_store_x.cc index d71b391..a87ed35 100644 --- a/chrome/browser/renderer_host/backing_store_x.cc +++ b/chrome/browser/renderer_host/backing_store_x.cc @@ -19,8 +19,6 @@ #include <limits> #include "app/surface/transport_dib.h" -#include "app/x11_util.h" -#include "app/x11_util_internal.h" #include "base/compiler_specific.h" #include "base/logging.h" #include "base/metrics/histogram.h" @@ -29,6 +27,8 @@ #include "gfx/rect.h" #include "skia/ext/platform_canvas.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/x/x11_util.h" +#include "ui/base/x/x11_util_internal.h" // Assume that somewhere along the line, someone will do width * height * 4 // with signed numbers. If the maximum value is 2**31, then 2**31 / 4 = @@ -64,12 +64,12 @@ BackingStoreX::BackingStoreX(RenderWidgetHost* widget, void* visual, int depth) : BackingStore(widget, size), - display_(x11_util::GetXDisplay()), - shared_memory_support_(x11_util::QuerySharedMemorySupport(display_)), - use_render_(x11_util::QueryRenderSupport(display_)), + display_(ui::GetXDisplay()), + shared_memory_support_(ui::QuerySharedMemorySupport(display_)), + use_render_(ui::QueryRenderSupport(display_)), visual_(visual), visual_depth_(depth), - root_window_(x11_util::GetX11RootWindow()) { + root_window_(ui::GetX11RootWindow()) { #if defined(OS_OPENBSD) || defined(OS_FREEBSD) COMPILE_ASSERT(_BYTE_ORDER == _LITTLE_ENDIAN, assumes_little_endian); #else @@ -82,13 +82,13 @@ BackingStoreX::BackingStoreX(RenderWidgetHost* widget, if (use_render_) { picture_ = XRenderCreatePicture( display_, pixmap_, - x11_util::GetRenderVisualFormat(display_, - static_cast<Visual*>(visual)), - 0, NULL); + ui::GetRenderVisualFormat(display_, + static_cast<Visual*>(visual)), + 0, NULL); pixmap_bpp_ = 0; } else { picture_ = 0; - pixmap_bpp_ = x11_util::BitsPerPixelForPixmapDepth(display_, depth); + pixmap_bpp_ = ui::BitsPerPixelForPixmapDepth(display_, depth); } pixmap_gc_ = XCreateGC(display_, pixmap_, 0, NULL); @@ -97,7 +97,7 @@ BackingStoreX::BackingStoreX(RenderWidgetHost* widget, BackingStoreX::BackingStoreX(RenderWidgetHost* widget, const gfx::Size& size) : BackingStore(widget, size), display_(NULL), - shared_memory_support_(x11_util::SHARED_MEMORY_NONE), + shared_memory_support_(ui::SHARED_MEMORY_NONE), use_render_(false), pixmap_bpp_(0), visual_(NULL), @@ -135,9 +135,9 @@ void BackingStoreX::PaintRectWithoutXrender( visual_depth_); // Draw ARGB transport DIB onto our pixmap. - x11_util::PutARGBImage(display_, visual_, visual_depth_, pixmap, - pixmap_gc_, static_cast<uint8*>(bitmap->memory()), - width, height); + ui::PutARGBImage(display_, visual_, visual_depth_, pixmap, + pixmap_gc_, static_cast<uint8*>(bitmap->memory()), + width, height); for (size_t i = 0; i < copy_rects.size(); i++) { const gfx::Rect& copy_rect = copy_rects[i]; @@ -184,7 +184,7 @@ void BackingStoreX::PaintToBackingStore( Picture picture; Pixmap pixmap; - if (shared_memory_support_ == x11_util::SHARED_MEMORY_PIXMAP) { + if (shared_memory_support_ == ui::SHARED_MEMORY_PIXMAP) { XShmSegmentInfo shminfo = {0}; shminfo.shmseg = dib->MapToX(display_); @@ -203,7 +203,7 @@ void BackingStoreX::PaintToBackingStore( pixmap = XCreatePixmap(display_, root_window_, width, height, 32); GC gc = XCreateGC(display_, pixmap, 0, NULL); - if (shared_memory_support_ == x11_util::SHARED_MEMORY_PUTIMAGE) { + if (shared_memory_support_ == ui::SHARED_MEMORY_PUTIMAGE) { const XID shmseg = dib->MapToX(display_); XShmSegmentInfo shminfo; @@ -269,7 +269,7 @@ void BackingStoreX::PaintToBackingStore( XFreeGC(display_, gc); } - picture = x11_util::CreatePictureFromSkiaPixmap(display_, pixmap); + picture = ui::CreatePictureFromSkiaPixmap(display_, pixmap); for (size_t i = 0; i < copy_rects.size(); i++) { const gfx::Rect& copy_rect = copy_rects[i]; @@ -291,7 +291,7 @@ void BackingStoreX::PaintToBackingStore( // In the case of shared memory, we wait for the composite to complete so that // we are sure that the X server has finished reading from the shared memory // segment. - if (shared_memory_support_ != x11_util::SHARED_MEMORY_NONE) + if (shared_memory_support_ != ui::SHARED_MEMORY_NONE) XSync(display_, False); XRenderFreePicture(display_, picture); @@ -315,7 +315,7 @@ bool BackingStoreX::CopyFromBackingStore(const gfx::Rect& rect, XImage* image; XShmSegmentInfo shminfo; // Used only when shared memory is enabled. - if (shared_memory_support_ != x11_util::SHARED_MEMORY_NONE) { + if (shared_memory_support_ != ui::SHARED_MEMORY_NONE) { // Use shared memory for faster copies when it's available. Visual* visual = static_cast<Visual*>(visual_); memset(&shminfo, 0, sizeof(shminfo)); @@ -364,7 +364,7 @@ bool BackingStoreX::CopyFromBackingStore(const gfx::Rect& rect, // Note that this also initializes the output bitmap as opaque. if (!output->initialize(width, height, true) || image->bits_per_pixel != 32) { - if (shared_memory_support_ != x11_util::SHARED_MEMORY_NONE) + if (shared_memory_support_ != ui::SHARED_MEMORY_NONE) DestroySharedImage(display_, image, &shminfo); else XDestroyImage(image); @@ -386,7 +386,7 @@ bool BackingStoreX::CopyFromBackingStore(const gfx::Rect& rect, } } - if (shared_memory_support_ != x11_util::SHARED_MEMORY_NONE) + if (shared_memory_support_ != ui::SHARED_MEMORY_NONE) DestroySharedImage(display_, image, &shminfo); else XDestroyImage(image); diff --git a/chrome/browser/renderer_host/backing_store_x.h b/chrome/browser/renderer_host/backing_store_x.h index fd249b3..ad0db60 100644 --- a/chrome/browser/renderer_host/backing_store_x.h +++ b/chrome/browser/renderer_host/backing_store_x.h @@ -6,10 +6,10 @@ #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_X_H_ #pragma once -#include "app/x11_util.h" #include "base/basictypes.h" #include "build/build_config.h" #include "chrome/browser/renderer_host/backing_store.h" +#include "ui/base/x/x11_util.h" namespace gfx { class Point; @@ -77,7 +77,7 @@ class BackingStoreX : public BackingStore { // displayed. Display* const display_; // What flavor, if any, MIT-SHM (X shared memory) support we have. - const x11_util::SharedMemorySupport shared_memory_support_; + const ui::SharedMemorySupport shared_memory_support_; // If this is true, then we can use Xrender to composite our pixmaps. const bool use_render_; // If |use_render_| is false, this is the number of bits-per-pixel for |depth| diff --git a/chrome/browser/renderer_host/render_message_filter_gtk.cc b/chrome/browser/renderer_host/render_message_filter_gtk.cc index d85f0bf..63c400f 100644 --- a/chrome/browser/renderer_host/render_message_filter_gtk.cc +++ b/chrome/browser/renderer_host/render_message_filter_gtk.cc @@ -7,7 +7,6 @@ #include <fcntl.h> #include <map> -#include "app/x11_util.h" #include "base/file_util.h" #include "base/lazy_instance.h" #include "base/path_service.h" @@ -24,6 +23,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" #include "third_party/WebKit/Source/WebKit/chromium/public/x11/WebScreenInfoFactory.h" #include "ui/base/clipboard/clipboard.h" +#include "ui/base/x/x11_util.h" using WebKit::WebScreenInfo; using WebKit::WebScreenInfoFactory; @@ -49,8 +49,8 @@ static base::LazyInstance<PrintingSequencePathMap> void RenderMessageFilter::DoOnGetScreenInfo(gfx::NativeViewId view, IPC::Message* reply_msg) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::BACKGROUND_X11)); - Display* display = x11_util::GetSecondaryDisplay(); - int screen = x11_util::GetDefaultScreen(display); + Display* display = ui::GetSecondaryDisplay(); + int screen = ui::GetDefaultScreen(display); WebScreenInfo results = WebScreenInfoFactory::screenInfo(display, screen); ViewHostMsg_GetScreenInfo::WriteReplyParams(reply_msg, results); Send(reply_msg); @@ -69,7 +69,7 @@ void RenderMessageFilter::DoOnGetWindowRect(gfx::NativeViewId view, if (window) { int x, y; unsigned width, height; - if (x11_util::GetWindowGeometry(&x, &y, &width, &height, window)) + if (ui::GetWindowGeometry(&x, &y, &width, &height, window)) rect = gfx::Rect(x, y, width, height); } } @@ -84,7 +84,7 @@ static XID GetTopLevelWindow(XID window) { bool parent_is_root; XID parent_window; - if (!x11_util::GetWindowParent(&parent_window, &parent_is_root, window)) + if (!ui::GetWindowParent(&parent_window, &parent_is_root, window)) return 0; if (parent_is_root) return window; @@ -107,7 +107,7 @@ void RenderMessageFilter::DoOnGetRootWindowRect(gfx::NativeViewId view, if (toplevel) { int x, y; unsigned width, height; - if (x11_util::GetWindowGeometry(&x, &y, &width, &height, toplevel)) + if (ui::GetWindowGeometry(&x, &y, &width, &height, toplevel)) rect = gfx::Rect(x, y, width, height); } } diff --git a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc index 3b07b90..3639c1f 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_gtk.cc @@ -19,7 +19,6 @@ #include <string> #include "app/l10n_util.h" -#include "app/x11_util.h" #include "base/command_line.h" #include "base/logging.h" #include "base/message_loop.h" @@ -38,6 +37,7 @@ #include "chrome/common/native_web_keyboard_event.h" #include "gfx/gtk_preserve_window.h" #include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.h" +#include "ui/base/x/x11_util.h" #include "webkit/glue/webaccessibility.h" #include "webkit/glue/webcursor_gtk_data.h" #include "webkit/plugins/npapi/webplugin.h" @@ -766,7 +766,7 @@ bool RenderWidgetHostViewGtk::IsPopup() { BackingStore* RenderWidgetHostViewGtk::AllocBackingStore( const gfx::Size& size) { return new BackingStoreX(host_, size, - x11_util::GetVisualFromGtkWidget(view_.get()), + ui::GetVisualFromGtkWidget(view_.get()), gtk_widget_get_visual(view_.get())->depth); } @@ -858,7 +858,7 @@ void RenderWidgetHostViewGtk::Paint(const gfx::Rect& damage_rect) { // In the common case, use XCopyArea. We don't draw more than once, so // we don't need to double buffer. backing_store->XShowRect(gfx::Point(0, 0), - paint_rect, x11_util::GetX11WindowFromGtkWidget(view_.get())); + paint_rect, ui::GetX11WindowFromGtkWidget(view_.get())); } else { // If the grey blend is showing, we make two drawing calls. Use double // buffering to prevent flicker. Use CairoShowRect because XShowRect 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 d980cb4..24fd3d7 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_views.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_views.cc @@ -8,7 +8,6 @@ #include <string> #include "app/l10n_util.h" -#include "app/x11_util.h" #include "base/command_line.h" #include "base/logging.h" #include "base/message_loop.h" @@ -25,6 +24,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/gtk/WebInputEventFactory.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" +#include "ui/base/x/x11_util.h" #include "views/event.h" #include "views/widget/widget.h" #include "views/widget/widget_gtk.h" @@ -328,7 +328,7 @@ BackingStore* RenderWidgetHostViewViews::AllocBackingStore( if (!nview) return NULL; return new BackingStoreX(host_, size, - x11_util::GetVisualFromGtkWidget(nview), + ui::GetVisualFromGtkWidget(nview), gtk_widget_get_visual(nview)->depth); } @@ -395,7 +395,7 @@ void RenderWidgetHostViewViews::Paint(gfx::Canvas* canvas) { // In the common case, use XCopyArea. We don't draw more than once, so // we don't need to double buffer. backing_store->XShowRect(origin, - paint_rect, x11_util::GetX11WindowFromGdkWindow(window)); + paint_rect, ui::GetX11WindowFromGdkWindow(window)); } else { // If the grey blend is showing, we make two drawing calls. Use double // buffering to prevent flicker. Use CairoShowRect because XShowRect 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 2d9ddb8..57ac721 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -9,7 +9,6 @@ #include "app/l10n_util.h" #include "app/l10n_util_win.h" #include "app/resource_bundle.h" -#include "app/view_prop.h" #include "base/command_line.h" #include "base/i18n/rtl.h" #include "base/metrics/histogram.h" @@ -41,6 +40,7 @@ #include "skia/ext/skia_utils_win.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFactory.h" +#include "ui/base/view_prop.h" #include "ui/base/win/hwnd_util.h" #include "views/accessibility/view_accessibility.h" #include "views/focus/focus_manager.h" @@ -53,9 +53,9 @@ #include "webkit/plugins/npapi/webplugin_delegate_impl.h" #include "webkit/plugins/npapi/webplugin.h" -using app::ViewProp; using base::TimeDelta; using base::TimeTicks; +using ui::ViewProp; using WebKit::WebInputEvent; using WebKit::WebInputEventFactory; using WebKit::WebMouseEvent; diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h index 50e59a6..015457e 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.h +++ b/chrome/browser/renderer_host/render_widget_host_view_win.h @@ -25,9 +25,8 @@ #include "gfx/native_widget_types.h" #include "webkit/glue/webcursor.h" -namespace app { -class ViewProp; -} +class BackingStore; +class RenderWidgetHost; namespace gfx { class Size; @@ -38,8 +37,9 @@ namespace IPC { class Message; } -class BackingStore; -class RenderWidgetHost; +namespace ui { +class ViewProp; +} typedef CWinTraits<WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0> RenderWidgetHostHWNDTraits; @@ -350,7 +350,7 @@ class RenderWidgetHostViewWin // method. WebKit::WebTextInputType text_input_type_; - ScopedVector<app::ViewProp> props_; + ScopedVector<ui::ViewProp> props_; DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewWin); }; diff --git a/chrome/browser/sync/sync_setup_flow.cc b/chrome/browser/sync/sync_setup_flow.cc index 3c2fe94..4bc7e82 100644 --- a/chrome/browser/sync/sync_setup_flow.cc +++ b/chrome/browser/sync/sync_setup_flow.cc @@ -4,7 +4,6 @@ #include "chrome/browser/sync/sync_setup_flow.h" -#include "app/gfx/font_util.h" #include "base/callback.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" @@ -21,13 +20,15 @@ #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" -#if defined(OS_MACOSX) -#include "chrome/browser/ui/cocoa/html_dialog_window_controller_cppsafe.h" -#endif #include "chrome/common/net/gaia/google_service_auth_error.h" #include "chrome/common/pref_names.h" #include "gfx/font.h" #include "grit/locale_settings.h" +#include "ui/base/l10n/l10n_font_util.h" + +#if defined(OS_MACOSX) +#include "chrome/browser/ui/cocoa/html_dialog_window_controller_cppsafe.h" +#endif // XPath expression for finding specific iframes. static const wchar_t* kLoginIFrameXPath = L"//iframe[@id='login']"; @@ -373,7 +374,7 @@ void SyncSetupFlow::GetDialogSize(gfx::Size* size) const { UTF8ToUTF16(prefs->GetString(prefs::kWebKitSansSerifFontFamily)), prefs->GetInteger(prefs::kWebKitDefaultFontSize)); - *size = gfx::GetLocalizedContentsSizeForFont( + *size = ui::GetLocalizedContentsSizeForFont( IDS_SYNC_SETUP_WIZARD_WIDTH_CHARS, IDS_SYNC_SETUP_WIZARD_HEIGHT_LINES, approximate_web_font); diff --git a/chrome/browser/tab_contents/navigation_entry.cc b/chrome/browser/tab_contents/navigation_entry.cc index 894a077..eb7611d 100644 --- a/chrome/browser/tab_contents/navigation_entry.cc +++ b/chrome/browser/tab_contents/navigation_entry.cc @@ -5,7 +5,6 @@ #include "chrome/browser/tab_contents/navigation_entry.h" #include "app/resource_bundle.h" -#include "app/text_elider.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/profiles/profile.h" @@ -15,6 +14,7 @@ #include "chrome/common/url_constants.h" #include "grit/app_resources.h" #include "net/base/net_util.h" +#include "ui/base/text/text_elider.h" // Use this to get a new unique ID for a NavigationEntry during construction. // The returned ID is guaranteed to be nonzero (which is the "no ID" indicator). @@ -95,9 +95,8 @@ const string16& NavigationEntry::GetTitleForDisplay( } else if (!url_.is_empty()) { title = net::FormatUrl(url_, languages); } - gfx::ElideString(UTF16ToWideHack(title), - chrome::kMaxTitleChars, - &elided_title); + ui::ElideString(UTF16ToWideHack(title), chrome::kMaxTitleChars, + &elided_title); cached_display_title_ = WideToUTF16Hack(elided_title); return cached_display_title_; } diff --git a/chrome/browser/tab_contents/tab_contents_view_gtk.h b/chrome/browser/tab_contents/tab_contents_view_gtk.h index 7e49207..a11a307 100644 --- a/chrome/browser/tab_contents/tab_contents_view_gtk.h +++ b/chrome/browser/tab_contents/tab_contents_view_gtk.h @@ -10,13 +10,13 @@ #include <vector> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/tab_contents/tab_contents_view.h" #include "chrome/browser/ui/gtk/focus_store_gtk.h" #include "chrome/browser/ui/gtk/owned_widget_gtk.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/gtk/gtk_signal.h" class ConstrainedWindowGtk; class RenderViewContextMenuGtk; diff --git a/chrome/browser/tab_contents/web_contents_unittest.cc b/chrome/browser/tab_contents/web_contents_unittest.cc index a494dd5..39f0d60 100644 --- a/chrome/browser/tab_contents/web_contents_unittest.cc +++ b/chrome/browser/tab_contents/web_contents_unittest.cc @@ -4,7 +4,6 @@ #include <vector> -#include "app/message_box_flags.h" #include "base/logging.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_thread.h" @@ -27,6 +26,7 @@ #include "chrome/test/testing_profile.h" #include "ipc/ipc_channel.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/message_box_flags.h" using webkit_glue::PasswordForm; @@ -1524,7 +1524,7 @@ TEST_F(TabContentsTest, NoJSMessageOnInterstitials) { IPC::Message* dummy_message = new IPC::Message; bool did_suppress_message = false; contents()->RunJavaScriptMessage(L"This is an informative message", L"OK", - kGURL, MessageBoxFlags::kIsJavascriptAlert, dummy_message, + kGURL, ui::MessageBoxFlags::kIsJavascriptAlert, dummy_message, &did_suppress_message); EXPECT_TRUE(did_suppress_message); } diff --git a/chrome/browser/tab_contents/web_drag_dest_gtk.h b/chrome/browser/tab_contents/web_drag_dest_gtk.h index ef59559..00f785a 100644 --- a/chrome/browser/tab_contents/web_drag_dest_gtk.h +++ b/chrome/browser/tab_contents/web_drag_dest_gtk.h @@ -8,11 +8,11 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "base/task.h" #include "chrome/browser/bookmarks/bookmark_node_data.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" +#include "ui/base/gtk/gtk_signal.h" #include "webkit/glue/webdropdata.h" class TabContents; diff --git a/chrome/browser/themes/browser_theme_provider.h b/chrome/browser/themes/browser_theme_provider.h index e400a1f..d3865db 100644 --- a/chrome/browser/themes/browser_theme_provider.h +++ b/chrome/browser/themes/browser_theme_provider.h @@ -10,12 +10,12 @@ #include <set> #include <string> -#include "app/theme_provider.h" #include "base/ref_counted.h" #include "base/threading/non_thread_safe.h" +#include "ui/base/theme_provider.h" namespace color_utils { - struct HSL; +struct HSL; } class BrowserThemePack; @@ -33,7 +33,7 @@ extern "C" NSString* const kBrowserThemeDidChangeNotification; #endif // __OBJC__ class BrowserThemeProvider : public base::NonThreadSafe, - public ThemeProvider { + public ui::ThemeProvider { public: // Public constants used in BrowserThemeProvider and its subclasses: @@ -130,7 +130,7 @@ class BrowserThemeProvider : public base::NonThreadSafe, REPEAT = 3 } Tiling; - // ThemeProvider implementation. + // ui::ThemeProvider implementation. virtual void Init(Profile* profile); virtual SkBitmap* GetBitmapNamed(int id) const; virtual SkColor GetColor(int id) const; diff --git a/chrome/browser/ui/app_modal_dialogs/js_modal_dialog.cc b/chrome/browser/ui/app_modal_dialogs/js_modal_dialog.cc index 801562d..6df8d16 100644 --- a/chrome/browser/ui/app_modal_dialogs/js_modal_dialog.cc +++ b/chrome/browser/ui/app_modal_dialogs/js_modal_dialog.cc @@ -4,7 +4,6 @@ #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" -#include "app/text_elider.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_shutdown.h" @@ -14,6 +13,7 @@ #include "chrome/common/notification_service.h" #include "chrome/common/notification_type.h" #include "ipc/ipc_message.h" +#include "ui/base/text/text_elider.h" namespace { @@ -43,11 +43,11 @@ JavaScriptAppModalDialog::JavaScriptAppModalDialog( // We trim the various parts of the message dialog because otherwise we can // overflow the message dialog (and crash/hang the GTK+ version). string16 elided_text; - gfx::ElideRectangleString(WideToUTF16(message_text), - kMessageTextMaxRows, kMessageTextMaxCols, &elided_text); + ui::ElideRectangleString(WideToUTF16(message_text), + kMessageTextMaxRows, kMessageTextMaxCols, &elided_text); message_text_ = UTF16ToWide(elided_text); - gfx::ElideString(default_prompt_text, kDefaultPromptTextSize, - &default_prompt_text_); + ui::ElideString(default_prompt_text, kDefaultPromptTextSize, + &default_prompt_text_); DCHECK((tab_contents_ != NULL) != (extension_host_ != NULL)); InitNotifications(); diff --git a/chrome/browser/ui/app_modal_dialogs/message_box_handler.cc b/chrome/browser/ui/app_modal_dialogs/message_box_handler.cc index bdf7d42..6adf2b2 100644 --- a/chrome/browser/ui/app_modal_dialogs/message_box_handler.cc +++ b/chrome/browser/ui/app_modal_dialogs/message_box_handler.cc @@ -5,8 +5,6 @@ #include "chrome/browser/ui/app_modal_dialogs/message_box_handler.h" #include "app/l10n_util.h" -#include "app/message_box_flags.h" -#include "app/text_elider.h" #include "base/i18n/rtl.h" #include "base/utf_string_conversions.h" #include "build/build_config.h" @@ -21,6 +19,8 @@ #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" #include "grit/chromium_strings.h" +#include "ui/base/message_box_flags.h" +#include "ui/base/text/text_elider.h" static std::wstring GetTitle(Profile* profile, bool is_alert, @@ -46,7 +46,7 @@ static std::wstring GetTitle(Profile* profile, // TODO(brettw) it should be easier than this to do the correct language // handling without getting the accept language from the profile. - string16 base_address = gfx::ElideUrl(frame_url.GetOrigin(), + string16 base_address = ui::ElideUrl(frame_url.GetOrigin(), gfx::Font(), 0, UTF8ToWide(profile->GetPrefs()->GetString(prefs::kAcceptLanguages))); @@ -68,7 +68,7 @@ void RunJavascriptMessageBox(Profile* profile, const std::wstring& default_prompt_text, bool display_suppress_checkbox, IPC::Message* reply_msg) { - bool is_alert = dialog_flags == MessageBoxFlags::kIsJavascriptAlert; + bool is_alert = dialog_flags == ui::MessageBoxFlags::kIsJavascriptAlert; std::wstring title = GetTitle(profile, is_alert, frame_url); AppModalDialogQueue::GetInstance()->AddDialog(new JavaScriptAppModalDialog( delegate, title, dialog_flags, message_text, default_prompt_text, @@ -84,7 +84,7 @@ void RunBeforeUnloadDialog(TabContents* tab_contents, tab_contents, UTF16ToWideHack( l10n_util::GetStringUTF16(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE)), - MessageBoxFlags::kIsJavascriptConfirm, + ui::MessageBoxFlags::kIsJavascriptConfirm, message_text, std::wstring(), false, diff --git a/chrome/browser/ui/cocoa/background_gradient_view.mm b/chrome/browser/ui/cocoa/background_gradient_view.mm index 1c5735f..7b031a2 100644 --- a/chrome/browser/ui/cocoa/background_gradient_view.mm +++ b/chrome/browser/ui/cocoa/background_gradient_view.mm @@ -33,7 +33,7 @@ - (void)drawBackground { BOOL isKey = [[self window] isKeyWindow]; - ThemeProvider* themeProvider = [[self window] themeProvider]; + ui::ThemeProvider* themeProvider = [[self window] themeProvider]; if (themeProvider) { NSColor* backgroundImageColor = themeProvider->GetNSImageColorNamed(IDR_THEME_TOOLBAR, false); @@ -70,7 +70,7 @@ - (NSColor*)strokeColor { BOOL isKey = [[self window] isKeyWindow]; - ThemeProvider* themeProvider = [[self window] themeProvider]; + ui::ThemeProvider* themeProvider = [[self window] themeProvider]; if (!themeProvider) return [NSColor blackColor]; return themeProvider->GetNSColor( diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h index 6406ce98..4989f57 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h @@ -386,7 +386,7 @@ willAnimateFromState:(bookmarks::VisualState)oldState - (int64)nodeIdFromMenuTag:(int32)tag; - (int32)menuTagFromNodeId:(int64)menuid; - (const BookmarkNode*)nodeFromMenuItem:(id)sender; -- (void)updateTheme:(ThemeProvider*)themeProvider; +- (void)updateTheme:(ui::ThemeProvider*)themeProvider; - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point; - (BOOL)isEventAnExitEvent:(NSEvent*)event; - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm index 91a6ac5..04ada27 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm @@ -718,8 +718,8 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; // Called after the current theme has changed. - (void)themeDidChangeNotification:(NSNotification*)aNotification { - ThemeProvider* themeProvider = - static_cast<ThemeProvider*>([[aNotification object] pointerValue]); + ui::ThemeProvider* themeProvider = + static_cast<ui::ThemeProvider*>([[aNotification object] pointerValue]); [self updateTheme:themeProvider]; } @@ -1103,7 +1103,7 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; // the hierarchy. If that second part is now true, set the color. // (If not we'll set the color on the 1st themeChanged: // notification.) - ThemeProvider* themeProvider = [[[self view] window] themeProvider]; + ui::ThemeProvider* themeProvider = [[[self view] window] themeProvider]; if (themeProvider) { NSColor* color = themeProvider->GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT, @@ -1582,7 +1582,7 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; // because our trigger is an [NSView viewWillMoveToWindow:], which the // controller doesn't normally know about. Otherwise we don't have // access to the theme before we know what window we will be on. -- (void)updateTheme:(ThemeProvider*)themeProvider { +- (void)updateTheme:(ui::ThemeProvider*)themeProvider { if (!themeProvider) return; NSColor* color = @@ -1972,7 +1972,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { return tc ? tc->view()->GetContainerSize().height() : 0; } -- (ThemeProvider*)themeProvider { +- (ui::ThemeProvider*)themeProvider { return browser_->profile()->GetThemeProvider(); } diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm index 80f6b19..95255c8 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm @@ -4,7 +4,6 @@ #import <Cocoa/Cocoa.h> -#include "app/theme_provider.h" #include "base/basictypes.h" #include "base/scoped_nsobject.h" #include "base/string16.h" @@ -29,6 +28,7 @@ #import "testing/gtest_mac.h" #include "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" +#include "ui/base/theme_provider.h" // Just like a BookmarkBarController but openURL: is stubbed out. @interface BookmarkBarControllerNoOpen : BookmarkBarController { @@ -170,7 +170,7 @@ @end -class FakeTheme : public ThemeProvider { +class FakeTheme : public ui::ThemeProvider { public: FakeTheme(NSColor* color) : color_(color) { } scoped_nsobject<NSColor> color_; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm index 5044e60..53bb97d 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm @@ -1407,7 +1407,7 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) { return y; } -- (ThemeProvider*)themeProvider { +- (ui::ThemeProvider*)themeProvider { return [parentController_ themeProvider]; } diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h index 1942ebd..02936ae 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h @@ -18,7 +18,10 @@ @class BookmarkBarView; class TabContents; + +namespace ui { class ThemeProvider; +} // An interface to allow mocking of a BookmarkBarController by the // BookmarkBarToolbarView. @@ -29,7 +32,7 @@ class ThemeProvider; - (int)currentTabContentsHeight; // Current theme provider, passed to the cross platform NtpBackgroundUtil class. -- (ThemeProvider*)themeProvider; +- (ui::ThemeProvider*)themeProvider; @end diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm index 760de17..16fb677 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.mm @@ -4,7 +4,6 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h" -#include "app/theme_provider.h" #include "gfx/rect.h" #include "chrome/browser/ntp_background_util.h" #include "chrome/browser/themes/browser_theme_provider.h" @@ -13,6 +12,7 @@ #import "chrome/browser/ui/cocoa/browser_window_controller.h" #import "chrome/browser/ui/cocoa/themed_window.h" #include "gfx/canvas_skia_paint.h" +#include "ui/base/theme_provider.h" const CGFloat kBorderRadius = 3.0; @@ -45,7 +45,7 @@ const CGFloat kBorderRadius = 3.0; NSRect bounds = [self bounds]; - ThemeProvider* themeProvider = [controller_ themeProvider]; + ui::ThemeProvider* themeProvider = [controller_ themeProvider]; if (!themeProvider) return; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm index 24d971a..ef8bfc8 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view_unittest.mm @@ -4,7 +4,6 @@ #import <Cocoa/Cocoa.h> -#include "app/theme_provider.h" #include "base/scoped_nsobject.h" #include "chrome/browser/themes/browser_theme_provider.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" @@ -16,6 +15,7 @@ #include "testing/platform_test.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/theme_provider.h" using ::testing::_; using ::testing::DoAll; @@ -23,7 +23,7 @@ using ::testing::Return; using ::testing::SetArgumentPointee; // When testing the floating drawing, we need to have a source of theme data. -class MockThemeProvider : public ThemeProvider { +class MockThemeProvider : public ui::ThemeProvider { public: // Cross platform methods MOCK_METHOD1(Init, void(Profile*)); @@ -58,11 +58,11 @@ class MockThemeProvider : public ThemeProvider { NSObject<BookmarkBarState, BookmarkBarToolbarViewController> { @private int currentTabContentsHeight_; - ThemeProvider* themeProvider_; + ui::ThemeProvider* themeProvider_; bookmarks::VisualState visualState_; } @property (nonatomic, assign) int currentTabContentsHeight; -@property (nonatomic, assign) ThemeProvider* themeProvider; +@property (nonatomic, assign) ui::ThemeProvider* themeProvider; @property (nonatomic, assign) bookmarks::VisualState visualState; // |BookmarkBarState| protocol: diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm index 5083367..06a5443 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm @@ -16,7 +16,7 @@ @interface BookmarkBarView (Private) - (void)themeDidChangeNotification:(NSNotification*)aNotification; -- (void)updateTheme:(ThemeProvider*)themeProvider; +- (void)updateTheme:(ui::ThemeProvider*)themeProvider; @end @implementation BookmarkBarView @@ -59,7 +59,7 @@ // controller desn't have access to it until it's placed in the view // hierarchy. This is the spot where we close the loop. - (void)viewWillMoveToWindow:(NSWindow*)window { - ThemeProvider* themeProvider = [window themeProvider]; + ui::ThemeProvider* themeProvider = [window themeProvider]; [self updateTheme:themeProvider]; [controller_ updateTheme:themeProvider]; } @@ -70,14 +70,14 @@ // Called after the current theme has changed. - (void)themeDidChangeNotification:(NSNotification*)aNotification { - ThemeProvider* themeProvider = - static_cast<ThemeProvider*>([[aNotification object] pointerValue]); + ui::ThemeProvider* themeProvider = + static_cast<ui::ThemeProvider*>([[aNotification object] pointerValue]); [self updateTheme:themeProvider]; } // Adapt appearance to the current theme. Called after theme changes and before // this is shown for the first time. -- (void)updateTheme:(ThemeProvider*)themeProvider { +- (void)updateTheme:(ui::ThemeProvider*)themeProvider { if (!themeProvider) return; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h index 0bea5a5e..6525e8e 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h @@ -13,7 +13,10 @@ struct BookmarkNodeData; class BookmarkModel; class BookmarkNode; @class BrowserWindowController; + +namespace ui { class ThemeProvider; +} // Protocol for a BookmarkButton's delegate, responsible for doing // things on behalf of a bookmark button. @@ -115,7 +118,7 @@ class ThemeProvider; - (CGFloat)indicatorPosForDragToPoint:(NSPoint)point; // Return the theme provider associated with this browser window. -- (ThemeProvider*)themeProvider; +- (ui::ThemeProvider*)themeProvider; // Called just before a child folder puts itself on screen. - (void)childFolderWillShow:(id<BookmarkButtonControllerProtocol>)child; diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm index c797992..7f9e616 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.mm @@ -4,7 +4,6 @@ #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h" -#include "app/text_elider.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" // IDC_BOOKMARK_MENU @@ -13,6 +12,7 @@ #include "chrome/browser/ui/browser.h" #import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h" #include "chrome/browser/ui/cocoa/event_utils.h" +#include "ui/base/text/text_elider.h" #include "webkit/glue/window_open_disposition.h" namespace { @@ -29,10 +29,10 @@ const NSUInteger kMaximumMenuPixelsWide = 300; NSFont* nsfont = [NSFont menuBarFontOfSize:0]; // 0 means "default" gfx::Font font(base::SysNSStringToUTF16([nsfont fontName]), static_cast<int>([nsfont pointSize])); - string16 title = gfx::ElideText(node->GetTitle(), - font, - kMaximumMenuPixelsWide, - false); + string16 title = ui::ElideText(node->GetTitle(), + font, + kMaximumMenuPixelsWide, + false); return base::SysUTF16ToNSString(title); } diff --git a/chrome/browser/ui/cocoa/browser_frame_view.mm b/chrome/browser/ui/cocoa/browser_frame_view.mm index a966785..4b6980b 100644 --- a/chrome/browser/ui/cocoa/browser_frame_view.mm +++ b/chrome/browser/ui/cocoa/browser_frame_view.mm @@ -212,7 +212,7 @@ static BOOL gCanGetCornerRadius = NO; bounds:(NSRect)bounds offset:(NSPoint)offset forceBlackBackground:(BOOL)forceBlackBackground { - ThemeProvider* themeProvider = [[view window] themeProvider]; + ui::ThemeProvider* themeProvider = [[view window] themeProvider]; if (!themeProvider) return NO; @@ -324,7 +324,7 @@ static BOOL gCanGetCornerRadius = NO; } + (NSColor*)titleColorForThemeView:(NSView*)view { - ThemeProvider* themeProvider = [[view window] themeProvider]; + ui::ThemeProvider* themeProvider = [[view window] themeProvider]; if (!themeProvider) return [NSColor windowFrameTextColor]; diff --git a/chrome/browser/ui/cocoa/browser_window_controller.h b/chrome/browser/ui/cocoa/browser_window_controller.h index 7c2347e..51424be 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.h +++ b/chrome/browser/ui/cocoa/browser_window_controller.h @@ -245,7 +245,7 @@ class TabContents; - (void)updateSidebarForContents:(TabContents*)contents; // Gets the current theme provider. -- (ThemeProvider*)themeProvider; +- (ui::ThemeProvider*)themeProvider; // Gets the window style. - (ThemedWindowStyle)themedWindowStyle; diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index d7207d6..d761f54 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm @@ -1477,7 +1477,7 @@ [[self window] setViewsNeedDisplay:YES]; } -- (ThemeProvider*)themeProvider { +- (ui::ThemeProvider*)themeProvider { return browser_->profile()->GetThemeProvider(); } diff --git a/chrome/browser/ui/cocoa/bubble_view.mm b/chrome/browser/ui/cocoa/bubble_view.mm index a888ebc..0b92f39 100644 --- a/chrome/browser/ui/cocoa/bubble_view.mm +++ b/chrome/browser/ui/cocoa/bubble_view.mm @@ -74,7 +74,7 @@ const float kWindowEdge = 0.7f; float bottomRightRadius = cornerFlags_ & kRoundedBottomRightCorner ? kBubbleCornerRadius : 0; - ThemeProvider* themeProvider = + ui::ThemeProvider* themeProvider = themeProvider_ ? [themeProvider_ themeProvider] : [[self window] themeProvider]; diff --git a/chrome/browser/ui/cocoa/chrome_browser_window.mm b/chrome/browser/ui/cocoa/chrome_browser_window.mm index abac221..cceeb14 100644 --- a/chrome/browser/ui/cocoa/chrome_browser_window.mm +++ b/chrome/browser/ui/cocoa/chrome_browser_window.mm @@ -28,7 +28,7 @@ [self setOpaque:YES]; } -- (ThemeProvider*)themeProvider { +- (ui::ThemeProvider*)themeProvider { id delegate = [self delegate]; if (![delegate respondsToSelector:@selector(themeProvider)]) return NULL; diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.h b/chrome/browser/ui/cocoa/download/download_item_cell.h index a5ffaeb..0af75f26 100644 --- a/chrome/browser/ui/cocoa/download/download_item_cell.h +++ b/chrome/browser/ui/cocoa/download/download_item_cell.h @@ -45,7 +45,7 @@ enum DownloadItemMousePosition { CGFloat statusAlpha_; scoped_nsobject<NSAnimation> hideStatusAnimation_; - scoped_ptr<ThemeProvider> themeProvider_; + scoped_ptr<ui::ThemeProvider> themeProvider_; } - (void)setStateFromDownload:(BaseDownloadItemModel*)downloadModel; diff --git a/chrome/browser/ui/cocoa/download/download_item_cell.mm b/chrome/browser/ui/cocoa/download/download_item_cell.mm index 586252d..e4d29e6 100644 --- a/chrome/browser/ui/cocoa/download/download_item_cell.mm +++ b/chrome/browser/ui/cocoa/download/download_item_cell.mm @@ -5,7 +5,6 @@ #import "chrome/browser/ui/cocoa/download/download_item_cell.h" #include "app/l10n_util.h" -#include "app/text_elider.h" #include "base/sys_string_conversions.h" #include "chrome/browser/download/download_item.h" #include "chrome/browser/download/download_item_model.h" @@ -19,6 +18,7 @@ #include "grit/theme_resources.h" #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" +#include "ui/base/text/text_elider.h" namespace { @@ -85,9 +85,9 @@ const int kCompleteAnimationDuration = 2.5; animationCurve:(NSAnimationCurve)animationCurve; @end -class BackgroundTheme : public ThemeProvider { +class BackgroundTheme : public ui::ThemeProvider { public: - BackgroundTheme(ThemeProvider* provider); + BackgroundTheme(ui::ThemeProvider* provider); virtual void Init(Profile* profile) { } virtual SkBitmap* GetBitmapNamed(int id) const { return nil; } @@ -103,13 +103,13 @@ public: virtual NSGradient* GetNSGradient(int id) const; private: - ThemeProvider* provider_; + ui::ThemeProvider* provider_; scoped_nsobject<NSGradient> buttonGradient_; scoped_nsobject<NSGradient> buttonPressedGradient_; scoped_nsobject<NSColor> borderColor_; }; -BackgroundTheme::BackgroundTheme(ThemeProvider* provider) : +BackgroundTheme::BackgroundTheme(ui::ThemeProvider* provider) : provider_(provider) { NSColor* bgColor = [NSColor colorWithCalibratedRed:241/255.0 green:245/255.0 @@ -168,7 +168,7 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const { progressed:(NSAnimationProgress)progress; - (NSString*)elideTitle:(int)availableWidth; - (NSString*)elideStatus:(int)availableWidth; -- (ThemeProvider*)backgroundThemeWrappingProvider:(ThemeProvider*)provider; +- (ui::ThemeProvider*)backgroundThemeWrappingProvider:(ui::ThemeProvider*)provider; - (BOOL)pressedWithDefaultThemeOnPart:(DownloadItemMousePosition)part; - (NSColor*)titleColorForPart:(DownloadItemMousePosition)part; - (void)drawSecondaryTitleInRect:(NSRect)innerFrame; @@ -398,7 +398,7 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const { [font pointSize]); return base::SysUTF16ToNSString( - ElideFilename(downloadPath_, font_chr, availableWidth)); + ui::ElideFilename(downloadPath_, font_chr, availableWidth)); } - (NSString*)elideStatus:(int)availableWidth { @@ -406,14 +406,14 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const { gfx::Font font_chr(base::SysNSStringToUTF16([font fontName]), [font pointSize]); - return base::SysUTF16ToNSString(ElideText( + return base::SysUTF16ToNSString(ui::ElideText( base::SysNSStringToUTF16([self secondaryTitle]), font_chr, availableWidth, false)); } -- (ThemeProvider*)backgroundThemeWrappingProvider:(ThemeProvider*)provider { +- (ui::ThemeProvider*)backgroundThemeWrappingProvider:(ui::ThemeProvider*)provider { if (!themeProvider_.get()) { themeProvider_.reset(new BackgroundTheme(provider)); } @@ -423,7 +423,8 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const { // Returns if |part| was pressed while the default theme was active. - (BOOL)pressedWithDefaultThemeOnPart:(DownloadItemMousePosition)part { - ThemeProvider* themeProvider = [[[self controlView] window] themeProvider]; + ui::ThemeProvider* themeProvider = + [[[self controlView] window] themeProvider]; bool isDefaultTheme = !themeProvider->HasCustomImage(IDR_THEME_BUTTON_BACKGROUND); return isDefaultTheme && [self isHighlighted] && mousePosition_ == part; @@ -431,7 +432,8 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const { // Returns the text color that should be used to draw text on |part|. - (NSColor*)titleColorForPart:(DownloadItemMousePosition)part { - ThemeProvider* themeProvider = [[[self controlView] window] themeProvider]; + ui::ThemeProvider* themeProvider = + [[[self controlView] window] themeProvider]; NSColor* themeTextColor = themeProvider->GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT, true); @@ -480,7 +482,8 @@ NSGradient* BackgroundTheme::GetNSGradient(int id) const { // with a background that looks like windows (some transparent white) if a // theme is used. Use custom theme object with a white color gradient to trick // the superclass into drawing what we want. - ThemeProvider* themeProvider = [[[self controlView] window] themeProvider]; + ui::ThemeProvider* themeProvider = + [[[self controlView] window] themeProvider]; bool isDefaultTheme = !themeProvider->HasCustomImage(IDR_THEME_BUTTON_BACKGROUND); diff --git a/chrome/browser/ui/cocoa/download/download_item_controller.mm b/chrome/browser/ui/cocoa/download/download_item_controller.mm index 23603f8..80f96d8 100644 --- a/chrome/browser/ui/cocoa/download/download_item_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_item_controller.mm @@ -6,7 +6,6 @@ #include "app/l10n_util_mac.h" #include "app/resource_bundle.h" -#include "app/text_elider.h" #include "base/mac/mac_util.h" #include "base/metrics/histogram.h" #include "base/string16.h" @@ -27,6 +26,7 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" +#include "ui/base/text/text_elider.h" namespace { @@ -87,7 +87,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { @interface DownloadItemController (Private) - (void)themeDidChangeNotification:(NSNotification*)aNotification; -- (void)updateTheme:(ThemeProvider*)themeProvider; +- (void)updateTheme:(ui::ThemeProvider*)themeProvider; - (void)setState:(DownoadItemState)state; @end @@ -191,15 +191,15 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { // Elide giant extensions. if (extension.length() > kFileNameMaxLength / 2) { std::wstring wide_extension; - gfx::ElideString(UTF8ToWide(extension), kFileNameMaxLength / 2, - &wide_extension); + ui::ElideString(UTF8ToWide(extension), kFileNameMaxLength / 2, + &wide_extension); extension = WideToUTF8(wide_extension); } // Rebuild the filename.extension. std::wstring rootname = UTF8ToWide(filename.RemoveExtension().value()); - gfx::ElideString(rootname, kFileNameMaxLength - extension.length(), - &rootname); + ui::ElideString(rootname, kFileNameMaxLength - extension.length(), + &rootname); std::string new_filename = WideToUTF8(rootname); if (extension.length()) new_filename += std::string(".") + extension; @@ -269,7 +269,7 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { } - (void)updateToolTip { - string16 elidedFilename = gfx::ElideFilename( + string16 elidedFilename = ui::ElideFilename( [self download]->GetFileNameToReportUser(), gfx::Font(), kToolTipMaxWidth); [progressView_ setToolTip:base::SysUTF16ToNSString(elidedFilename)]; @@ -306,14 +306,14 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { // Called after the current theme has changed. - (void)themeDidChangeNotification:(NSNotification*)aNotification { - ThemeProvider* themeProvider = - static_cast<ThemeProvider*>([[aNotification object] pointerValue]); + ui::ThemeProvider* themeProvider = + static_cast<ui::ThemeProvider*>([[aNotification object] pointerValue]); [self updateTheme:themeProvider]; } // Adapt appearance to the current theme. Called after theme changes and before // this is shown for the first time. -- (void)updateTheme:(ThemeProvider*)themeProvider { +- (void)updateTheme:(ui::ThemeProvider*)themeProvider { NSColor* color = themeProvider->GetNSColor(BrowserThemeProvider::COLOR_TAB_TEXT, true); [dangerousDownloadLabel_ setTextColor:color]; diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm index f88071f..bede2d6 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm @@ -161,7 +161,8 @@ const NSTimeInterval kAutoCloseDelaySeconds = 5; NSColor* color = nil; if (bridge_.get() && bridge_->browser() && bridge_->browser()->profile()) { - ThemeProvider* provider = bridge_->browser()->profile()->GetThemeProvider(); + ui::ThemeProvider* provider = + bridge_->browser()->profile()->GetThemeProvider(); color = provider->GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT, false); diff --git a/chrome/browser/ui/cocoa/download/download_shelf_view.mm b/chrome/browser/ui/cocoa/download/download_shelf_view.mm index f3840ef..55b88d5 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_view.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_view.mm @@ -14,7 +14,7 @@ - (NSColor*)strokeColor { BOOL isKey = [[self window] isKeyWindow]; - ThemeProvider* themeProvider = [[self window] themeProvider]; + ui::ThemeProvider* themeProvider = [[self window] themeProvider]; return themeProvider ? themeProvider->GetNSColor( isKey ? BrowserThemeProvider::COLOR_TOOLBAR_STROKE : BrowserThemeProvider::COLOR_TOOLBAR_STROKE_INACTIVE, true) : @@ -23,7 +23,7 @@ - (void)drawRect:(NSRect)rect { BOOL isKey = [[self window] isKeyWindow]; - ThemeProvider* themeProvider = [[self window] themeProvider]; + ui::ThemeProvider* themeProvider = [[self window] themeProvider]; if (!themeProvider) return; diff --git a/chrome/browser/ui/cocoa/external_protocol_dialog.mm b/chrome/browser/ui/cocoa/external_protocol_dialog.mm index e72394b..09985c4 100644 --- a/chrome/browser/ui/cocoa/external_protocol_dialog.mm +++ b/chrome/browser/ui/cocoa/external_protocol_dialog.mm @@ -5,7 +5,6 @@ #import "chrome/browser/ui/cocoa/external_protocol_dialog.h" #include "app/l10n_util_mac.h" -#include "app/text_elider.h" #include "base/message_loop.h" #include "base/metrics/histogram.h" #include "base/string_util.h" @@ -14,6 +13,7 @@ #include "chrome/browser/external_protocol_handler.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +#include "ui/base/text/text_elider.h" /////////////////////////////////////////////////////////////////////////////// // ExternalProtocolHandler @@ -62,8 +62,8 @@ void ExternalProtocolHandler::RunExternalProtocolDialog( const int kMaxUrlWithoutSchemeSize = 256; std::wstring elided_url_without_scheme; - gfx::ElideString(ASCIIToWide(url_.possibly_invalid_spec()), - kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); + ui::ElideString(ASCIIToWide(url_.possibly_invalid_spec()), + kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); NSString* urlString = l10n_util::GetNSStringFWithFixup( IDS_EXTERNAL_PROTOCOL_INFORMATION, diff --git a/chrome/browser/ui/cocoa/gradient_button_cell.h b/chrome/browser/ui/cocoa/gradient_button_cell.h index a1e905f..48929b5 100644 --- a/chrome/browser/ui/cocoa/gradient_button_cell.h +++ b/chrome/browser/ui/cocoa/gradient_button_cell.h @@ -10,7 +10,9 @@ #include "base/scoped_nsobject.h" +namespace ui { class ThemeProvider; +} // Base class for button cells for toolbar and bookmark bar. // @@ -68,7 +70,7 @@ typedef enum { // Turn off theming. Temporary work-around. - (void)setShouldTheme:(BOOL)shouldTheme; -- (void)drawBorderAndFillForTheme:(ThemeProvider*)themeProvider +- (void)drawBorderAndFillForTheme:(ui::ThemeProvider*)themeProvider controlView:(NSView*)controlView innerPath:(NSBezierPath*)innerPath showClickedGradient:(BOOL)showClickedGradient diff --git a/chrome/browser/ui/cocoa/gradient_button_cell.mm b/chrome/browser/ui/cocoa/gradient_button_cell.mm index 459aa8e..ce2ea01 100644 --- a/chrome/browser/ui/cocoa/gradient_button_cell.mm +++ b/chrome/browser/ui/cocoa/gradient_button_cell.mm @@ -336,7 +336,7 @@ static const NSTimeInterval kAnimationContinuousCycleDuration = 0.4; } // TODO(viettrungluu): clean up/reorganize. -- (void)drawBorderAndFillForTheme:(ThemeProvider*)themeProvider +- (void)drawBorderAndFillForTheme:(ui::ThemeProvider*)themeProvider controlView:(NSView*)controlView innerPath:(NSBezierPath*)innerPath showClickedGradient:(BOOL)showClickedGradient @@ -516,7 +516,7 @@ static const NSTimeInterval kAnimationContinuousCycleDuration = 0.4; BOOL pressed = ([((NSControl*)[self controlView]) isEnabled] && [self isHighlighted]); NSWindow* window = [controlView window]; - ThemeProvider* themeProvider = [window themeProvider]; + ui::ThemeProvider* themeProvider = [window themeProvider]; BOOL active = [window isKeyWindow] || [window isMainWindow]; // Stroke the borders and appropriate fill gradient. If we're borderless, the diff --git a/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm b/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm index d6a0714..114f2c6 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_gradient_view.mm @@ -39,7 +39,7 @@ const double kBackgroundColorBottom[3] = } - (NSColor*)strokeColor { - ThemeProvider* themeProvider = [[self window] themeProvider]; + ui::ThemeProvider* themeProvider = [[self window] themeProvider]; if (!themeProvider) return [NSColor blackColor]; diff --git a/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm b/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm index 219c448..e0fd72c 100644 --- a/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm +++ b/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm @@ -7,7 +7,6 @@ #import <Cocoa/Cocoa.h> #include "app/l10n_util_mac.h" -#include "app/message_box_flags.h" #include "base/logging.h" #import "base/mac/cocoa_protocols.h" #include "base/sys_string_conversions.h" @@ -15,6 +14,7 @@ #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" #include "grit/app_strings.h" #include "grit/generated_resources.h" +#include "ui/base/message_box_flags.h" // Helper object that receives the notification that the dialog/sheet is // going away. Is responsible for cleaning itself up. @@ -106,10 +106,10 @@ JSModalDialogCocoa::JSModalDialogCocoa(JavaScriptAppModalDialog* dialog) bool text_field = false; bool one_button = false; switch (dialog_->dialog_flags()) { - case MessageBoxFlags::kIsJavascriptAlert: + case ui::MessageBoxFlags::kIsJavascriptAlert: one_button = true; break; - case MessageBoxFlags::kIsJavascriptConfirm: + case ui::MessageBoxFlags::kIsJavascriptConfirm: if (dialog_->is_before_unload_dialog()) { default_button = l10n_util::GetNSStringWithFixup( IDS_BEFOREUNLOAD_MESSAGEBOX_OK_BUTTON_LABEL); @@ -117,7 +117,7 @@ JSModalDialogCocoa::JSModalDialogCocoa(JavaScriptAppModalDialog* dialog) IDS_BEFOREUNLOAD_MESSAGEBOX_CANCEL_BUTTON_LABEL); } break; - case MessageBoxFlags::kIsJavascriptPrompt: + case ui::MessageBoxFlags::kIsJavascriptPrompt: text_field = true; break; @@ -166,10 +166,10 @@ int JSModalDialogCocoa::GetAppModalDialogButtons() const { int num_buttons = [[alert_ buttons] count]; switch (num_buttons) { case 1: - return MessageBoxFlags::DIALOGBUTTON_OK; + return ui::MessageBoxFlags::DIALOGBUTTON_OK; case 2: - return MessageBoxFlags::DIALOGBUTTON_OK | - MessageBoxFlags::DIALOGBUTTON_CANCEL; + return ui::MessageBoxFlags::DIALOGBUTTON_OK | + ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; default: NOTREACHED(); return 0; diff --git a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm index 79d794b..745e64c 100644 --- a/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm +++ b/chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm @@ -4,12 +4,12 @@ #import "chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.h" -#include "app/text_elider.h" #import "base/logging.h" #include "base/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/image_utils.h" #import "chrome/browser/ui/cocoa/location_bar/location_icon_decoration.h" #include "gfx/font.h" +#include "ui/base/text/text_elider.h" namespace { @@ -92,7 +92,8 @@ CGFloat EVBubbleDecoration::GetWidthForSpace(CGFloat width) { gfx::Font font(base::SysNSStringToUTF16([font_ fontName]), [font_ pointSize]); NSString* elided_label = base::SysUTF16ToNSString( - ElideText(base::SysNSStringToUTF16(full_label_), font, width_left, true)); + ui::ElideText(base::SysNSStringToUTF16(full_label_), font, width_left, + true)); // Use the elided label. SetLabel(elided_label); diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.mm b/chrome/browser/ui/cocoa/status_bubble_mac.mm index ffc0cb9..93837a2 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac.mm +++ b/chrome/browser/ui/cocoa/status_bubble_mac.mm @@ -6,7 +6,6 @@ #include <limits> -#include "app/text_elider.h" #include "base/compiler_specific.h" #include "base/message_loop.h" #include "base/string_util.h" @@ -18,6 +17,7 @@ #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" #import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" +#include "ui/base/text/text_elider.h" namespace { @@ -152,7 +152,7 @@ void StatusBubbleMac::SetURL(const GURL& url, const string16& languages) { [font pointSize]); string16 original_url_text = net::FormatUrl(url, UTF16ToUTF8(languages)); - string16 status = gfx::ElideUrl(url, font_chr, text_width, + string16 status = ui::ElideUrl(url, font_chr, text_width, UTF16ToWideHack(languages)); SetText(status, true); @@ -608,7 +608,7 @@ void StatusBubbleMac::ExpandBubble() { NSFont* font = [[window_ contentView] font]; gfx::Font font_chr(base::SysNSStringToUTF16([font fontName]), [font pointSize]); - string16 expanded_url = gfx::ElideUrl(url_, font_chr, + string16 expanded_url = ui::ElideUrl(url_, font_chr, max_bubble_width, UTF16ToWideHack(languages_)); // Scale width from gfx::Font in view coordinates to window coordinates. diff --git a/chrome/browser/ui/cocoa/tabs/tab_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_controller.mm index 518ef21..e28e7fc 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_controller.mm @@ -268,7 +268,7 @@ class MenuDelegate : public ui::SimpleMenuModel::Delegate { - (void)updateTitleColor { NSColor* titleColor = nil; - ThemeProvider* theme = [[[self view] window] themeProvider]; + ui::ThemeProvider* theme = [[[self view] window] themeProvider]; if (theme && ![self selected]) { titleColor = theme->GetNSColor(BrowserThemeProvider::COLOR_BACKGROUND_TAB_TEXT, diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm index d5a2de2..7e27302 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_view.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm @@ -644,7 +644,7 @@ const CGFloat kRapidCloseDist = 2.5; // background overlay drawn over it (see below) will be fully opaque. BOOL hasBackgroundImage = NO; if (!selected) { - // ThemeProvider::HasCustomImage is true only if the theme provides the + // ui::ThemeProvider::HasCustomImage is true only if the theme provides the // image. However, even if the theme doesn't provide a tab background, the // theme machinery will make one if given a frame image. See // BrowserThemePack::GenerateTabBackgroundImages for details. diff --git a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm index 25d8468..5497eda 100644 --- a/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm +++ b/chrome/browser/ui/cocoa/tabs/tab_window_controller.mm @@ -4,11 +4,11 @@ #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" -#include "app/theme_provider.h" #include "base/logging.h" #import "chrome/browser/ui/cocoa/focus_tracker.h" #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" #import "chrome/browser/ui/cocoa/themed_window.h" +#include "ui/base/theme_provider.h" @interface TabWindowController(PRIVATE) - (void)setUseOverlay:(BOOL)useOverlay; @@ -19,7 +19,7 @@ @implementation TabWindowOverlayWindow -- (ThemeProvider*)themeProvider { +- (ui::ThemeProvider*)themeProvider { if ([self parentWindow]) return [[[self parentWindow] windowController] themeProvider]; return NULL; diff --git a/chrome/browser/ui/cocoa/themed_window.h b/chrome/browser/ui/cocoa/themed_window.h index d35bfa3..4da0d53 100644 --- a/chrome/browser/ui/cocoa/themed_window.h +++ b/chrome/browser/ui/cocoa/themed_window.h @@ -8,7 +8,10 @@ #import <Cocoa/Cocoa.h> +namespace ui { class ThemeProvider; +} +using ui::ThemeProvider; // Bit flags; mix-and-match as necessary. enum { diff --git a/chrome/browser/ui/gtk/back_forward_button_gtk.h b/chrome/browser/ui/gtk/back_forward_button_gtk.h index ed01b16..630e552 100644 --- a/chrome/browser/ui/gtk/back_forward_button_gtk.h +++ b/chrome/browser/ui/gtk/back_forward_button_gtk.h @@ -6,11 +6,11 @@ #define CHROME_BROWSER_UI_GTK_BACK_FORWARD_BUTTON_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "base/task.h" #include "chrome/browser/ui/gtk/custom_button.h" #include "chrome/browser/ui/gtk/menu_gtk.h" +#include "ui/base/gtk/gtk_signal.h" class BackForwardMenuModel; class Browser; diff --git a/chrome/browser/ui/gtk/bookmark_bar_gtk.h b/chrome/browser/ui/gtk/bookmark_bar_gtk.h index f22464f..6e2261f 100644 --- a/chrome/browser/ui/gtk/bookmark_bar_gtk.h +++ b/chrome/browser/ui/gtk/bookmark_bar_gtk.h @@ -10,7 +10,6 @@ #include <vector> -#include "app/gtk_signal.h" #include "base/gtest_prod_util.h" #include "base/scoped_ptr.h" #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" @@ -25,6 +24,7 @@ #include "gfx/point.h" #include "gfx/size.h" #include "ui/base/animation/animation_delegate.h" +#include "ui/base/gtk/gtk_signal.h" class BookmarkMenuController; class Browser; diff --git a/chrome/browser/ui/gtk/bookmark_bar_instructions_gtk.h b/chrome/browser/ui/gtk/bookmark_bar_instructions_gtk.h index b430381..3cea2d6 100644 --- a/chrome/browser/ui/gtk/bookmark_bar_instructions_gtk.h +++ b/chrome/browser/ui/gtk/bookmark_bar_instructions_gtk.h @@ -6,10 +6,10 @@ #define CHROME_BROWSER_UI_GTK_BOOKMARK_BAR_INSTRUCTIONS_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/gtk/gtk_signal.h" typedef struct _GtkWidget GtkWidget; class GtkThemeProvider; diff --git a/chrome/browser/ui/gtk/bookmark_bubble_gtk.h b/chrome/browser/ui/gtk/bookmark_bubble_gtk.h index ec4f169..1b40759 100644 --- a/chrome/browser/ui/gtk/bookmark_bubble_gtk.h +++ b/chrome/browser/ui/gtk/bookmark_bubble_gtk.h @@ -16,7 +16,6 @@ #include <string> #include <vector> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/task.h" @@ -24,6 +23,7 @@ #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "googleurl/src/gurl.h" +#include "ui/base/gtk/gtk_signal.h" class BookmarkNode; class Profile; diff --git a/chrome/browser/ui/gtk/bookmark_editor_gtk.h b/chrome/browser/ui/gtk/bookmark_editor_gtk.h index b673ff6..e500ae8 100644 --- a/chrome/browser/ui/gtk/bookmark_editor_gtk.h +++ b/chrome/browser/ui/gtk/bookmark_editor_gtk.h @@ -6,13 +6,13 @@ #define CHROME_BROWSER_UI_GTK_BOOKMARK_EDITOR_GTK_H_ #pragma once -#include "app/gtk_integers.h" -#include "app/gtk_signal.h" #include "base/gtest_prod_util.h" #include "base/scoped_ptr.h" #include "base/string16.h" #include "chrome/browser/bookmarks/bookmark_editor.h" #include "chrome/browser/bookmarks/bookmark_model_observer.h" +#include "ui/base/gtk/gtk_integers.h" +#include "ui/base/gtk/gtk_signal.h" class GURL; diff --git a/chrome/browser/ui/gtk/bookmark_menu_controller_gtk.h b/chrome/browser/ui/gtk/bookmark_menu_controller_gtk.h index 46919cd..e82f828 100644 --- a/chrome/browser/ui/gtk/bookmark_menu_controller_gtk.h +++ b/chrome/browser/ui/gtk/bookmark_menu_controller_gtk.h @@ -8,13 +8,13 @@ #include <map> -#include "app/gtk_integers.h" -#include "app/gtk_signal.h" -#include "app/gtk_signal_registrar.h" #include "base/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 "webkit/glue/window_open_disposition.h" class Browser; @@ -137,7 +137,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver, scoped_ptr<BookmarkContextMenuController> context_menu_controller_; scoped_ptr<MenuGtk> context_menu_; - GtkSignalRegistrar signals_; + ui::GtkSignalRegistrar signals_; DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); }; diff --git a/chrome/browser/ui/gtk/bookmark_utils_gtk.h b/chrome/browser/ui/gtk/bookmark_utils_gtk.h index e662bbb..9654d9d 100644 --- a/chrome/browser/ui/gtk/bookmark_utils_gtk.h +++ b/chrome/browser/ui/gtk/bookmark_utils_gtk.h @@ -9,8 +9,8 @@ #include <vector> #include <string> -#include "app/gtk_integers.h" #include "base/string16.h" +#include "ui/base/gtk/gtk_integers.h" class BookmarkModel; class BookmarkNode; diff --git a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc index bc527a4..0a0a940 100644 --- a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc +++ b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc @@ -341,7 +341,7 @@ class BrowserActionButton : public NotificationObserver, // Same as |default_icon_|, but stored as SkBitmap. SkBitmap default_skbitmap_; - GtkSignalRegistrar signals_; + ui::GtkSignalRegistrar signals_; NotificationRegistrar registrar_; // The context menu view and model for this extension action. diff --git a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h index b61e22b..93fa6d8 100644 --- a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h +++ b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h @@ -9,8 +9,6 @@ #include <map> #include <string> -#include "app/gtk_signal.h" -#include "app/gtk_signal_registrar.h" #include "base/linked_ptr.h" #include "base/task.h" #include "chrome/browser/extensions/extension_toolbar_model.h" @@ -22,6 +20,8 @@ #include "chrome/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/models/simple_menu_model.h" class Browser; @@ -211,7 +211,7 @@ class BrowserActionsToolbarGtk : public ExtensionToolbarModel::Observer, // This is the width we were at when we started animating. int start_width_; - GtkSignalRegistrar signals_; + ui::GtkSignalRegistrar signals_; NotificationRegistrar registrar_; diff --git a/chrome/browser/ui/gtk/browser_titlebar.cc b/chrome/browser/ui/gtk/browser_titlebar.cc index 67d63f8..22b8c44 100644 --- a/chrome/browser/ui/gtk/browser_titlebar.cc +++ b/chrome/browser/ui/gtk/browser_titlebar.cc @@ -367,11 +367,11 @@ void BrowserTitlebar::Init() { gtk_widget_show_all(container_); - ActiveWindowWatcherX::AddObserver(this); + ui::ActiveWindowWatcherX::AddObserver(this); } BrowserTitlebar::~BrowserTitlebar() { - ActiveWindowWatcherX::RemoveObserver(this); + ui::ActiveWindowWatcherX::RemoveObserver(this); #if defined(USE_GCONF) GConfTitlebarListener::GetInstance()->RemoveObserver(this); #endif diff --git a/chrome/browser/ui/gtk/browser_titlebar.h b/chrome/browser/ui/gtk/browser_titlebar.h index 944057e..2bf2f7c 100644 --- a/chrome/browser/ui/gtk/browser_titlebar.h +++ b/chrome/browser/ui/gtk/browser_titlebar.h @@ -13,12 +13,12 @@ #include <gtk/gtk.h> -#include "app/active_window_watcher_x.h" -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/gtk/gtk_signal.h" #include "ui/base/models/simple_menu_model.h" +#include "ui/base/x/active_window_watcher_x.h" class BrowserWindowGtk; class CustomDrawButton; @@ -28,7 +28,7 @@ class PopupPageMenuModel; class TabContents; class BrowserTitlebar : public NotificationObserver, - public ActiveWindowWatcherX::Observer, + public ui::ActiveWindowWatcherX::Observer, public ui::SimpleMenuModel::Delegate { public: // A default button order string for when we aren't asking gconf for the diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc index 49d8d3d..39b3339 100644 --- a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc @@ -424,7 +424,7 @@ void BrowserToolbarGtk::SetUpDragForHomeButton(bool enable) { static const int targets[] = { ui::TEXT_PLAIN, ui::TEXT_URI_LIST, -1 }; ui::SetDestTargetList(home_->widget(), targets); - drop_handler_.reset(new GtkSignalRegistrar()); + drop_handler_.reset(new ui::GtkSignalRegistrar()); drop_handler_->Connect(home_->widget(), "drag-data-received", G_CALLBACK(OnDragDataReceivedThunk), this); } else { diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.h b/chrome/browser/ui/gtk/browser_toolbar_gtk.h index 8483398..0a03c9b 100644 --- a/chrome/browser/ui/gtk/browser_toolbar_gtk.h +++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.h @@ -9,9 +9,6 @@ #include <gtk/gtk.h> #include <string> -#include "app/active_window_watcher_x.h" -#include "app/gtk_signal.h" -#include "app/gtk_signal_registrar.h" #include "base/scoped_ptr.h" #include "chrome/browser/command_updater.h" #include "chrome/browser/prefs/pref_member.h" @@ -21,6 +18,8 @@ #include "chrome/browser/ui/toolbar/wrench_menu_model.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/gtk/gtk_signal.h" +#include "ui/base/gtk/gtk_signal_registrar.h" #include "ui/base/models/accelerator.h" #include "ui/base/models/simple_menu_model.h" @@ -211,7 +210,7 @@ class BrowserToolbarGtk : public CommandUpdater::CommandObserver, OwnedWidgetGtk offscreen_entry_; // Manages the home button drop signal handler. - scoped_ptr<GtkSignalRegistrar> drop_handler_; + scoped_ptr<ui::GtkSignalRegistrar> drop_handler_; DISALLOW_COPY_AND_ASSIGN(BrowserToolbarGtk); }; diff --git a/chrome/browser/ui/gtk/browser_window_gtk.cc b/chrome/browser/ui/gtk/browser_window_gtk.cc index c90a6b3..6b18b39 100644 --- a/chrome/browser/ui/gtk/browser_window_gtk.cc +++ b/chrome/browser/ui/gtk/browser_window_gtk.cc @@ -302,7 +302,7 @@ BrowserWindowGtk::BrowserWindowGtk(Browser* browser) infobar_arrow_model_(this) { // We register first so that other views like the toolbar can use the // is_active() function in their ActiveWindowChanged() handlers. - ActiveWindowWatcherX::AddObserver(this); + ui::ActiveWindowWatcherX::AddObserver(this); use_custom_frame_pref_.Init(prefs::kUseCustomChromeFrame, browser_->profile()->GetPrefs(), this); @@ -312,7 +312,7 @@ BrowserWindowGtk::BrowserWindowGtk(Browser* browser) // always even on the current virtual desktop. If we are running under // compiz, suppress such raises, as they are not necessary in compiz anyway. std::string wm_name; - if (x11_util::GetWindowManagerName(&wm_name) && wm_name == "compiz") + if (ui::GetWindowManagerName(&wm_name) && wm_name == "compiz") suppress_window_raise_ = true; window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); @@ -348,7 +348,7 @@ BrowserWindowGtk::BrowserWindowGtk(Browser* browser) } BrowserWindowGtk::~BrowserWindowGtk() { - ActiveWindowWatcherX::RemoveObserver(this); + ui::ActiveWindowWatcherX::RemoveObserver(this); browser_->tabstrip_model()->RemoveObserver(this); } @@ -783,7 +783,7 @@ void BrowserWindowGtk::SetFullscreen(bool fullscreen) { // panel or not. std::string wm_name; bool unmaximize_before_unfullscreen = IsMaximized() && - x11_util::GetWindowManagerName(&wm_name) && wm_name == "Metacity"; + ui::GetWindowManagerName(&wm_name) && wm_name == "Metacity"; if (unmaximize_before_unfullscreen) UnMaximize(); @@ -1121,7 +1121,7 @@ gfx::Rect BrowserWindowGtk::GetInstantBounds() { gfx::Rect BrowserWindowGtk::GrabWindowSnapshot(std::vector<unsigned char>* png_representation) { - x11_util::GrabWindowSnapshot(window_, png_representation); + ui::GrabWindowSnapshot(window_, png_representation); return bounds_; } @@ -1438,7 +1438,7 @@ void BrowserWindowGtk::RegisterUserPrefs(PrefService* prefs) { bool custom_frame_default = false; // Avoid checking the window manager if we're not connected to an X server (as // is the case in Valgrind tests). - if (x11_util::XDisplayExists() && + if (ui::XDisplayExists() && !prefs->HasPrefPath(prefs::kUseCustomChromeFrame)) { custom_frame_default = GetCustomFramePrefDefault(); } @@ -2066,7 +2066,7 @@ gboolean BrowserWindowGtk::OnButtonPressEvent(GtkWidget* widget, // static void BrowserWindowGtk::MainWindowMapped(GtkWidget* widget) { // Map the X Window ID of the window to our window. - XID xid = x11_util::GetX11WindowFromGtkWidget(widget); + XID xid = ui::GetX11WindowFromGtkWidget(widget); BrowserWindowGtk::xid_map_.insert( std::pair<XID, GtkWindow*>(xid, GTK_WINDOW(widget))); } @@ -2074,7 +2074,7 @@ void BrowserWindowGtk::MainWindowMapped(GtkWidget* widget) { // static void BrowserWindowGtk::MainWindowUnMapped(GtkWidget* widget) { // Unmap the X Window ID. - XID xid = x11_util::GetX11WindowFromGtkWidget(widget); + XID xid = ui::GetX11WindowFromGtkWidget(widget); BrowserWindowGtk::xid_map_.erase(xid); } @@ -2231,7 +2231,7 @@ void BrowserWindowGtk::PlaceBookmarkBar(bool is_floating) { // static bool BrowserWindowGtk::GetCustomFramePrefDefault() { std::string wm_name; - if (!x11_util::GetWindowManagerName(&wm_name)) + if (!ui::GetWindowManagerName(&wm_name)) return false; // Ideally, we'd use the custom frame by default and just fall back on using diff --git a/chrome/browser/ui/gtk/browser_window_gtk.h b/chrome/browser/ui/gtk/browser_window_gtk.h index 79f24ae..d339111 100644 --- a/chrome/browser/ui/gtk/browser_window_gtk.h +++ b/chrome/browser/ui/gtk/browser_window_gtk.h @@ -10,9 +10,6 @@ #include <map> -#include "app/active_window_watcher_x.h" -#include "app/gtk_signal.h" -#include "app/x11_util.h" #include "base/scoped_ptr.h" #include "base/timer.h" #include "build/build_config.h" @@ -22,6 +19,9 @@ #include "chrome/browser/ui/gtk/infobar_arrow_model.h" #include "chrome/common/notification_registrar.h" #include "gfx/rect.h" +#include "ui/base/gtk/gtk_signal.h" +#include "ui/base/x/active_window_watcher_x.h" +#include "ui/base/x/x11_util.h" class BookmarkBarGtk; class Browser; @@ -44,7 +44,7 @@ class TabStripGtk; class BrowserWindowGtk : public BrowserWindow, public NotificationObserver, public TabStripModelObserver, - public ActiveWindowWatcherX::Observer, + public ui::ActiveWindowWatcherX::Observer, public InfoBarArrowModel::Observer { public: explicit BrowserWindowGtk(Browser* browser); diff --git a/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h b/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h index 5ae0d81..567cb4b 100644 --- a/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h +++ b/chrome/browser/ui/gtk/clear_browsing_data_dialog_gtk.h @@ -6,9 +6,9 @@ #define CHROME_BROWSER_UI_GTK_CLEAR_BROWSING_DATA_DIALOG_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" +#include "ui/base/gtk/gtk_signal.h" typedef struct _GtkWidget GtkWidget; typedef struct _GtkWindow GtkWindow; diff --git a/chrome/browser/ui/gtk/collected_cookies_gtk.h b/chrome/browser/ui/gtk/collected_cookies_gtk.h index ce36341..afb56fe 100644 --- a/chrome/browser/ui/gtk/collected_cookies_gtk.h +++ b/chrome/browser/ui/gtk/collected_cookies_gtk.h @@ -10,13 +10,13 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/ui/gtk/constrained_window_gtk.h" #include "chrome/browser/ui/gtk/gtk_tree.h" #include "chrome/common/content_settings.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/gtk/gtk_signal.h" class CookiesTreeModel; diff --git a/chrome/browser/ui/gtk/constrained_window_gtk.h b/chrome/browser/ui/gtk/constrained_window_gtk.h index a7161ba..2f01079 100644 --- a/chrome/browser/ui/gtk/constrained_window_gtk.h +++ b/chrome/browser/ui/gtk/constrained_window_gtk.h @@ -8,11 +8,11 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/task.h" #include "chrome/browser/tab_contents/constrained_window.h" #include "chrome/browser/ui/gtk/owned_widget_gtk.h" +#include "ui/base/gtk/gtk_signal.h" class TabContents; typedef struct _GdkColor GdkColor; diff --git a/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc b/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc index da481b5..0a0b8ea 100644 --- a/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/content_setting_bubble_gtk.cc @@ -9,7 +9,6 @@ #include <vector> #include "app/l10n_util.h" -#include "app/text_elider.h" #include "base/i18n/rtl.h" #include "base/utf_string_conversions.h" #include "chrome/browser/blocked_content_container.h" @@ -27,6 +26,7 @@ #include "gfx/gtk_util.h" #include "grit/app_resources.h" #include "grit/generated_resources.h" +#include "ui/base/text/text_elider.h" #include "webkit/plugins/npapi/plugin_list.h" namespace { @@ -39,7 +39,7 @@ const int kContentBorder = 7; const int kMaxLinkPixelSize = 500; std::string BuildElidedText(const std::string& input) { - return UTF16ToUTF8(gfx::ElideText( + return UTF16ToUTF8(ui::ElideText( UTF8ToUTF16(input), gfx::Font(), kMaxLinkPixelSize, diff --git a/chrome/browser/ui/gtk/content_setting_bubble_gtk.h b/chrome/browser/ui/gtk/content_setting_bubble_gtk.h index aa5e1a6..9427fc0 100644 --- a/chrome/browser/ui/gtk/content_setting_bubble_gtk.h +++ b/chrome/browser/ui/gtk/content_setting_bubble_gtk.h @@ -8,12 +8,12 @@ #include <map> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/ui/gtk/info_bubble_gtk.h" #include "chrome/common/content_settings_types.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/gtk/gtk_signal.h" class ContentSettingBubbleModel; class Profile; diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h index 3fbbc8a..b8e2957 100644 --- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h +++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h @@ -6,13 +6,13 @@ #define CHROME_BROWSER_UI_GTK_CREATE_APPLICATION_SHORTCUTS_DIALOG_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/ref_counted.h" #include "chrome/browser/browser_thread.h" #include "chrome/browser/extensions/image_loading_tracker.h" #include "chrome/browser/shell_integration.h" #include "googleurl/src/gurl.h" +#include "ui/base/gtk/gtk_signal.h" typedef struct _GdkPixbuf GdkPixbuf; typedef struct _GtkWidget GtkWidget; diff --git a/chrome/browser/ui/gtk/crypto_module_password_dialog.cc b/chrome/browser/ui/gtk/crypto_module_password_dialog.cc index 0138d38..1429e5f 100644 --- a/chrome/browser/ui/gtk/crypto_module_password_dialog.cc +++ b/chrome/browser/ui/gtk/crypto_module_password_dialog.cc @@ -6,7 +6,6 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "app/l10n_util.h" #include "base/basictypes.h" #include "base/crypto/crypto_module_blocking_password_delegate.h" @@ -17,6 +16,7 @@ #include "chrome/browser/ui/gtk/gtk_util.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" +#include "ui/base/gtk/gtk_signal.h" namespace { diff --git a/chrome/browser/ui/gtk/custom_button.h b/chrome/browser/ui/gtk/custom_button.h index 9703ba2..87c28d3 100644 --- a/chrome/browser/ui/gtk/custom_button.h +++ b/chrome/browser/ui/gtk/custom_button.h @@ -8,7 +8,6 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/ui/gtk/owned_widget_gtk.h" #include "chrome/common/notification_observer.h" @@ -17,6 +16,7 @@ #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" class CairoCachedSurface; class GtkThemeProvider; diff --git a/chrome/browser/ui/gtk/custom_drag.h b/chrome/browser/ui/gtk/custom_drag.h index 40916e3..d3f893b 100644 --- a/chrome/browser/ui/gtk/custom_drag.h +++ b/chrome/browser/ui/gtk/custom_drag.h @@ -9,8 +9,8 @@ #include <gtk/gtk.h> #include <vector> -#include "app/gtk_signal.h" #include "base/basictypes.h" +#include "ui/base/gtk/gtk_signal.h" class BookmarkNode; class DownloadItem; diff --git a/chrome/browser/ui/gtk/dialogs_gtk.cc b/chrome/browser/ui/gtk/dialogs_gtk.cc index 287116a..caab944 100644 --- a/chrome/browser/ui/gtk/dialogs_gtk.cc +++ b/chrome/browser/ui/gtk/dialogs_gtk.cc @@ -6,7 +6,6 @@ #include <map> #include <set> -#include "app/gtk_signal.h" #include "app/l10n_util.h" #include "base/file_util.h" #include "base/logging.h" @@ -19,6 +18,7 @@ #include "chrome/browser/browser_thread.h" #include "chrome/browser/shell_dialogs.h" #include "grit/generated_resources.h" +#include "ui/base/gtk/gtk_signal.h" // The size of the preview we display for selected image files. We set height // larger than width because generally there is more free space vertically diff --git a/chrome/browser/ui/gtk/download_in_progress_dialog_gtk.h b/chrome/browser/ui/gtk/download_in_progress_dialog_gtk.h index c5a8a6d..dd8fdb4 100644 --- a/chrome/browser/ui/gtk/download_in_progress_dialog_gtk.h +++ b/chrome/browser/ui/gtk/download_in_progress_dialog_gtk.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_GTK_DOWNLOAD_IN_PROGRESS_DIALOG_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/basictypes.h" +#include "ui/base/gtk/gtk_signal.h" class Browser; diff --git a/chrome/browser/ui/gtk/download_item_gtk.cc b/chrome/browser/ui/gtk/download_item_gtk.cc index 755d44e..52ac648 100644 --- a/chrome/browser/ui/gtk/download_item_gtk.cc +++ b/chrome/browser/ui/gtk/download_item_gtk.cc @@ -6,7 +6,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/text_elider.h" #include "base/basictypes.h" #include "base/callback.h" #include "base/metrics/histogram.h" @@ -35,6 +34,7 @@ #include "grit/theme_resources.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/animation/slide_animation.h" +#include "ui/base/text/text_elider.h" namespace { @@ -519,7 +519,7 @@ void DownloadItemGtk::LoadIcon() { } void DownloadItemGtk::UpdateTooltip() { - string16 elided_filename = gfx::ElideFilename( + string16 elided_filename = ui::ElideFilename( get_download()->GetFileNameToReportUser(), gfx::Font(), kTooltipMaxWidth); gtk_widget_set_tooltip_text(body_.get(), @@ -531,7 +531,7 @@ void DownloadItemGtk::UpdateNameLabel() { // use gfx::Font() to draw the text. This is why we need to add so // much padding when we set the size request. We need to either use gfx::Font // or somehow extend TextElider. - string16 elided_filename = gfx::ElideFilename( + string16 elided_filename = ui::ElideFilename( get_download()->GetFileNameToReportUser(), gfx::Font(), kTextWidth); @@ -582,7 +582,7 @@ void DownloadItemGtk::UpdateDangerWarning() { dangerous_warning = l10n_util::GetStringUTF16(IDS_PROMPT_DANGEROUS_DOWNLOAD_EXTENSION); } else { - string16 elided_filename = gfx::ElideFilename( + string16 elided_filename = ui::ElideFilename( get_download()->target_name(), gfx::Font(), kTextWidth); dangerous_warning = diff --git a/chrome/browser/ui/gtk/download_item_gtk.h b/chrome/browser/ui/gtk/download_item_gtk.h index b0c6e9c..a3b67e3 100644 --- a/chrome/browser/ui/gtk/download_item_gtk.h +++ b/chrome/browser/ui/gtk/download_item_gtk.h @@ -10,7 +10,6 @@ #include <string> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "base/time.h" #include "chrome/browser/download/download_item.h" @@ -19,6 +18,7 @@ #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "ui/base/animation/animation_delegate.h" +#include "ui/base/gtk/gtk_signal.h" class BaseDownloadItemModel; class DownloadShelfContextMenuGtk; diff --git a/chrome/browser/ui/gtk/download_shelf_gtk.h b/chrome/browser/ui/gtk/download_shelf_gtk.h index 650588b..aee0629 100644 --- a/chrome/browser/ui/gtk/download_shelf_gtk.h +++ b/chrome/browser/ui/gtk/download_shelf_gtk.h @@ -10,7 +10,6 @@ #include <vector> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/download/download_shelf.h" #include "chrome/browser/ui/gtk/owned_widget_gtk.h" @@ -18,6 +17,7 @@ #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "gfx/native_widget_types.h" +#include "ui/base/gtk/gtk_signal.h" class BaseDownloadItemModel; class Browser; diff --git a/chrome/browser/ui/gtk/edit_search_engine_dialog.h b/chrome/browser/ui/gtk/edit_search_engine_dialog.h index fea1992..a5520e1 100644 --- a/chrome/browser/ui/gtk/edit_search_engine_dialog.h +++ b/chrome/browser/ui/gtk/edit_search_engine_dialog.h @@ -9,10 +9,10 @@ #include <gtk/gtk.h> #include <string> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/string16.h" +#include "ui/base/gtk/gtk_signal.h" class AccessibleWidgetHelper; class EditSearchEngineController; diff --git a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc index 79670c3..57f3374 100644 --- a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.cc @@ -9,7 +9,6 @@ #include <string> #include "app/l10n_util.h" -#include "app/text_elider.h" #include "base/message_loop.h" #include "base/metrics/histogram.h" #include "base/string_util.h" @@ -19,6 +18,7 @@ #include "chrome/browser/ui/gtk/gtk_util.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +#include "ui/base/text/text_elider.h" namespace { @@ -63,9 +63,9 @@ ExternalProtocolDialogGtk::ExternalProtocolDialogGtk(const GURL& url) const int kMaxCommandSize = 256; std::wstring elided_url_without_scheme; std::wstring elided_command; - gfx::ElideString(ASCIIToWide(url.possibly_invalid_spec()), + ui::ElideString(ASCIIToWide(url.possibly_invalid_spec()), kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); - gfx::ElideString(ASCIIToWide(std::string("xdg-open ") + url.spec()), + ui::ElideString(ASCIIToWide(std::string("xdg-open ") + url.spec()), kMaxCommandSize, &elided_command); std::string message_text = l10n_util::GetStringFUTF8( diff --git a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.h b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.h index 979d5c8..d0fa3ad 100644 --- a/chrome/browser/ui/gtk/external_protocol_dialog_gtk.h +++ b/chrome/browser/ui/gtk/external_protocol_dialog_gtk.h @@ -6,9 +6,9 @@ #define CHROME_BROWSER_UI_GTK_EXTERNAL_PROTOCOL_DIALOG_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/time.h" #include "googleurl/src/gurl.h" +#include "ui/base/gtk/gtk_signal.h" class TabContents; diff --git a/chrome/browser/ui/gtk/first_run_dialog.h b/chrome/browser/ui/gtk/first_run_dialog.h index cd26910..0718ddf 100644 --- a/chrome/browser/ui/gtk/first_run_dialog.h +++ b/chrome/browser/ui/gtk/first_run_dialog.h @@ -9,9 +9,9 @@ typedef struct _GtkButton GtkButton; typedef struct _GtkWidget GtkWidget; -#include "app/gtk_signal.h" #include "chrome/browser/first_run/first_run.h" #include "chrome/browser/search_engines/template_url_model_observer.h" +#include "ui/base/gtk/gtk_signal.h" class TemplateURL; class TemplateURLModel; diff --git a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h index f5d92ef..4a55ee0 100644 --- a/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h +++ b/chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.h @@ -6,10 +6,10 @@ #define CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_ #pragma once -#include "app/gtk_signal.h" -#include "app/gtk_signal_registrar.h" #include "base/timer.h" #include "chrome/browser/ui/gtk/slide_animator_gtk.h" +#include "ui/base/gtk/gtk_signal.h" +#include "ui/base/gtk/gtk_signal_registrar.h" typedef struct _GtkFloatingContainer GtkFloatingContainer; typedef struct _GtkWidget GtkWidget; @@ -45,7 +45,7 @@ class FullscreenExitBubbleGtk { // The timer that does the initial hiding of the exit bubble. base::OneShotTimer<FullscreenExitBubbleGtk> initial_delay_; - GtkSignalRegistrar signals_; + ui::GtkSignalRegistrar signals_; }; #endif // CHROME_BROWSER_UI_GTK_FULLSCREEN_EXIT_BUBBLE_GTK_H_ diff --git a/chrome/browser/ui/gtk/gconf_titlebar_listener.h b/chrome/browser/ui/gtk/gconf_titlebar_listener.h index ad0c67b..179e92a 100644 --- a/chrome/browser/ui/gtk/gconf_titlebar_listener.h +++ b/chrome/browser/ui/gtk/gconf_titlebar_listener.h @@ -12,8 +12,8 @@ #include <set> #include <string> -#include "app/gtk_signal.h" #include "base/basictypes.h" +#include "ui/base/gtk/gtk_signal.h" class BrowserTitlebar; template <typename T> struct DefaultSingletonTraits; diff --git a/chrome/browser/ui/gtk/gtk_theme_provider.cc b/chrome/browser/ui/gtk/gtk_theme_provider.cc index 20fd4b2..055202f 100644 --- a/chrome/browser/ui/gtk/gtk_theme_provider.cc +++ b/chrome/browser/ui/gtk/gtk_theme_provider.cc @@ -8,7 +8,6 @@ #include <set> -#include "app/gtk_signal_registrar.h" #include "app/resource_bundle.h" #include "base/environment.h" #include "base/nix/xdg_util.h" @@ -38,6 +37,7 @@ #include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkShader.h" +#include "ui/base/gtk/gtk_signal_registrar.h" namespace { @@ -251,7 +251,7 @@ GtkThemeProvider::GtkThemeProvider() : BrowserThemeProvider(), fake_window_(gtk_window_new(GTK_WINDOW_TOPLEVEL)), fake_frame_(chrome_gtk_frame_new()), - signals_(new GtkSignalRegistrar), + signals_(new ui::GtkSignalRegistrar), fullscreen_icon_set_(NULL) { fake_label_.Own(gtk_label_new("")); fake_entry_.Own(gtk_entry_new()); @@ -323,7 +323,7 @@ bool GtkThemeProvider::HasCustomImage(int id) const { void GtkThemeProvider::InitThemesFor(NotificationObserver* observer) { observer->Observe(NotificationType::BROWSER_THEME_CHANGED, - Source<ThemeProvider>(this), + Source<ui::ThemeProvider>(this), NotificationService::NoDetails()); } diff --git a/chrome/browser/ui/gtk/gtk_theme_provider.h b/chrome/browser/ui/gtk/gtk_theme_provider.h index fa6b58a..b6a9e67 100644 --- a/chrome/browser/ui/gtk/gtk_theme_provider.h +++ b/chrome/browser/ui/gtk/gtk_theme_provider.h @@ -9,19 +9,22 @@ #include <map> #include <vector> -#include "app/gtk_integers.h" -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/prefs/pref_change_registrar.h" #include "chrome/browser/themes/browser_theme_provider.h" #include "chrome/browser/ui/gtk/owned_widget_gtk.h" #include "chrome/common/notification_observer.h" #include "gfx/color_utils.h" +#include "ui/base/gtk/gtk_integers.h" +#include "ui/base/gtk/gtk_signal.h" class CairoCachedSurface; -class GtkSignalRegistrar; class Profile; +namespace ui { +class GtkSignalRegistrar; +} + typedef struct _GdkDisplay GdkDisplay; typedef struct _GdkEventExpose GdkEventExpose; typedef struct _GdkPixbuf GdkPixbuf; @@ -72,7 +75,7 @@ class GtkThemeProvider : public BrowserThemeProvider, // Whether we should use the GTK system theme. bool UseGtkTheme() const; - // A wrapper around ThemeProvider::GetColor, transforming the result to a + // A wrapper around ui::ThemeProvider::GetColor, transforming the result to a // GdkColor. GdkColor GetGdkColor(int id) const; @@ -256,7 +259,7 @@ class GtkThemeProvider : public BrowserThemeProvider, std::vector<GtkWidget*> chrome_buttons_; // Tracks all the signals we have connected to on various widgets. - scoped_ptr<GtkSignalRegistrar> signals_; + scoped_ptr<ui::GtkSignalRegistrar> signals_; // Tints and colors calculated by LoadGtkValues() that are given to the // caller while |use_gtk_| is true. diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc index 41674bc..ed3e716 100644 --- a/chrome/browser/ui/gtk/gtk_util.cc +++ b/chrome/browser/ui/gtk/gtk_util.cc @@ -13,7 +13,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/x11_util.h" #include "base/environment.h" #include "base/i18n/rtl.h" #include "base/linux_util.h" @@ -37,6 +36,7 @@ #include "grit/theme_resources.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkColor.h" +#include "ui/base/x/x11_util.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/frame/browser_view.h" @@ -365,9 +365,9 @@ void CenterOverWindow(GtkWindow* window, GtkWindow* parent) { // Move to user expected desktop if window is already visible. if (GTK_WIDGET(window)->window) { - x11_util::ChangeWindowDesktop( - x11_util::GetX11WindowFromGtkWidget(GTK_WIDGET(window)), - x11_util::GetX11WindowFromGtkWidget(GTK_WIDGET(parent))); + ui::ChangeWindowDesktop( + ui::GetX11WindowFromGtkWidget(GTK_WIDGET(window)), + ui::GetX11WindowFromGtkWidget(GTK_WIDGET(parent))); } } @@ -546,15 +546,15 @@ bool IsScreenComposited() { return gdk_screen_is_composited(screen) == TRUE; } -void EnumerateTopLevelWindows(x11_util::EnumerateWindowsDelegate* delegate) { +void EnumerateTopLevelWindows(ui::EnumerateWindowsDelegate* delegate) { std::vector<XID> stack; - if (!x11_util::GetXWindowStack(&stack)) { + if (!ui::GetXWindowStack(&stack)) { // Window Manager doesn't support _NET_CLIENT_LIST_STACKING, so fall back // to old school enumeration of all X windows. Some WMs parent 'top-level' // windows in unnamed actual top-level windows (ion WM), so extend the // search depth to all children of top-level windows. const int kMaxSearchDepth = 1; - x11_util::EnumerateAllWindows(delegate, kMaxSearchDepth); + ui::EnumerateAllWindows(delegate, kMaxSearchDepth); return; } @@ -857,20 +857,20 @@ void StackPopupWindow(GtkWidget* popup, GtkWidget* toplevel) { // this -- otherwise, we'll get an error if the window manager reparents the // toplevel window right after we call GetHighestAncestorWindow(). gdk_x11_display_grab(gtk_widget_get_display(toplevel)); - XID toplevel_window_base = x11_util::GetHighestAncestorWindow( - x11_util::GetX11WindowFromGtkWidget(toplevel), - x11_util::GetX11RootWindow()); + XID toplevel_window_base = ui::GetHighestAncestorWindow( + ui::GetX11WindowFromGtkWidget(toplevel), + ui::GetX11RootWindow()); if (toplevel_window_base) { - XID window_xid = x11_util::GetX11WindowFromGtkWidget(popup); - XID window_parent = x11_util::GetParentWindow(window_xid); - if (window_parent == x11_util::GetX11RootWindow()) { - x11_util::RestackWindow(window_xid, toplevel_window_base, true); + XID window_xid = ui::GetX11WindowFromGtkWidget(popup); + XID window_parent = ui::GetParentWindow(window_xid); + if (window_parent == ui::GetX11RootWindow()) { + ui::RestackWindow(window_xid, toplevel_window_base, true); } else { // The window manager shouldn't reparent override-redirect windows. DLOG(ERROR) << "override-redirect window " << window_xid << "'s parent is " << window_parent << ", rather than root window " - << x11_util::GetX11RootWindow(); + << ui::GetX11RootWindow(); } } gdk_x11_display_ungrab(gtk_widget_get_display(toplevel)); diff --git a/chrome/browser/ui/gtk/gtk_util.h b/chrome/browser/ui/gtk/gtk_util.h index cc887bb..d51a616 100644 --- a/chrome/browser/ui/gtk/gtk_util.h +++ b/chrome/browser/ui/gtk/gtk_util.h @@ -10,11 +10,11 @@ #include <string> #include <vector> -#include "app/x11_util.h" #include "base/string16.h" #include "gfx/point.h" #include "gfx/rect.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" +#include "ui/base/x/x11_util.h" #include "webkit/glue/window_open_disposition.h" typedef struct _cairo cairo_t; @@ -173,7 +173,7 @@ GtkWidget* CenterWidgetInHBox(GtkWidget* hbox, GtkWidget* widget, bool IsScreenComposited(); // Enumerates the top-level gdk windows of the current display. -void EnumerateTopLevelWindows(x11_util::EnumerateWindowsDelegate* delegate); +void EnumerateTopLevelWindows(ui::EnumerateWindowsDelegate* delegate); // Set that clicking the button with the given mouse buttons will cause a click // event. diff --git a/chrome/browser/ui/gtk/hover_controller_gtk.h b/chrome/browser/ui/gtk/hover_controller_gtk.h index 30c2408..ae133b7 100644 --- a/chrome/browser/ui/gtk/hover_controller_gtk.h +++ b/chrome/browser/ui/gtk/hover_controller_gtk.h @@ -8,11 +8,11 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" -#include "app/gtk_signal_registrar.h" #include "ui/base/animation/animation_delegate.h" #include "ui/base/animation/slide_animation.h" #include "ui/base/animation/throb_animation.h" +#include "ui/base/gtk/gtk_signal.h" +#include "ui/base/gtk/gtk_signal_registrar.h" // This class handles the "throbbing" of a GtkChromeButton. The visual effect // of throbbing is created by painting partially transparent hover effects. It @@ -59,7 +59,7 @@ class HoverControllerGtk : public ui::AnimationDelegate { ui::SlideAnimation hover_animation_; GtkWidget* button_; - GtkSignalRegistrar signals_; + ui::GtkSignalRegistrar signals_; DISALLOW_COPY_AND_ASSIGN(HoverControllerGtk); }; diff --git a/chrome/browser/ui/gtk/html_dialog_gtk.h b/chrome/browser/ui/gtk/html_dialog_gtk.h index 391c77d..f69fa60 100644 --- a/chrome/browser/ui/gtk/html_dialog_gtk.h +++ b/chrome/browser/ui/gtk/html_dialog_gtk.h @@ -9,12 +9,12 @@ #include <string> #include <vector> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/dom_ui/html_dialog_ui.h" #include "chrome/browser/dom_ui/html_dialog_tab_contents_delegate.h" #include "gfx/native_widget_types.h" #include "gfx/size.h" +#include "ui/base/gtk/gtk_signal.h" typedef struct _GtkWidget GtkWidget; diff --git a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc index 226ae96..2136e74 100644 --- a/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc @@ -6,7 +6,6 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/process_util.h" @@ -22,6 +21,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" +#include "ui/base/gtk/gtk_signal.h" namespace { diff --git a/chrome/browser/ui/gtk/import_dialog_gtk.h b/chrome/browser/ui/gtk/import_dialog_gtk.h index 7d1cd03..c7cf8b4 100644 --- a/chrome/browser/ui/gtk/import_dialog_gtk.h +++ b/chrome/browser/ui/gtk/import_dialog_gtk.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_GTK_IMPORT_DIALOG_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "chrome/browser/importer/importer.h" +#include "ui/base/gtk/gtk_signal.h" class AccessibleWidgetHelper; class Profile; diff --git a/chrome/browser/ui/gtk/import_lock_dialog_gtk.h b/chrome/browser/ui/gtk/import_lock_dialog_gtk.h index c82f4c3..b4760b6 100644 --- a/chrome/browser/ui/gtk/import_lock_dialog_gtk.h +++ b/chrome/browser/ui/gtk/import_lock_dialog_gtk.h @@ -8,9 +8,9 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/ref_counted.h" +#include "ui/base/gtk/gtk_signal.h" class ImporterHost; diff --git a/chrome/browser/ui/gtk/info_bubble_gtk.h b/chrome/browser/ui/gtk/info_bubble_gtk.h index d26167a..8bc4aab 100644 --- a/chrome/browser/ui/gtk/info_bubble_gtk.h +++ b/chrome/browser/ui/gtk/info_bubble_gtk.h @@ -17,13 +17,13 @@ #include <gtk/gtk.h> #include <vector> -#include "app/gtk_signal.h" -#include "app/gtk_signal_registrar.h" #include "base/basictypes.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "gfx/point.h" #include "gfx/rect.h" +#include "ui/base/gtk/gtk_signal.h" +#include "ui/base/gtk/gtk_signal_registrar.h" class GtkThemeProvider; class InfoBubbleGtk; @@ -207,7 +207,7 @@ class InfoBubbleGtk : public NotificationObserver { NotificationRegistrar registrar_; - GtkSignalRegistrar signals_; + ui::GtkSignalRegistrar signals_; DISALLOW_COPY_AND_ASSIGN(InfoBubbleGtk); }; diff --git a/chrome/browser/ui/gtk/infobar_gtk.h b/chrome/browser/ui/gtk/infobar_gtk.h index 5e1c458..98c6d72 100644 --- a/chrome/browser/ui/gtk/infobar_gtk.h +++ b/chrome/browser/ui/gtk/infobar_gtk.h @@ -6,7 +6,6 @@ #define CHROME_BROWSER_UI_GTK_INFOBAR_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "chrome/browser/tab_contents/infobar_delegate.h" @@ -16,6 +15,7 @@ #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "third_party/skia/include/core/SkPaint.h" +#include "ui/base/gtk/gtk_signal.h" class CustomDrawButton; class GtkThemeProvider; diff --git a/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h b/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h index 9999421..8ef0653 100644 --- a/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h +++ b/chrome/browser/ui/gtk/instant_confirm_dialog_gtk.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_GTK_INSTANT_CONFIRM_DIALOG_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/basictypes.h" +#include "ui/base/gtk/gtk_signal.h" class Profile; typedef struct _GtkWindow GtkWindow; diff --git a/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc b/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc index cba5810..376e3ce 100644 --- a/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc +++ b/chrome/browser/ui/gtk/js_modal_dialog_gtk.cc @@ -7,13 +7,13 @@ #include <gtk/gtk.h> #include "app/l10n_util.h" -#include "app/message_box_flags.h" #include "base/logging.h" #include "base/utf_string_conversions.h" #include "chrome/browser/ui/app_modal_dialogs/js_modal_dialog.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" +#include "ui/base/message_box_flags.h" namespace { @@ -56,12 +56,12 @@ JSModalDialogGtk::JSModalDialogGtk(JavaScriptAppModalDialog* dialog, // We add in the OK button manually later because we want to focus it // explicitly. switch (dialog_->dialog_flags()) { - case MessageBoxFlags::kIsJavascriptAlert: + case ui::MessageBoxFlags::kIsJavascriptAlert: buttons = GTK_BUTTONS_NONE; message_type = GTK_MESSAGE_WARNING; break; - case MessageBoxFlags::kIsJavascriptConfirm: + case ui::MessageBoxFlags::kIsJavascriptConfirm: if (dialog_->is_before_unload_dialog()) { // onbeforeunload also uses a confirm prompt, it just has custom // buttons. We add the buttons using gtk_dialog_add_button below. @@ -72,7 +72,7 @@ JSModalDialogGtk::JSModalDialogGtk(JavaScriptAppModalDialog* dialog, message_type = GTK_MESSAGE_QUESTION; break; - case MessageBoxFlags::kIsJavascriptPrompt: + case ui::MessageBoxFlags::kIsJavascriptPrompt: buttons = GTK_BUTTONS_CANCEL; message_type = GTK_MESSAGE_QUESTION; break; @@ -94,7 +94,7 @@ JSModalDialogGtk::JSModalDialogGtk(JavaScriptAppModalDialog* dialog, // Adjust content area as needed. Set up the prompt text entry or // suppression check box. - if (MessageBoxFlags::kIsJavascriptPrompt == dialog_->dialog_flags()) { + if (ui::MessageBoxFlags::kIsJavascriptPrompt == dialog_->dialog_flags()) { // TODO(tc): Replace with gtk_dialog_get_content_area() when using GTK 2.14+ GtkWidget* contents_vbox = GTK_DIALOG(gtk_dialog_)->vbox; GtkWidget* text_box = gtk_entry_new(); @@ -129,7 +129,7 @@ JSModalDialogGtk::JSModalDialogGtk(JavaScriptAppModalDialog* dialog, // Add the OK button and focus it. GtkWidget* ok_button = gtk_dialog_add_button(GTK_DIALOG(gtk_dialog_), GTK_STOCK_OK, GTK_RESPONSE_OK); - if (MessageBoxFlags::kIsJavascriptPrompt != dialog_->dialog_flags()) + if (ui::MessageBoxFlags::kIsJavascriptPrompt != dialog_->dialog_flags()) gtk_widget_grab_focus(ok_button); } @@ -146,15 +146,15 @@ JSModalDialogGtk::~JSModalDialogGtk() { int JSModalDialogGtk::GetAppModalDialogButtons() const { switch (dialog_->dialog_flags()) { - case MessageBoxFlags::kIsJavascriptAlert: - return MessageBoxFlags::DIALOGBUTTON_OK; + case ui::MessageBoxFlags::kIsJavascriptAlert: + return ui::MessageBoxFlags::DIALOGBUTTON_OK; - case MessageBoxFlags::kIsJavascriptConfirm: - return MessageBoxFlags::DIALOGBUTTON_OK | - MessageBoxFlags::DIALOGBUTTON_CANCEL; + case ui::MessageBoxFlags::kIsJavascriptConfirm: + return ui::MessageBoxFlags::DIALOGBUTTON_OK | + ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; - case MessageBoxFlags::kIsJavascriptPrompt: - return MessageBoxFlags::DIALOGBUTTON_OK; + case ui::MessageBoxFlags::kIsJavascriptPrompt: + return ui::MessageBoxFlags::DIALOGBUTTON_OK; default: NOTREACHED(); diff --git a/chrome/browser/ui/gtk/js_modal_dialog_gtk.h b/chrome/browser/ui/gtk/js_modal_dialog_gtk.h index e40c38b..7952309 100644 --- a/chrome/browser/ui/gtk/js_modal_dialog_gtk.h +++ b/chrome/browser/ui/gtk/js_modal_dialog_gtk.h @@ -6,11 +6,11 @@ #define CHROME_BROWSER_UI_GTK_JS_MODAL_DIALOG_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" #include "gfx/native_widget_types.h" +#include "ui/base/gtk/gtk_signal.h" typedef struct _GtkWidget GtkWidget; diff --git a/chrome/browser/ui/gtk/location_bar_view_gtk.h b/chrome/browser/ui/gtk/location_bar_view_gtk.h index 6d3fbc5..0298495 100644 --- a/chrome/browser/ui/gtk/location_bar_view_gtk.h +++ b/chrome/browser/ui/gtk/location_bar_view_gtk.h @@ -11,7 +11,6 @@ #include <map> #include <string> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/scoped_vector.h" @@ -29,6 +28,7 @@ #include "chrome/common/notification_registrar.h" #include "chrome/common/page_transition_types.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/gtk/gtk_signal.h" #include "webkit/glue/window_open_disposition.h" class AutocompleteEditViewGtk; diff --git a/chrome/browser/ui/gtk/menu_bar_helper.cc b/chrome/browser/ui/gtk/menu_bar_helper.cc index 11803b9..7a792f83 100644 --- a/chrome/browser/ui/gtk/menu_bar_helper.cc +++ b/chrome/browser/ui/gtk/menu_bar_helper.cc @@ -6,9 +6,9 @@ #include <algorithm> -#include "app/gtk_signal_registrar.h" #include "base/logging.h" #include "chrome/browser/ui/gtk/gtk_util.h" +#include "ui/base/gtk/gtk_signal_registrar.h" namespace { @@ -81,7 +81,7 @@ void MenuBarHelper::MenuStartedShowing(GtkWidget* button, GtkWidget* menu) { button_showing_menu_ = button; showing_menu_ = menu; - signal_handlers_.reset(new GtkSignalRegistrar()); + signal_handlers_.reset(new ui::GtkSignalRegistrar()); signal_handlers_->Connect(menu, "destroy", G_CALLBACK(OnMenuHiddenOrDestroyedThunk), this); signal_handlers_->Connect(menu, "hide", diff --git a/chrome/browser/ui/gtk/menu_bar_helper.h b/chrome/browser/ui/gtk/menu_bar_helper.h index e29a18e..57077e9 100644 --- a/chrome/browser/ui/gtk/menu_bar_helper.h +++ b/chrome/browser/ui/gtk/menu_bar_helper.h @@ -13,10 +13,12 @@ #include <vector> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" +#include "ui/base/gtk/gtk_signal.h" +namespace ui { class GtkSignalRegistrar; +} class MenuBarHelper { public: @@ -70,7 +72,7 @@ class MenuBarHelper { // Signal handlers that are attached only between the "show" and "hide" events // for the menu. - scoped_ptr<GtkSignalRegistrar> signal_handlers_; + scoped_ptr<ui::GtkSignalRegistrar> signal_handlers_; Delegate* delegate_; }; diff --git a/chrome/browser/ui/gtk/menu_gtk.h b/chrome/browser/ui/gtk/menu_gtk.h index abe78a6..2fdb2eb 100644 --- a/chrome/browser/ui/gtk/menu_gtk.h +++ b/chrome/browser/ui/gtk/menu_gtk.h @@ -11,9 +11,9 @@ #include <string> #include <vector> -#include "app/gtk_signal.h" #include "base/task.h" #include "gfx/point.h" +#include "ui/base/gtk/gtk_signal.h" class SkBitmap; diff --git a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.h b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.h index c215ad6..260c9e7 100644 --- a/chrome/browser/ui/gtk/notifications/balloon_view_gtk.h +++ b/chrome/browser/ui/gtk/notifications/balloon_view_gtk.h @@ -8,7 +8,6 @@ #define CHROME_BROWSER_UI_GTK_NOTIFICATIONS_BALLOON_VIEW_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "chrome/browser/notifications/balloon.h" @@ -20,6 +19,7 @@ #include "gfx/rect.h" #include "gfx/size.h" #include "ui/base/animation/animation_delegate.h" +#include "ui/base/gtk/gtk_signal.h" class BalloonCollection; class CustomDrawButton; diff --git a/chrome/browser/ui/gtk/options/advanced_contents_gtk.cc b/chrome/browser/ui/gtk/options/advanced_contents_gtk.cc index a410fd2..e8ad344 100644 --- a/chrome/browser/ui/gtk/options/advanced_contents_gtk.cc +++ b/chrome/browser/ui/gtk/options/advanced_contents_gtk.cc @@ -10,7 +10,6 @@ #include <string> #include <vector> -#include "app/gtk_signal.h" #include "app/l10n_util.h" #include "base/basictypes.h" #include "base/command_line.h" @@ -47,6 +46,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" +#include "ui/base/gtk/gtk_signal.h" namespace { diff --git a/chrome/browser/ui/gtk/options/advanced_page_gtk.h b/chrome/browser/ui/gtk/options/advanced_page_gtk.h index 3477ff4..39277ef 100644 --- a/chrome/browser/ui/gtk/options/advanced_page_gtk.h +++ b/chrome/browser/ui/gtk/options/advanced_page_gtk.h @@ -8,11 +8,11 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/ui/gtk/options/advanced_contents_gtk.h" #include "chrome/browser/ui/gtk/options/managed_prefs_banner_gtk.h" #include "chrome/browser/ui/options/options_page_base.h" +#include "ui/base/gtk/gtk_signal.h" class Profile; diff --git a/chrome/browser/ui/gtk/options/content_exception_editor.h b/chrome/browser/ui/gtk/options/content_exception_editor.h index 833ebf8..6839838 100644 --- a/chrome/browser/ui/gtk/options/content_exception_editor.h +++ b/chrome/browser/ui/gtk/options/content_exception_editor.h @@ -8,11 +8,11 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "chrome/browser/content_exceptions_table_model.h" #include "chrome/browser/content_setting_combo_model.h" #include "chrome/common/content_settings.h" #include "chrome/common/content_settings_types.h" +#include "ui/base/gtk/gtk_signal.h" // An editor which lets the user create or edit an individual exception to the // current content setting policy. (i.e. let www.google.com always show diff --git a/chrome/browser/ui/gtk/options/content_exceptions_window_gtk.h b/chrome/browser/ui/gtk/options/content_exceptions_window_gtk.h index 335bb69..2f1940e 100644 --- a/chrome/browser/ui/gtk/options/content_exceptions_window_gtk.h +++ b/chrome/browser/ui/gtk/options/content_exceptions_window_gtk.h @@ -10,13 +10,13 @@ #include <string> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/content_exceptions_table_model.h" #include "chrome/browser/ui/gtk/gtk_tree.h" #include "chrome/browser/ui/gtk/options/content_exception_editor.h" #include "chrome/common/content_settings.h" #include "chrome/common/content_settings_types.h" +#include "ui/base/gtk/gtk_signal.h" class HostContentSettingsMap; diff --git a/chrome/browser/ui/gtk/options/content_filter_page_gtk.h b/chrome/browser/ui/gtk/options/content_filter_page_gtk.h index 82daa24..39d4179 100644 --- a/chrome/browser/ui/gtk/options/content_filter_page_gtk.h +++ b/chrome/browser/ui/gtk/options/content_filter_page_gtk.h @@ -8,12 +8,12 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/ui/options/options_page_base.h" #include "chrome/common/content_settings.h" #include "chrome/common/content_settings_types.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/gtk/gtk_signal.h" class ContentSettingsDetails; diff --git a/chrome/browser/ui/gtk/options/content_page_gtk.h b/chrome/browser/ui/gtk/options/content_page_gtk.h index 183b7b0..313e402 100644 --- a/chrome/browser/ui/gtk/options/content_page_gtk.h +++ b/chrome/browser/ui/gtk/options/content_page_gtk.h @@ -10,12 +10,12 @@ #include <string> -#include "app/gtk_signal.h" #include "chrome/browser/autofill/personal_data_manager.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/ui/gtk/options/managed_prefs_banner_gtk.h" #include "chrome/browser/ui/options/options_page_base.h" +#include "ui/base/gtk/gtk_signal.h" class Profile; diff --git a/chrome/browser/ui/gtk/options/content_settings_window_gtk.h b/chrome/browser/ui/gtk/options/content_settings_window_gtk.h index cd50a9f..7a5b248 100644 --- a/chrome/browser/ui/gtk/options/content_settings_window_gtk.h +++ b/chrome/browser/ui/gtk/options/content_settings_window_gtk.h @@ -8,12 +8,12 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/ui/gtk/options/content_filter_page_gtk.h" #include "chrome/browser/ui/gtk/options/cookie_filter_page_gtk.h" #include "chrome/common/content_settings_types.h" +#include "ui/base/gtk/gtk_signal.h" class AccessibleWidgetHelper; diff --git a/chrome/browser/ui/gtk/options/cookie_filter_page_gtk.h b/chrome/browser/ui/gtk/options/cookie_filter_page_gtk.h index dbd361d..82c0128 100644 --- a/chrome/browser/ui/gtk/options/cookie_filter_page_gtk.h +++ b/chrome/browser/ui/gtk/options/cookie_filter_page_gtk.h @@ -10,10 +10,10 @@ #include <string> -#include "app/gtk_signal.h" #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/ui/options/options_page_base.h" +#include "ui/base/gtk/gtk_signal.h" class Profile; diff --git a/chrome/browser/ui/gtk/options/cookies_view.h b/chrome/browser/ui/gtk/options/cookies_view.h index eac8d95..26d72f6 100644 --- a/chrome/browser/ui/gtk/options/cookies_view.h +++ b/chrome/browser/ui/gtk/options/cookies_view.h @@ -10,7 +10,6 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/scoped_ptr.h" @@ -22,6 +21,7 @@ #include "chrome/browser/ui/gtk/gtk_chrome_cookie_view.h" #include "chrome/browser/ui/gtk/gtk_tree.h" #include "net/base/cookie_monster.h" +#include "ui/base/gtk/gtk_signal.h" class CookieDisplayGtk; class CookiesTreeModel; diff --git a/chrome/browser/ui/gtk/options/fonts_page_gtk.h b/chrome/browser/ui/gtk/options/fonts_page_gtk.h index 020a7b3..e61d225 100644 --- a/chrome/browser/ui/gtk/options/fonts_page_gtk.h +++ b/chrome/browser/ui/gtk/options/fonts_page_gtk.h @@ -11,11 +11,11 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/character_encoding.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/ui/options/options_page_base.h" +#include "ui/base/gtk/gtk_signal.h" class DefaultEncodingComboboxModel; diff --git a/chrome/browser/ui/gtk/options/general_page_gtk.h b/chrome/browser/ui/gtk/options/general_page_gtk.h index 059194a..9e41e50 100644 --- a/chrome/browser/ui/gtk/options/general_page_gtk.h +++ b/chrome/browser/ui/gtk/options/general_page_gtk.h @@ -10,7 +10,6 @@ #include <string> -#include "app/gtk_signal.h" #include "chrome/browser/prefs/pref_change_registrar.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/search_engines/template_url_model_observer.h" @@ -19,6 +18,7 @@ #include "chrome/browser/ui/gtk/options/managed_prefs_banner_gtk.h" #include "chrome/browser/ui/options/options_page_base.h" #include "googleurl/src/gurl.h" +#include "ui/base/gtk/gtk_signal.h" class AccessibleWidgetHelper; class CustomHomePagesTableModel; diff --git a/chrome/browser/ui/gtk/options/languages_page_gtk.cc b/chrome/browser/ui/gtk/options/languages_page_gtk.cc index 9374bc1..a2230d4 100644 --- a/chrome/browser/ui/gtk/options/languages_page_gtk.cc +++ b/chrome/browser/ui/gtk/options/languages_page_gtk.cc @@ -8,7 +8,6 @@ #include <string> #include <vector> -#include "app/gtk_signal.h" #include "app/l10n_util.h" #include "base/command_line.h" #include "base/message_loop.h" @@ -22,6 +21,7 @@ #include "chrome/common/pref_names.h" #include "chrome/common/spellcheck_common.h" #include "grit/generated_resources.h" +#include "ui/base/gtk/gtk_signal.h" namespace { diff --git a/chrome/browser/ui/gtk/options/languages_page_gtk.h b/chrome/browser/ui/gtk/options/languages_page_gtk.h index 3aace64..e3eaa27 100644 --- a/chrome/browser/ui/gtk/options/languages_page_gtk.h +++ b/chrome/browser/ui/gtk/options/languages_page_gtk.h @@ -17,12 +17,12 @@ #include <string> -#include "app/gtk_signal.h" #include "base/gtest_prod_util.h" #include "base/scoped_ptr.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/ui/gtk/gtk_tree.h" #include "chrome/browser/ui/options/options_page_base.h" +#include "ui/base/gtk/gtk_signal.h" class LanguageComboboxModel; class LanguageOrderTableModel; diff --git a/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.h b/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.h index 7ffa5a4..8c0f145 100644 --- a/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.h +++ b/chrome/browser/ui/gtk/options/passwords_exceptions_page_gtk.h @@ -10,8 +10,8 @@ #include <vector> -#include "app/gtk_signal.h" #include "chrome/browser/password_manager/password_store.h" +#include "ui/base/gtk/gtk_signal.h" class Profile; diff --git a/chrome/browser/ui/gtk/options/passwords_page_gtk.h b/chrome/browser/ui/gtk/options/passwords_page_gtk.h index e4d0140..618f1ad 100644 --- a/chrome/browser/ui/gtk/options/passwords_page_gtk.h +++ b/chrome/browser/ui/gtk/options/passwords_page_gtk.h @@ -11,10 +11,10 @@ #include <string> #include <vector> -#include "app/gtk_signal.h" #include "chrome/browser/password_manager/password_store.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/common/notification_observer.h" +#include "ui/base/gtk/gtk_signal.h" class Profile; diff --git a/chrome/browser/ui/gtk/options/simple_content_exceptions_window.h b/chrome/browser/ui/gtk/options/simple_content_exceptions_window.h index 30a7c83..c817c01 100644 --- a/chrome/browser/ui/gtk/options/simple_content_exceptions_window.h +++ b/chrome/browser/ui/gtk/options/simple_content_exceptions_window.h @@ -8,12 +8,12 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/remove_rows_table_model.h" #include "chrome/browser/ui/gtk/gtk_tree.h" #include "chrome/common/content_settings.h" #include "chrome/common/content_settings_types.h" +#include "ui/base/gtk/gtk_signal.h" class SimpleContentExceptionsWindow : public gtk_tree::TableAdapter::Delegate { diff --git a/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.h b/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.h index a21242f..2129f4c 100644 --- a/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.h +++ b/chrome/browser/ui/gtk/options/url_picker_dialog_gtk.h @@ -8,11 +8,11 @@ #include <string> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/callback.h" #include "chrome/browser/history/history.h" #include "chrome/browser/ui/gtk/gtk_tree.h" +#include "ui/base/gtk/gtk_signal.h" class AccessibleWidgetHelper; class GURL; diff --git a/chrome/browser/ui/gtk/reload_button_gtk.h b/chrome/browser/ui/gtk/reload_button_gtk.h index bdd5e53..442a739 100644 --- a/chrome/browser/ui/gtk/reload_button_gtk.h +++ b/chrome/browser/ui/gtk/reload_button_gtk.h @@ -8,13 +8,13 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #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 "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/gtk/gtk_signal.h" class Browser; class GtkThemeProvider; diff --git a/chrome/browser/ui/gtk/repost_form_warning_gtk.h b/chrome/browser/ui/gtk/repost_form_warning_gtk.h index 551164c..6fa7cef 100644 --- a/chrome/browser/ui/gtk/repost_form_warning_gtk.h +++ b/chrome/browser/ui/gtk/repost_form_warning_gtk.h @@ -8,9 +8,9 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/ui/gtk/constrained_window_gtk.h" +#include "ui/base/gtk/gtk_signal.h" class RepostFormWarningController; diff --git a/chrome/browser/ui/gtk/rounded_window.cc b/chrome/browser/ui/gtk/rounded_window.cc index 42742ff..3f8b6e4 100644 --- a/chrome/browser/ui/gtk/rounded_window.cc +++ b/chrome/browser/ui/gtk/rounded_window.cc @@ -7,10 +7,10 @@ #include <gtk/gtk.h> #include <math.h> -#include "app/gtk_signal_registrar.h" #include "base/i18n/rtl.h" #include "base/logging.h" #include "chrome/browser/ui/gtk/gtk_util.h" +#include "ui/base/gtk/gtk_signal_registrar.h" namespace gtk_util { @@ -40,7 +40,7 @@ struct RoundedWindowData { int drawn_borders; // Keeps track of attached signal handlers. - GtkSignalRegistrar signals; + ui::GtkSignalRegistrar signals; }; // Callback from GTK to release allocated memory. diff --git a/chrome/browser/ui/gtk/sad_tab_gtk.h b/chrome/browser/ui/gtk/sad_tab_gtk.h index cd756fd..03ab37f 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 "app/gtk_signal.h" #include "chrome/browser/ui/gtk/owned_widget_gtk.h" +#include "ui/base/gtk/gtk_signal.h" class TabContents; diff --git a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc index fc8144e..afae5e3 100644 --- a/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc +++ b/chrome/browser/ui/gtk/ssl_client_certificate_selector.cc @@ -9,7 +9,6 @@ #include <string> #include <vector> -#include "app/gtk_signal.h" #include "app/l10n_util.h" #include "base/i18n/time_formatting.h" #include "base/logging.h" @@ -26,6 +25,7 @@ #include "gfx/native_widget_types.h" #include "grit/generated_resources.h" #include "net/base/x509_certificate.h" +#include "ui/base/gtk/gtk_signal.h" namespace { diff --git a/chrome/browser/ui/gtk/status_bubble_gtk.cc b/chrome/browser/ui/gtk/status_bubble_gtk.cc index ecbdebc..79e6073 100644 --- a/chrome/browser/ui/gtk/status_bubble_gtk.cc +++ b/chrome/browser/ui/gtk/status_bubble_gtk.cc @@ -8,7 +8,6 @@ #include <algorithm> -#include "app/text_elider.h" #include "base/i18n/rtl.h" #include "base/message_loop.h" #include "base/utf_string_conversions.h" @@ -18,6 +17,7 @@ #include "chrome/browser/ui/gtk/slide_animator_gtk.h" #include "chrome/common/notification_service.h" #include "ui/base/animation/slide_animation.h" +#include "ui/base/text/text_elider.h" namespace { @@ -105,8 +105,8 @@ void StatusBubbleGtk::SetStatusTextToURL() { } // 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_ = UTF16ToUTF8(gfx::ElideUrl(url_, gfx::Font(), desired_width, + // bubble. We should extend ui::ElideUrl to take some sort of pango font. + url_text_ = UTF16ToUTF8(ui::ElideUrl(url_, gfx::Font(), desired_width, UTF16ToWideHack(languages_))); SetStatusTextTo(url_text_); } diff --git a/chrome/browser/ui/gtk/status_bubble_gtk.h b/chrome/browser/ui/gtk/status_bubble_gtk.h index 743213d..1e6c0b6 100644 --- a/chrome/browser/ui/gtk/status_bubble_gtk.h +++ b/chrome/browser/ui/gtk/status_bubble_gtk.h @@ -10,7 +10,6 @@ #include <string> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "base/timer.h" #include "chrome/browser/ui/gtk/owned_widget_gtk.h" @@ -20,6 +19,7 @@ #include "gfx/point.h" #include "googleurl/src/gurl.h" #include "ui/base/animation/animation_delegate.h" +#include "ui/base/gtk/gtk_signal.h" class GtkThemeProvider; class Profile; diff --git a/chrome/browser/ui/gtk/status_icons/status_icon_gtk.h b/chrome/browser/ui/gtk/status_icons/status_icon_gtk.h index 686fb6e..3acf454 100644 --- a/chrome/browser/ui/gtk/status_icons/status_icon_gtk.h +++ b/chrome/browser/ui/gtk/status_icons/status_icon_gtk.h @@ -8,8 +8,8 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "chrome/browser/status_icons/status_icon.h" +#include "ui/base/gtk/gtk_signal.h" class MenuGtk; class SkBitmap; diff --git a/chrome/browser/ui/gtk/tab_contents_container_gtk.h b/chrome/browser/ui/gtk/tab_contents_container_gtk.h index 24eaa99..49f57bb 100644 --- a/chrome/browser/ui/gtk/tab_contents_container_gtk.h +++ b/chrome/browser/ui/gtk/tab_contents_container_gtk.h @@ -8,12 +8,12 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "chrome/browser/ui/gtk/owned_widget_gtk.h" #include "chrome/browser/ui/gtk/view_id_util.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/gtk/gtk_signal.h" class RenderViewHost; class StatusBubbleGtk; diff --git a/chrome/browser/ui/gtk/tab_contents_drag_source.h b/chrome/browser/ui/gtk/tab_contents_drag_source.h index e2550f7..52b66f7 100644 --- a/chrome/browser/ui/gtk/tab_contents_drag_source.h +++ b/chrome/browser/ui/gtk/tab_contents_drag_source.h @@ -8,8 +8,6 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" -#include "app/gtk_signal_registrar.h" #include "base/basictypes.h" #include "base/file_path.h" #include "base/message_loop.h" @@ -18,6 +16,8 @@ #include "gfx/native_widget_types.h" #include "googleurl/src/gurl.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" +#include "ui/base/gtk/gtk_signal.h" +#include "ui/base/gtk/gtk_signal_registrar.h" class SkBitmap; class TabContents; @@ -102,7 +102,7 @@ class TabContentsDragSource : public MessageLoopForUI::Observer { // the reference. GtkWidget* drag_icon_; - GtkSignalRegistrar signals_; + ui::GtkSignalRegistrar signals_; DISALLOW_COPY_AND_ASSIGN(TabContentsDragSource); }; diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h index 87cc31f..cf31d4c 100644 --- a/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h +++ b/chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h @@ -10,13 +10,13 @@ #include <set> -#include "app/x11_util.h" #include "base/scoped_ptr.h" #include "base/timer.h" #include "chrome/browser/tab_contents/tab_contents_delegate.h" #include "chrome/browser/ui/tabs/dock_info.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/x/x11_util.h" class DraggedTabGtk; class TabGtk; diff --git a/chrome/browser/ui/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/ui/gtk/tabs/dragged_tab_gtk.cc index 19c2b6f..07ed920 100644 --- a/chrome/browser/ui/gtk/tabs/dragged_tab_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/dragged_tab_gtk.cc @@ -8,7 +8,6 @@ #include <algorithm> -#include "app/x11_util.h" #include "base/i18n/rtl.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_host/backing_store_x.h" @@ -20,6 +19,7 @@ #include "chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h" #include "gfx/gtk_util.h" #include "third_party/skia/include/core/SkShader.h" +#include "ui/base/x/x11_util.h" namespace { diff --git a/chrome/browser/ui/gtk/tabs/tab_gtk.h b/chrome/browser/ui/gtk/tabs/tab_gtk.h index 63841f5..b80039c 100644 --- a/chrome/browser/ui/gtk/tabs/tab_gtk.h +++ b/chrome/browser/ui/gtk/tabs/tab_gtk.h @@ -6,17 +6,19 @@ #define CHROME_BROWSER_UI_GTK_TABS_TAB_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/message_loop.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h" +#include "ui/base/gtk/gtk_signal.h" namespace gfx { class Path; } +namespace ui { class ThemeProvider; +} class TabGtk : public TabRendererGtk, public MessageLoopForUI::Observer { @@ -76,7 +78,7 @@ class TabGtk : public TabRendererGtk, virtual bool HasAvailableDragActions() const = 0; // Returns the theme provider for icons and colors. - virtual ThemeProvider* GetThemeProvider() = 0; + virtual ui::ThemeProvider* GetThemeProvider() = 0; protected: virtual ~TabDelegate() {} diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc index dc23b31..87d6bab 100644 --- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.cc @@ -89,7 +89,8 @@ gfx::Rect GetWidgetBoundsRelativeToParent(GtkWidget* parent, } // namespace -TabRendererGtk::LoadingAnimation::Data::Data(ThemeProvider* theme_provider) { +TabRendererGtk::LoadingAnimation::Data::Data( + ui::ThemeProvider* theme_provider) { // The loading animation image is a strip of states. Each state must be // square, so the height must divide the width evenly. loading_animation_frames = theme_provider->GetBitmapNamed(IDR_THROBBER); @@ -144,7 +145,7 @@ SkColor TabRendererGtk::unselected_title_color_ = SkColorSetRGB(64, 64, 64); // TabRendererGtk::LoadingAnimation, public: // TabRendererGtk::LoadingAnimation::LoadingAnimation( - ThemeProvider* theme_provider) + ui::ThemeProvider* theme_provider) : data_(new Data(theme_provider)), theme_provider_(theme_provider), animation_state_(ANIMATION_NONE), @@ -243,7 +244,7 @@ class TabRendererGtk::FavIconCrashAnimation : public ui::LinearAnimation, //////////////////////////////////////////////////////////////////////////////// // TabRendererGtk, public: -TabRendererGtk::TabRendererGtk(ThemeProvider* theme_provider) +TabRendererGtk::TabRendererGtk(ui::ThemeProvider* theme_provider) : showing_icon_(false), showing_close_button_(false), fav_icon_hiding_offset_(0), diff --git a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h index 7d0b6d1..06e5510 100644 --- a/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h +++ b/chrome/browser/ui/gtk/tabs/tab_renderer_gtk.h @@ -9,7 +9,6 @@ #include <gtk/gtk.h> #include <map> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/string16.h" @@ -21,6 +20,7 @@ #include "gfx/rect.h" #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/animation/animation_delegate.h" +#include "ui/base/gtk/gtk_signal.h" namespace gfx { class Size; @@ -29,10 +29,10 @@ class Size; class CustomDrawButton; class GtkThemeProvider; class TabContents; -class ThemeProvider; namespace ui { class SlideAnimation; +class ThemeProvider; class ThrobAnimation; } @@ -49,7 +49,7 @@ class TabRendererGtk : public ui::AnimationDelegate, class LoadingAnimation : public NotificationObserver { public: struct Data { - explicit Data(ThemeProvider* theme_provider); + explicit Data(ui::ThemeProvider* theme_provider); Data(int loading, int waiting, int waiting_to_loading); SkBitmap* waiting_animation_frames; @@ -59,7 +59,7 @@ class TabRendererGtk : public ui::AnimationDelegate, int waiting_to_loading_frame_count_ratio; }; - explicit LoadingAnimation(ThemeProvider* theme_provider); + explicit LoadingAnimation(ui::ThemeProvider* theme_provider); // Used in unit tests to inject specific data. explicit LoadingAnimation(const LoadingAnimation::Data& data); @@ -93,7 +93,7 @@ class TabRendererGtk : public ui::AnimationDelegate, NotificationRegistrar registrar_; // Gives us our throbber images. - ThemeProvider* theme_provider_; + ui::ThemeProvider* theme_provider_; // Current state of the animation. AnimationState animation_state_; @@ -104,7 +104,7 @@ class TabRendererGtk : public ui::AnimationDelegate, DISALLOW_COPY_AND_ASSIGN(LoadingAnimation); }; - explicit TabRendererGtk(ThemeProvider* theme_provider); + explicit TabRendererGtk(ui::ThemeProvider* theme_provider); virtual ~TabRendererGtk(); // TabContents. If only the loading state was updated, the loading_only flag diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc index 00e2f2c..42c9f92 100644 --- a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc @@ -1206,7 +1206,7 @@ bool TabStripGtk::HasAvailableDragActions() const { return model_->delegate()->GetDragActions() != 0; } -ThemeProvider* TabStripGtk::GetThemeProvider() { +ui::ThemeProvider* TabStripGtk::GetThemeProvider() { return theme_provider_; } diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h index af42202..0056e9e 100644 --- a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h +++ b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.h @@ -9,7 +9,6 @@ #include <gtk/gtk.h> #include <vector> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "base/task.h" #include "base/message_loop.h" @@ -20,6 +19,7 @@ #include "chrome/browser/ui/gtk/view_id_util.h" #include "chrome/common/notification_observer.h" #include "gfx/rect.h" +#include "ui/base/gtk/gtk_signal.h" class BrowserWindowGtk; class CustomDrawButton; @@ -142,7 +142,7 @@ class TabStripGtk : public TabStripModelObserver, virtual void ContinueDrag(GdkDragContext* context); virtual bool EndDrag(bool canceled); virtual bool HasAvailableDragActions() const; - virtual ThemeProvider* GetThemeProvider(); + virtual ui::ThemeProvider* GetThemeProvider(); // MessageLoop::Observer implementation: virtual void WillProcessEvent(GdkEvent* event); diff --git a/chrome/browser/ui/gtk/task_manager_gtk.h b/chrome/browser/ui/gtk/task_manager_gtk.h index 2f90ddf..e72d29a 100644 --- a/chrome/browser/ui/gtk/task_manager_gtk.h +++ b/chrome/browser/ui/gtk/task_manager_gtk.h @@ -10,10 +10,10 @@ #include <string> -#include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/browser/task_manager/task_manager.h" #include "grit/generated_resources.h" +#include "ui/base/gtk/gtk_signal.h" #if defined(TOOLKIT_VIEWS) namespace gfx { diff --git a/chrome/browser/ui/gtk/theme_install_bubble_view_gtk.h b/chrome/browser/ui/gtk/theme_install_bubble_view_gtk.h index 9a963ef..7bed460 100644 --- a/chrome/browser/ui/gtk/theme_install_bubble_view_gtk.h +++ b/chrome/browser/ui/gtk/theme_install_bubble_view_gtk.h @@ -8,10 +8,10 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/basictypes.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/gtk/gtk_signal.h" class ThemeInstallBubbleViewGtk : public NotificationObserver { public: diff --git a/chrome/browser/ui/gtk/update_recommended_dialog.h b/chrome/browser/ui/gtk/update_recommended_dialog.h index ccce4e3..e52a505 100644 --- a/chrome/browser/ui/gtk/update_recommended_dialog.h +++ b/chrome/browser/ui/gtk/update_recommended_dialog.h @@ -6,9 +6,9 @@ #define CHROME_BROWSER_UI_GTK_UPDATE_RECOMMENDED_DIALOG_H_ #pragma once -#include "app/gtk_integers.h" -#include "app/gtk_signal.h" #include "base/basictypes.h" +#include "ui/base/gtk/gtk_integers.h" +#include "ui/base/gtk/gtk_signal.h" typedef struct _GtkWidget GtkWidget; typedef struct _GtkWindow GtkWindow; diff --git a/chrome/browser/ui/input_window_dialog_gtk.cc b/chrome/browser/ui/input_window_dialog_gtk.cc index 8f78cb5..4b2c3f7 100644 --- a/chrome/browser/ui/input_window_dialog_gtk.cc +++ b/chrome/browser/ui/input_window_dialog_gtk.cc @@ -6,12 +6,12 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "base/message_loop.h" #include "base/scoped_ptr.h" #include "base/string_piece.h" #include "base/utf_string_conversions.h" #include "chrome/browser/ui/gtk/gtk_util.h" +#include "ui/base/gtk/gtk_signal.h" class InputWindowDialogGtk : public InputWindowDialog { public: diff --git a/chrome/browser/ui/login/login_prompt_gtk.cc b/chrome/browser/ui/login/login_prompt_gtk.cc index fe0e0a5..5516316 100644 --- a/chrome/browser/ui/login/login_prompt_gtk.cc +++ b/chrome/browser/ui/login/login_prompt_gtk.cc @@ -6,7 +6,6 @@ #include <gtk/gtk.h> -#include "app/gtk_signal.h" #include "app/l10n_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_thread.h" @@ -22,6 +21,7 @@ #include "chrome/browser/ui/login/login_model.h" #include "grit/generated_resources.h" #include "net/url_request/url_request.h" +#include "ui/base/gtk/gtk_signal.h" using webkit_glue::PasswordForm; diff --git a/chrome/browser/ui/tabs/dock_info_gtk.cc b/chrome/browser/ui/tabs/dock_info_gtk.cc index abe02e7..402e79d 100644 --- a/chrome/browser/ui/tabs/dock_info_gtk.cc +++ b/chrome/browser/ui/tabs/dock_info_gtk.cc @@ -13,18 +13,19 @@ #include "chrome/browser/ui/gtk/browser_window_gtk.h" #include "chrome/browser/ui/gtk/gtk_util.h" #include "gfx/native_widget_types.h" +#include "ui/base/x/x11_util.h" //////////////////////////////////////////////////////////////////////////////// // BaseWindowFinder // // Base class used to locate a window. A subclass need only override // ShouldStopIterating to determine when iteration should stop. -class BaseWindowFinder : public x11_util::EnumerateWindowsDelegate { +class BaseWindowFinder : public ui::EnumerateWindowsDelegate { public: explicit BaseWindowFinder(const std::set<GtkWidget*>& ignore) { std::set<GtkWidget*>::iterator iter; for (iter = ignore.begin(); iter != ignore.end(); iter++) { - XID xid = x11_util::GetX11WindowFromGtkWidget(*iter); + XID xid = ui::GetX11WindowFromGtkWidget(*iter); ignore_.insert(xid); } } @@ -75,13 +76,13 @@ class TopMostFinder : public BaseWindowFinder { return true; } - if (!x11_util::IsWindowVisible(window)) { + if (!ui::IsWindowVisible(window)) { // The window isn't visible, keep iterating. return false; } gfx::Rect rect; - if (x11_util::GetWindowRect(window, &rect) && rect.Contains(screen_loc_)) { + if (ui::GetWindowRect(window, &rect) && rect.Contains(screen_loc_)) { // At this point we haven't found our target window, so this window is // higher in the z-order than the target window. If this window contains // the point, then we can stop the search now because this window is @@ -145,11 +146,11 @@ class LocalProcessWindowFinder : public BaseWindowFinder { if (!BrowserWindowGtk::GetBrowserWindowForXID(window)) return false; - if (!x11_util::IsWindowVisible(window)) + if (!ui::IsWindowVisible(window)) return false; gfx::Rect rect; - if (x11_util::GetWindowRect(window, &rect) && rect.Contains(screen_loc_)) { + if (ui::GetWindowRect(window, &rect) && rect.Contains(screen_loc_)) { result_ = window; return true; } diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc index 5ef55c165..3ceee8d 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -7,7 +7,6 @@ #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" #include "app/l10n_util.h" -#include "app/text_elider.h" #include "app/resource_bundle.h" #include "base/string_number_conversions.h" #include "chrome/browser/metrics/user_metrics.h" @@ -22,6 +21,7 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "net/base/registry_controlled_domain.h" +#include "ui/base/text/text_elider.h" const int BackForwardMenuModel::kMaxHistoryItems = 12; const int BackForwardMenuModel::kMaxChapterStops = 5; @@ -82,7 +82,7 @@ string16 BackForwardMenuModel::GetLabelAt(int index) const { string16 menu_text(entry->GetTitleForDisplay( GetTabContents()->profile()->GetPrefs()-> GetString(prefs::kAcceptLanguages))); - menu_text = gfx::ElideText(menu_text, gfx::Font(), kMaxWidth, false); + menu_text = ui::ElideText(menu_text, gfx::Font(), kMaxWidth, false); for (size_t i = menu_text.find('&'); i != string16::npos; i = menu_text.find('&', i + 2)) { diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc index bb4b189..51d589a 100644 --- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc +++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc @@ -6,8 +6,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/text_elider.h" -#include "app/theme_provider.h" #include "base/compiler_specific.h" #include "base/i18n/bidi_line_iterator.h" #include "base/i18n/rtl.h" @@ -28,6 +26,8 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "third_party/skia/include/core/SkShader.h" +#include "ui/base/text/text_elider.h" +#include "ui/base/theme_provider.h" #include "unicode/ubidi.h" #include "views/controls/button/text_button.h" #include "views/controls/label.h" @@ -710,8 +710,8 @@ void AutocompleteResultView::Elide(Runs* runs, int remaining_width) const { // Can we fit at least an ellipsis? std::wstring elided_text(UTF16ToWideHack( - gfx::ElideText(WideToUTF16Hack(j->text), *j->font, remaining_width, - false))); + ui::ElideText(WideToUTF16Hack(j->text), *j->font, remaining_width, + false))); Classifications::reverse_iterator prior_classification(j); ++prior_classification; const bool on_first_classification = diff --git a/chrome/browser/ui/views/bookmark_bar_instructions_view.cc b/chrome/browser/ui/views/bookmark_bar_instructions_view.cc index 53945a9..83b783a 100644 --- a/chrome/browser/ui/views/bookmark_bar_instructions_view.cc +++ b/chrome/browser/ui/views/bookmark_bar_instructions_view.cc @@ -97,7 +97,7 @@ void BookmarkBarInstructionsView::LinkActivated(views::Link* source, void BookmarkBarInstructionsView::UpdateColors() { // We don't always have a theme provider (ui tests, for example). - const ThemeProvider* theme_provider = GetThemeProvider(); + const ui::ThemeProvider* theme_provider = GetThemeProvider(); if (!theme_provider) return; updated_colors_ = true; diff --git a/chrome/browser/ui/views/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmark_bar_view.cc index 21ffe74..ede1b44 100644 --- a/chrome/browser/ui/views/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmark_bar_view.cc @@ -11,7 +11,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/text_elider.h" #include "base/i18n/rtl.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -43,6 +42,7 @@ #include "grit/theme_resources.h" #include "ui/base/animation/slide_animation.h" #include "ui/base/dragdrop/os_exchange_data.h" +#include "ui/base/text/text_elider.h" #include "views/controls/button/menu_button.h" #include "views/controls/label.h" #include "views/controls/menu/menu_item_view.h" @@ -144,7 +144,7 @@ static std::wstring CreateToolTipForURLAndTitle(const gfx::Point& screen_loc, if (!title.empty()) { std::wstring localized_title = title; base::i18n::AdjustStringForLocaleDirection(&localized_title); - result.append(UTF16ToWideHack(gfx::ElideText(WideToUTF16Hack( + result.append(UTF16ToWideHack(ui::ElideText(WideToUTF16Hack( localized_title), tt_font, max_width, false))); } @@ -159,7 +159,7 @@ static std::wstring CreateToolTipForURLAndTitle(const gfx::Point& screen_loc, // "/http://www.yahoo.com" when rendered, as is, in an RTL context since // the Unicode BiDi algorithm puts certain characters on the left by // default. - string16 elided_url(gfx::ElideUrl(url, tt_font, max_width, languages)); + string16 elided_url(ui::ElideUrl(url, tt_font, max_width, languages)); elided_url = base::i18n::GetDisplayStringInLTRDirectionality(elided_url); result.append(UTF16ToWideHack(elided_url)); } @@ -1577,7 +1577,7 @@ void BookmarkBarView::StopThrobbing(bool immediate) { void BookmarkBarView::UpdateColors() { // We don't always have a theme provider (ui tests, for example). - const ThemeProvider* theme_provider = GetThemeProvider(); + const ui::ThemeProvider* theme_provider = GetThemeProvider(); if (!theme_provider) return; SkColor text_color = diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc index 7e3726d..817dc7c 100644 --- a/chrome/browser/ui/views/browser_actions_container.cc +++ b/chrome/browser/ui/views/browser_actions_container.cc @@ -986,7 +986,7 @@ void BrowserActionsContainer::ModelLoaded() { } void BrowserActionsContainer::LoadImages() { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); chevron_->SetIcon(*tp->GetBitmapNamed(IDR_BROWSER_ACTIONS_OVERFLOW)); chevron_->SetHoverIcon(*tp->GetBitmapNamed(IDR_BROWSER_ACTIONS_OVERFLOW_H)); chevron_->SetPushedIcon(*tp->GetBitmapNamed(IDR_BROWSER_ACTIONS_OVERFLOW_P)); diff --git a/chrome/browser/ui/views/confirm_message_box_dialog.cc b/chrome/browser/ui/views/confirm_message_box_dialog.cc index 5d5b4e8..2c076c2 100644 --- a/chrome/browser/ui/views/confirm_message_box_dialog.cc +++ b/chrome/browser/ui/views/confirm_message_box_dialog.cc @@ -5,10 +5,10 @@ #include "chrome/browser/ui/views/confirm_message_box_dialog.h" #include "app/l10n_util.h" -#include "app/message_box_flags.h" #include "base/utf_string_conversions.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" +#include "ui/base/message_box_flags.h" #include "views/standard_layout.h" #include "views/widget/widget.h" #include "views/window/window.h" @@ -65,8 +65,8 @@ ConfirmMessageBoxDialog::ConfirmMessageBoxDialog( } int ConfirmMessageBoxDialog::GetDialogButtons() const { - return MessageBoxFlags::DIALOGBUTTON_OK | - MessageBoxFlags::DIALOGBUTTON_CANCEL; + return ui::MessageBoxFlags::DIALOGBUTTON_OK | + ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; } std::wstring ConfirmMessageBoxDialog::GetWindowTitle() const { @@ -74,11 +74,11 @@ std::wstring ConfirmMessageBoxDialog::GetWindowTitle() const { } std::wstring ConfirmMessageBoxDialog::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { - if (button == MessageBoxFlags::DIALOGBUTTON_OK) { + ui::MessageBoxFlags::DialogButton button) const { + if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) { return confirm_label_; } - if (button == MessageBoxFlags::DIALOGBUTTON_CANCEL) + if (button == ui::MessageBoxFlags::DIALOGBUTTON_CANCEL) return reject_label_; return DialogDelegate::GetDialogButtonLabel(button); } diff --git a/chrome/browser/ui/views/default_search_view.cc b/chrome/browser/ui/views/default_search_view.cc index bf48c06..edea15e 100644 --- a/chrome/browser/ui/views/default_search_view.cc +++ b/chrome/browser/ui/views/default_search_view.cc @@ -7,7 +7,6 @@ #include <string> #include "app/l10n_util.h" -#include "app/message_box_flags.h" #include "app/resource_bundle.h" #include "base/utf_string_conversions.h" #include "chrome/browser/profiles/profile.h" @@ -19,6 +18,7 @@ #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" +#include "ui/base/message_box_flags.h" #include "views/controls/button/native_button.h" #include "views/controls/image_view.h" #include "views/controls/label.h" @@ -156,7 +156,7 @@ views::View* DefaultSearchView::GetContentsView() { } int DefaultSearchView::GetDialogButtons() const { - return MessageBoxFlags::DIALOGBUTTON_NONE; + return ui::MessageBoxFlags::DIALOGBUTTON_NONE; } bool DefaultSearchView::Accept() { diff --git a/chrome/browser/ui/views/detachable_toolbar_view.cc b/chrome/browser/ui/views/detachable_toolbar_view.cc index 7f04409..09be69b 100644 --- a/chrome/browser/ui/views/detachable_toolbar_view.cc +++ b/chrome/browser/ui/views/detachable_toolbar_view.cc @@ -26,7 +26,7 @@ void DetachableToolbarView::PaintBackgroundAttachedMode( gfx::Canvas* canvas, views::View* view, const gfx::Point& background_origin) { - ThemeProvider* tp = view->GetThemeProvider(); + ui::ThemeProvider* tp = view->GetThemeProvider(); SkColor theme_toolbar_color = tp->GetColor(BrowserThemeProvider::COLOR_TOOLBAR); canvas->FillRectInt(theme_toolbar_color, 0, 0, @@ -63,7 +63,7 @@ void DetachableToolbarView::PaintHorizontalBorder(gfx::Canvas* canvas, // static void DetachableToolbarView::PaintContentAreaBackground( - gfx::Canvas* canvas, ThemeProvider* theme_provider, + gfx::Canvas* canvas, ui::ThemeProvider* theme_provider, const SkRect& rect, double roundness) { SkPaint paint; paint.setAntiAlias(true); @@ -75,7 +75,7 @@ void DetachableToolbarView::PaintContentAreaBackground( // static void DetachableToolbarView::PaintContentAreaBorder( - gfx::Canvas* canvas, ThemeProvider* theme_provider, + gfx::Canvas* canvas, ui::ThemeProvider* theme_provider, const SkRect& rect, double roundness) { SkPaint border_paint; border_paint.setColor( diff --git a/chrome/browser/ui/views/detachable_toolbar_view.h b/chrome/browser/ui/views/detachable_toolbar_view.h index 64547b6..9f69bf1 100644 --- a/chrome/browser/ui/views/detachable_toolbar_view.h +++ b/chrome/browser/ui/views/detachable_toolbar_view.h @@ -60,12 +60,12 @@ class DetachableToolbarView : public AccessiblePaneView { // bookmarks or extension toolstrips). |rect| is the rectangle to paint // the background within. |roundness| describes the roundness of the corners. static void PaintContentAreaBackground(gfx::Canvas* canvas, - ThemeProvider* theme_provider, + ui::ThemeProvider* theme_provider, const SkRect& rect, double roundness); // Paint the border around the content area (when in detached mode). static void PaintContentAreaBorder(gfx::Canvas* canvas, - ThemeProvider* theme_provider, + ui::ThemeProvider* theme_provider, const SkRect& rect, double roundness); diff --git a/chrome/browser/ui/views/download_item_view.cc b/chrome/browser/ui/views/download_item_view.cc index f398941..155cc09 100644 --- a/chrome/browser/ui/views/download_item_view.cc +++ b/chrome/browser/ui/views/download_item_view.cc @@ -8,7 +8,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/text_elider.h" #include "base/callback.h" #include "base/file_path.h" #include "base/i18n/rtl.h" @@ -26,6 +25,7 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ui/base/animation/slide_animation.h" +#include "ui/base/text/text_elider.h" #include "views/controls/button/native_button.h" #include "views/controls/menu/menu_2.h" #include "views/widget/root_view.h" @@ -280,16 +280,16 @@ DownloadItemView::DownloadItemView(DownloadItem* download, // Elide giant extensions (this shouldn't currently be hit, but might // in future, should we ever notice unsafe giant extensions). if (extension.length() > kFileNameMaxLength / 2) - gfx::ElideString(extension, kFileNameMaxLength / 2, &extension); + ui::ElideString(extension, kFileNameMaxLength / 2, &extension); // The dangerous download label text is different for an extension file. if (download->is_extension_install()) { dangerous_download_label_ = new views::Label(UTF16ToWide( l10n_util::GetStringUTF16(IDS_PROMPT_DANGEROUS_DOWNLOAD_EXTENSION))); } else { - gfx::ElideString(rootname, - kFileNameMaxLength - extension.length(), - &rootname); + ui::ElideString(rootname, + kFileNameMaxLength - extension.length(), + &rootname); std::wstring filename = rootname + L"." + extension; filename = UTF16ToWide(base::i18n::GetDisplayStringInLTRDirectionality( WideToUTF16(filename))); @@ -609,8 +609,8 @@ void DownloadItemView::Paint(gfx::Canvas* canvas) { if (!IsDangerousMode()) { string16 filename; if (!disabled_while_opening_) { - filename = gfx::ElideFilename(download_->GetFileNameToReportUser(), - font_, kTextWidth); + filename = ui::ElideFilename(download_->GetFileNameToReportUser(), + font_, kTextWidth); } else { // First, Calculate the download status opening string width. string16 status_string = @@ -618,8 +618,8 @@ void DownloadItemView::Paint(gfx::Canvas* canvas) { int status_string_width = font_.GetStringWidth(status_string); // Then, elide the file name. string16 filename_string = - gfx::ElideFilename(download_->GetFileNameToReportUser(), font_, - kTextWidth - status_string_width); + ui::ElideFilename(download_->GetFileNameToReportUser(), font_, + kTextWidth - status_string_width); // Last, concat the whole string. filename = l10n_util::GetStringFUTF16(IDS_DOWNLOAD_STATUS_OPENING, filename_string); diff --git a/chrome/browser/ui/views/dropdown_bar_host.cc b/chrome/browser/ui/views/dropdown_bar_host.cc index 184cd9f..9770328 100644 --- a/chrome/browser/ui/views/dropdown_bar_host.cc +++ b/chrome/browser/ui/views/dropdown_bar_host.cc @@ -20,7 +20,7 @@ #if defined(OS_WIN) #include "base/win/scoped_gdi_object.h" #elif defined(OS_LINUX) -#include "app/scoped_handle_gtk.h" +#include "ui/base/gtk/scoped_handle_gtk.h" #endif namespace { @@ -28,7 +28,7 @@ namespace { #if defined(OS_WIN) typedef base::win::ScopedRegion ScopedPlatformRegion; #elif defined(OS_LINUX) -typedef ScopedRegion ScopedPlatformRegion; +typedef ui::ScopedRegion ScopedPlatformRegion; #endif } // namespace diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc index 61f0d38..c4d107a 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.cc +++ b/chrome/browser/ui/views/external_protocol_dialog.cc @@ -5,8 +5,6 @@ #include "chrome/browser/ui/views/external_protocol_dialog.h" #include "app/l10n_util.h" -#include "app/message_box_flags.h" -#include "app/text_elider.h" #include "base/metrics/histogram.h" #include "base/string_util.h" #include "base/threading/thread.h" @@ -18,6 +16,8 @@ #include "chrome/browser/tab_contents/tab_util.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +#include "ui/base/message_box_flags.h" +#include "ui/base/text/text_elider.h" #include "views/controls/message_box_view.h" #include "views/window/window.h" @@ -56,12 +56,12 @@ ExternalProtocolDialog::~ExternalProtocolDialog() { // ExternalProtocolDialog, views::DialogDelegate implementation: int ExternalProtocolDialog::GetDefaultDialogButton() const { - return MessageBoxFlags::DIALOGBUTTON_CANCEL; + return ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; } std::wstring ExternalProtocolDialog::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { - if (button == MessageBoxFlags::DIALOGBUTTON_OK) + ui::MessageBoxFlags::DialogButton button) const { + if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) return UTF16ToWide( l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_OK_BUTTON_TEXT)); else @@ -125,9 +125,9 @@ ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents, const int kMaxCommandSize = 256; std::wstring elided_url_without_scheme; std::wstring elided_command; - gfx::ElideString(ASCIIToWide(url.possibly_invalid_spec()), - kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); - gfx::ElideString(command, kMaxCommandSize, &elided_command); + ui::ElideString(ASCIIToWide(url.possibly_invalid_spec()), + kMaxUrlWithoutSchemeSize, &elided_url_without_scheme); + ui::ElideString(command, kMaxCommandSize, &elided_command); std::wstring message_text = UTF16ToWide(l10n_util::GetStringFUTF16( IDS_EXTERNAL_PROTOCOL_INFORMATION, @@ -141,10 +141,11 @@ ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents, message_text += UTF16ToWide(l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_WARNING)); - message_box_view_ = new MessageBoxView(MessageBoxFlags::kIsConfirmMessageBox, - message_text, - std::wstring(), - kMessageWidth); + message_box_view_ = new MessageBoxView( + ui::MessageBoxFlags::kIsConfirmMessageBox, + message_text, + std::wstring(), + kMessageWidth); message_box_view_->SetCheckBoxLabel(UTF16ToWide( l10n_util::GetStringUTF16(IDS_EXTERNAL_PROTOCOL_CHECKBOX_TEXT))); diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc index db9af17d..e992f2a 100644 --- a/chrome/browser/ui/views/find_bar_view.cc +++ b/chrome/browser/ui/views/find_bar_view.cc @@ -286,7 +286,7 @@ void FindBarView::Paint(gfx::Canvas* canvas) { // controller, so the whitespace in the left and right background images is // actually outside the window region and is therefore not drawn. See // FindInPageWidgetWin::CreateRoundedWindowEdges() for details. - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); canvas->TileImageInt(*tp->GetBitmapNamed(IDR_THEME_TOOLBAR), origin.x(), origin.y(), 0, 0, bounds.width(), bounds.height()); diff --git a/chrome/browser/ui/views/first_run_bubble.cc b/chrome/browser/ui/views/first_run_bubble.cc index 895e151..299a9a6 100644 --- a/chrome/browser/ui/views/first_run_bubble.cc +++ b/chrome/browser/ui/views/first_run_bubble.cc @@ -4,7 +4,6 @@ #include "chrome/browser/ui/views/first_run_bubble.h" -#include "app/gfx/font_util.h" #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/utf_string_conversions.h" @@ -18,6 +17,7 @@ #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" +#include "ui/base/l10n/l10n_font_util.h" #include "ui/base/win/hwnd_util.h" #include "views/event.h" #include "views/controls/button/native_button.h" @@ -346,9 +346,9 @@ gfx::Size FirstRunOEMBubbleView::GetPreferredSize() { const gfx::Font& font = rb.GetFont( ResourceBundle::MediumFont).DeriveFont(3, gfx::Font::BOLD); gfx::Size size = gfx::Size( - gfx::GetLocalizedContentsWidthForFont( + ui::GetLocalizedContentsWidthForFont( IDS_FIRSTRUNOEMBUBBLE_DIALOG_WIDTH_CHARS, font), - gfx::GetLocalizedContentsHeightForFont( + ui::GetLocalizedContentsHeightForFont( IDS_FIRSTRUNOEMBUBBLE_DIALOG_HEIGHT_LINES, font)); // WARNING: HACK. Vista and XP calculate font size differently; this means diff --git a/chrome/browser/ui/views/frame/browser_frame.h b/chrome/browser/ui/views/frame/browser_frame.h index 3c6a98d..d45be30 100644 --- a/chrome/browser/ui/views/frame/browser_frame.h +++ b/chrome/browser/ui/views/frame/browser_frame.h @@ -12,13 +12,16 @@ class BaseTabStrip; class BrowserView; class Profile; -class ThemeProvider; namespace gfx { class Font; class Rect; } // namespace gfx +namespace ui { +class ThemeProvider; +} + namespace views { class Window; @@ -59,7 +62,7 @@ class BrowserFrame { virtual void UpdateThrobber(bool running) = 0; // Returns the theme provider for this frame. - virtual ThemeProvider* GetThemeProviderForFrame() const = 0; + virtual ui::ThemeProvider* GetThemeProviderForFrame() const = 0; // Returns true if the window should use the native frame view. This is true // if there are no themes applied on Vista, or if there are themes applied and diff --git a/chrome/browser/ui/views/frame/browser_frame_gtk.h b/chrome/browser/ui/views/frame/browser_frame_gtk.h index 30539f5..b2dc1eb 100644 --- a/chrome/browser/ui/views/frame/browser_frame_gtk.h +++ b/chrome/browser/ui/views/frame/browser_frame_gtk.h @@ -33,14 +33,14 @@ class BrowserFrameGtk : public BrowserFrame, virtual gfx::Rect GetBoundsForTabStrip(BaseTabStrip* tabstrip) const; virtual int GetHorizontalTabStripVerticalOffset(bool restored) const; virtual void UpdateThrobber(bool running); - virtual ThemeProvider* GetThemeProviderForFrame() const; + virtual ui::ThemeProvider* GetThemeProviderForFrame() const; virtual bool AlwaysUseNativeFrame() const; virtual views::View* GetFrameView() const; virtual void TabStripDisplayModeChanged(); // Overridden from views::Widget: - virtual ThemeProvider* GetThemeProvider() const; - virtual ThemeProvider* GetDefaultThemeProvider() const; + virtual ui::ThemeProvider* GetThemeProvider() const; + virtual ui::ThemeProvider* GetDefaultThemeProvider() const; virtual void IsActiveChanged(); virtual void SetInitialFocus(); diff --git a/chrome/browser/ui/views/frame/browser_frame_win.h b/chrome/browser/ui/views/frame/browser_frame_win.h index d39aa7f..a31b208 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.h +++ b/chrome/browser/ui/views/frame/browser_frame_win.h @@ -42,7 +42,7 @@ class BrowserFrameWin : public BrowserFrame, public views::WindowWin { virtual gfx::Rect GetBoundsForTabStrip(BaseTabStrip* tabstrip) const; virtual int GetHorizontalTabStripVerticalOffset(bool restored) const; virtual void UpdateThrobber(bool running); - virtual ThemeProvider* GetThemeProviderForFrame() const; + virtual ui::ThemeProvider* GetThemeProviderForFrame() const; virtual bool AlwaysUseNativeFrame() const; virtual views::View* GetFrameView() const; virtual void TabStripDisplayModeChanged(); @@ -63,8 +63,8 @@ class BrowserFrameWin : public BrowserFrame, public views::WindowWin { virtual LRESULT OnNCActivate(BOOL active); virtual LRESULT OnNCHitTest(const CPoint& pt); virtual void OnWindowPosChanged(WINDOWPOS* window_pos); - virtual ThemeProvider* GetThemeProvider() const; - virtual ThemeProvider* GetDefaultThemeProvider() const; + virtual ui::ThemeProvider* GetThemeProvider() const; + virtual ui::ThemeProvider* GetDefaultThemeProvider() const; virtual void OnScreenReaderDetected(); // Overridden from views::Window: diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index fed8404..c0d454e 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -83,10 +83,10 @@ #include "views/window/window.h" #if defined(OS_WIN) -#include "app/view_prop.h" #include "app/win/win_util.h" #include "chrome/browser/aeropeek_manager.h" #include "chrome/browser/jumplist_win.h" +#include "ui/base/view_prop.h" #elif defined(OS_LINUX) #include "chrome/browser/ui/views/accelerator_table_gtk.h" #include "views/window/hit_test.h" @@ -179,7 +179,7 @@ BookmarkExtensionBackground::BookmarkExtensionBackground( void BookmarkExtensionBackground::Paint(gfx::Canvas* canvas, views::View* view) const { - ThemeProvider* tp = host_view_->GetThemeProvider(); + ui::ThemeProvider* tp = host_view_->GetThemeProvider(); int toolbar_overlap = host_view_->GetToolbarOverlap(); // The client edge is drawn below the toolbar bounds. if (toolbar_overlap) @@ -490,7 +490,7 @@ BrowserView* BrowserView::GetBrowserViewForNativeWindow( #if defined(OS_WIN) if (IsWindow(window)) { return reinterpret_cast<BrowserView*>( - app::ViewProp::GetValue(window, kBrowserViewKey)); + ui::ViewProp::GetValue(window, kBrowserViewKey)); } #else if (window) { @@ -1388,7 +1388,7 @@ gfx::Rect BrowserView::GrabWindowSnapshot(std::vector<unsigned char>* views::Window* window = GetWindow(); #if defined(USE_X11) - x11_util::GrabWindowSnapshot(window->GetNativeWindow(), png_representation); + ui::GrabWindowSnapshot(window->GetNativeWindow(), png_representation); #elif defined(OS_WIN) app::win::GrabWindowSnapshot(window->GetNativeWindow(), png_representation); #endif diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc index 58b3123..8e74eae 100644 --- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc @@ -5,7 +5,6 @@ #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" #include "app/resource_bundle.h" -#include "app/theme_provider.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/themes/browser_theme_provider.h" @@ -17,6 +16,7 @@ #include "gfx/icon_util.h" #include "grit/app_resources.h" #include "grit/theme_resources.h" +#include "ui/base/theme_provider.h" #include "views/window/client_view.h" #include "views/window/window_resources.h" @@ -244,7 +244,7 @@ int GlassBrowserFrameView::NonClientTopBorderHeight( } void GlassBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); gfx::Rect toolbar_bounds(browser_view_->GetToolbarBounds()); gfx::Point toolbar_origin(toolbar_bounds.origin()); @@ -361,7 +361,7 @@ void GlassBrowserFrameView::PaintOTRAvatar(gfx::Canvas* canvas) { } void GlassBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); gfx::Rect client_area_bounds = CalculateClientAreaBounds(width(), height()); // The client edges start below the toolbar upper corner images regardless diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index 30b6084..9070699 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc @@ -6,7 +6,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/theme_provider.h" #include "base/compiler_specific.h" #include "base/utf_string_conversions.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -22,6 +21,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" +#include "ui/base/theme_provider.h" #include "views/controls/button/image_button.h" #include "views/controls/image_view.h" #include "views/widget/root_view.h" @@ -107,7 +107,7 @@ OpaqueBrowserFrameView::OpaqueBrowserFrameView(BrowserFrame* frame, window_icon_(NULL), frame_(frame), browser_view_(browser_view) { - ThemeProvider* tp = frame_->GetThemeProviderForFrame(); + ui::ThemeProvider* tp = frame_->GetThemeProviderForFrame(); SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND); SkBitmap* background = tp->GetBitmapNamed(IDR_THEME_WINDOW_CONTROL_BACKGROUND); @@ -541,7 +541,7 @@ gfx::Rect OpaqueBrowserFrameView::IconBounds() const { } void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); SkBitmap* top_left_corner = tp->GetBitmapNamed(IDR_WINDOW_TOP_LEFT_CORNER); SkBitmap* top_right_corner = @@ -659,7 +659,7 @@ void OpaqueBrowserFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) { void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); views::Window* window = frame_->GetWindow(); // Window frame mode and color @@ -752,7 +752,7 @@ void OpaqueBrowserFrameView::PaintToolbarBackground(gfx::Canvas* canvas) { // section so that we never break the gradient. int split_point = kFrameShadowThickness * 2; int bottom_y = y + split_point; - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_CONTENT_TOP_LEFT_CORNER); int bottom_edge_height = std::min(toolbar_left->height(), h) - split_point; @@ -857,7 +857,7 @@ void OpaqueBrowserFrameView::PaintOTRAvatar(gfx::Canvas* canvas) { } void OpaqueBrowserFrameView::PaintRestoredClientEdge(gfx::Canvas* canvas) { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); int client_area_top = frame_->GetWindow()->GetClientView()->y(); int image_top = client_area_top; diff --git a/chrome/browser/ui/views/js_modal_dialog_views.cc b/chrome/browser/ui/views/js_modal_dialog_views.cc index 8d95f14..e3a05fc 100644 --- a/chrome/browser/ui/views/js_modal_dialog_views.cc +++ b/chrome/browser/ui/views/js_modal_dialog_views.cc @@ -5,12 +5,12 @@ #include "chrome/browser/ui/views/js_modal_dialog_views.h" #include "app/l10n_util.h" -#include "app/message_box_flags.h" #include "base/utf_string_conversions.h" #include "chrome/browser/ui/app_modal_dialogs/app_modal_dialog.h" #include "chrome/browser/ui/views/window.h" #include "grit/generated_resources.h" #include "ui/base/keycodes/keyboard_codes.h" +#include "ui/base/message_box_flags.h" #include "views/controls/message_box_view.h" #include "views/window/window.h" @@ -21,7 +21,7 @@ JSModalDialogViews::JSModalDialogViews( JavaScriptAppModalDialog* parent) : parent_(parent), message_box_view_(new MessageBoxView( - parent->dialog_flags() | MessageBoxFlags::kAutoDetectAlignment, + parent->dialog_flags() | ui::MessageBoxFlags::kAutoDetectAlignment, parent->message_text(), parent->default_prompt_text())) { DCHECK(message_box_view_); @@ -68,22 +68,22 @@ void JSModalDialogViews::CancelAppModalDialog() { // JSModalDialogViews, views::DialogDelegate implementation: int JSModalDialogViews::GetDefaultDialogButton() const { - if (parent_->dialog_flags() & MessageBoxFlags::kFlagHasOKButton) - return MessageBoxFlags::DIALOGBUTTON_OK; + if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasOKButton) + return ui::MessageBoxFlags::DIALOGBUTTON_OK; - if (parent_->dialog_flags() & MessageBoxFlags::kFlagHasCancelButton) - return MessageBoxFlags::DIALOGBUTTON_CANCEL; + if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasCancelButton) + return ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; - return MessageBoxFlags::DIALOGBUTTON_NONE; + return ui::MessageBoxFlags::DIALOGBUTTON_NONE; } int JSModalDialogViews::GetDialogButtons() const { int dialog_buttons = 0; - if (parent_->dialog_flags() & MessageBoxFlags::kFlagHasOKButton) - dialog_buttons = MessageBoxFlags::DIALOGBUTTON_OK; + if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasOKButton) + dialog_buttons = ui::MessageBoxFlags::DIALOGBUTTON_OK; - if (parent_->dialog_flags() & MessageBoxFlags::kFlagHasCancelButton) - dialog_buttons |= MessageBoxFlags::DIALOGBUTTON_CANCEL; + if (parent_->dialog_flags() & ui::MessageBoxFlags::kFlagHasCancelButton) + dialog_buttons |= ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; return dialog_buttons; } @@ -117,12 +117,12 @@ void JSModalDialogViews::OnClose() { } std::wstring JSModalDialogViews::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { + ui::MessageBoxFlags::DialogButton button) const { if (parent_->is_before_unload_dialog()) { - if (button == MessageBoxFlags::DIALOGBUTTON_OK) { + if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) { return UTF16ToWide(l10n_util::GetStringUTF16( IDS_BEFOREUNLOAD_MESSAGEBOX_OK_BUTTON_LABEL)); - } else if (button == MessageBoxFlags::DIALOGBUTTON_CANCEL) { + } else if (button == ui::MessageBoxFlags::DIALOGBUTTON_CANCEL) { return UTF16ToWide(l10n_util::GetStringUTF16( IDS_BEFOREUNLOAD_MESSAGEBOX_CANCEL_BUTTON_LABEL)); } diff --git a/chrome/browser/ui/views/js_modal_dialog_views.h b/chrome/browser/ui/views/js_modal_dialog_views.h index 2ff27f9..1a9a7c3 100644 --- a/chrome/browser/ui/views/js_modal_dialog_views.h +++ b/chrome/browser/ui/views/js_modal_dialog_views.h @@ -10,8 +10,8 @@ #include <string> -#include "app/message_box_flags.h" #include "chrome/browser/ui/app_modal_dialogs/native_app_modal_dialog.h" +#include "ui/base/message_box_flags.h" #include "views/window/dialog_delegate.h" class MessageBoxView; @@ -39,7 +39,7 @@ class JSModalDialogViews : public NativeAppModalDialog, virtual bool Cancel(); virtual bool Accept(); virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const; + ui::MessageBoxFlags::DialogButton button) const; // Overridden from views::WindowDelegate: virtual bool IsModal() const { return true; } diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index d77d597..1e8943c 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -10,7 +10,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/theme_provider.h" #include "base/command_line.h" #include "base/stl_util-inl.h" #include "base/utf_string_conversions.h" @@ -44,6 +43,7 @@ #include "grit/generated_resources.h" #include "grit/theme_resources.h" #include "ui/base/dragdrop/drag_drop_types.h" +#include "ui/base/theme_provider.h" #include "views/controls/label.h" #include "views/drag_utils.h" diff --git a/chrome/browser/ui/views/options/advanced_page_view.cc b/chrome/browser/ui/views/options/advanced_page_view.cc index 128d71a..81a8498 100644 --- a/chrome/browser/ui/views/options/advanced_page_view.cc +++ b/chrome/browser/ui/views/options/advanced_page_view.cc @@ -5,7 +5,6 @@ #include "chrome/browser/ui/views/options/advanced_page_view.h" #include "app/l10n_util.h" -#include "app/message_box_flags.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/profiles/profile.h" @@ -16,6 +15,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" +#include "ui/base/message_box_flags.h" #include "views/controls/message_box_view.h" #include "views/controls/button/native_button.h" #include "views/controls/scroll_view.h" @@ -38,12 +38,12 @@ class ResetDefaultsConfirmBox : public views::DialogDelegate { protected: // views::DialogDelegate virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { + ui::MessageBoxFlags::DialogButton button) const { switch (button) { - case MessageBoxFlags::DIALOGBUTTON_OK: + case ui::MessageBoxFlags::DIALOGBUTTON_OK: return UTF16ToWide( l10n_util::GetStringUTF16(IDS_OPTIONS_RESET_OKLABEL)); - case MessageBoxFlags::DIALOGBUTTON_CANCEL: + case ui::MessageBoxFlags::DIALOGBUTTON_CANCEL: return UTF16ToWide( l10n_util::GetStringUTF16(IDS_OPTIONS_RESET_CANCELLABEL)); default: @@ -71,7 +71,8 @@ class ResetDefaultsConfirmBox : public views::DialogDelegate { IDS_OPTIONS_RESET_CONFIRM_BOX_WIDTH_CHARS); // Also deleted when the window closes. message_box_view_ = new MessageBoxView( - MessageBoxFlags::kFlagHasMessage | MessageBoxFlags::kFlagHasOKButton, + ui::MessageBoxFlags::kFlagHasMessage | + ui::MessageBoxFlags::kFlagHasOKButton, UTF16ToWide( l10n_util::GetStringUTF16(IDS_OPTIONS_RESET_MESSAGE)).c_str(), std::wstring(), diff --git a/chrome/browser/ui/views/options/exceptions_page_view.cc b/chrome/browser/ui/views/options/exceptions_page_view.cc index 7d2c71f..de037ca 100644 --- a/chrome/browser/ui/views/options/exceptions_page_view.cc +++ b/chrome/browser/ui/views/options/exceptions_page_view.cc @@ -11,6 +11,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" #include "grit/generated_resources.h" +#include "ui/base/text/text_elider.h" #include "views/background.h" #include "views/controls/button/native_button.h" #include "views/grid_layout.h" @@ -55,7 +56,7 @@ void ExceptionsTableModel::OnPasswordStoreRequestDone( UTF8ToWide(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)); for (size_t i = 0; i < result.size(); ++i) { saved_signons_.push_back(new PasswordRow( - gfx::SortedDisplayURL(result[i]->origin, languages), result[i])); + ui::SortedDisplayURL(result[i]->origin, languages), result[i])); } if (observer_) observer_->OnModelChanged(); diff --git a/chrome/browser/ui/views/options/passwords_page_view.cc b/chrome/browser/ui/views/options/passwords_page_view.cc index 19cab6d..138a7b2 100644 --- a/chrome/browser/ui/views/options/passwords_page_view.cc +++ b/chrome/browser/ui/views/options/passwords_page_view.cc @@ -119,7 +119,7 @@ void PasswordsTableModel::OnPasswordStoreRequestDone( UTF8ToWide(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)); for (size_t i = 0; i < result.size(); ++i) { saved_signons_[i] = new PasswordRow( - gfx::SortedDisplayURL(result[i]->origin, languages), result[i]); + ui::SortedDisplayURL(result[i]->origin, languages), result[i]); } if (observer_) observer_->OnModelChanged(); diff --git a/chrome/browser/ui/views/options/passwords_page_view.h b/chrome/browser/ui/views/options/passwords_page_view.h index 36f0d3c..76eed4e 100644 --- a/chrome/browser/ui/views/options/passwords_page_view.h +++ b/chrome/browser/ui/views/options/passwords_page_view.h @@ -8,7 +8,6 @@ #include <vector> -#include "app/text_elider.h" #include "base/compiler_specific.h" #include "base/scoped_ptr.h" #include "base/stl_util-inl.h" @@ -18,6 +17,7 @@ #include "chrome/browser/ui/views/confirm_message_box_dialog.h" #include "chrome/browser/ui/views/options/options_page_view.h" #include "ui/base/models/table_model.h" +#include "ui/base/text/text_elider.h" #include "views/controls/button/native_button.h" #include "views/controls/label.h" #include "views/controls/table/table_view.h" @@ -102,13 +102,13 @@ class PasswordsTableModel : public TableModel, // Wraps the PasswordForm from the database and caches the display URL for // quick sorting. struct PasswordRow { - PasswordRow(const gfx::SortedDisplayURL& url, + PasswordRow(const ui::SortedDisplayURL& url, webkit_glue::PasswordForm* password_form) : display_url(url), form(password_form) { } // Contains the URL that is displayed along with the - gfx::SortedDisplayURL display_url; + ui::SortedDisplayURL display_url; // The underlying PasswordForm. We own this. scoped_ptr<webkit_glue::PasswordForm> form; diff --git a/chrome/browser/ui/views/repost_form_warning_view.cc b/chrome/browser/ui/views/repost_form_warning_view.cc index 1d0de64..ec83568 100644 --- a/chrome/browser/ui/views/repost_form_warning_view.cc +++ b/chrome/browser/ui/views/repost_form_warning_view.cc @@ -5,7 +5,6 @@ #include "chrome/browser/ui/views/repost_form_warning_view.h" #include "app/l10n_util.h" -#include "app/message_box_flags.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_window.h" @@ -13,6 +12,7 @@ #include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "grit/generated_resources.h" +#include "ui/base/message_box_flags.h" #include "views/controls/message_box_view.h" #include "views/window/window.h" @@ -35,7 +35,7 @@ RepostFormWarningView::RepostFormWarningView( : controller_(new RepostFormWarningController(tab_contents)), message_box_view_(NULL) { message_box_view_ = new MessageBoxView( - MessageBoxFlags::kIsConfirmMessageBox, + ui::MessageBoxFlags::kIsConfirmMessageBox, UTF16ToWide(l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING)), std::wstring()); controller_->Show(this); @@ -52,10 +52,10 @@ std::wstring RepostFormWarningView::GetWindowTitle() const { } std::wstring RepostFormWarningView::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { - if (button == MessageBoxFlags::DIALOGBUTTON_OK) + ui::MessageBoxFlags::DialogButton button) const { + if (button == ui::MessageBoxFlags::DIALOGBUTTON_OK) return UTF16ToWide(l10n_util::GetStringUTF16(IDS_HTTP_POST_WARNING_RESEND)); - if (button == MessageBoxFlags::DIALOGBUTTON_CANCEL) + if (button == ui::MessageBoxFlags::DIALOGBUTTON_CANCEL) return UTF16ToWide(l10n_util::GetStringUTF16(IDS_CANCEL)); return std::wstring(); } diff --git a/chrome/browser/ui/views/restart_message_box.cc b/chrome/browser/ui/views/restart_message_box.cc index 0ff60e7..e14dce3 100644 --- a/chrome/browser/ui/views/restart_message_box.cc +++ b/chrome/browser/ui/views/restart_message_box.cc @@ -5,10 +5,10 @@ #include "chrome/browser/ui/views/restart_message_box.h" #include "app/l10n_util.h" -#include "app/message_box_flags.h" #include "base/utf_string_conversions.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +#include "ui/base/message_box_flags.h" #include "views/controls/message_box_view.h" #include "views/window/window.h" @@ -22,12 +22,12 @@ void RestartMessageBox::ShowMessageBox(gfx::NativeWindow parent_window) { } int RestartMessageBox::GetDialogButtons() const { - return MessageBoxFlags::DIALOGBUTTON_OK; + return ui::MessageBoxFlags::DIALOGBUTTON_OK; } std::wstring RestartMessageBox::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { - DCHECK(button == MessageBoxFlags::DIALOGBUTTON_OK); + ui::MessageBoxFlags::DialogButton button) const { + DCHECK(button == ui::MessageBoxFlags::DIALOGBUTTON_OK); return UTF16ToWide(l10n_util::GetStringUTF16(IDS_OK)); } @@ -54,7 +54,8 @@ RestartMessageBox::RestartMessageBox(gfx::NativeWindow parent_window) { const int kDialogWidth = 400; // Also deleted when the window closes. message_box_view_ = new MessageBoxView( - MessageBoxFlags::kFlagHasMessage | MessageBoxFlags::kFlagHasOKButton, + ui::MessageBoxFlags::kFlagHasMessage | + ui::MessageBoxFlags::kFlagHasOKButton, UTF16ToWide( l10n_util::GetStringUTF16(IDS_OPTIONS_RESTART_REQUIRED)).c_str(), std::wstring(), diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc index 0e77b8d..027c0a3 100644 --- a/chrome/browser/ui/views/status_bubble_views.cc +++ b/chrome/browser/ui/views/status_bubble_views.cc @@ -7,7 +7,6 @@ #include <algorithm> #include "app/resource_bundle.h" -#include "app/text_elider.h" #include "base/i18n/rtl.h" #include "base/message_loop.h" #include "base/string_util.h" @@ -24,6 +23,7 @@ #include "third_party/skia/include/core/SkRect.h" #include "ui/base/animation/animation_delegate.h" #include "ui/base/animation/linear_animation.h" +#include "ui/base/text/text_elider.h" #include "views/controls/label.h" #include "views/controls/scrollbar/native_scroll_bar.h" #include "views/screen.h" @@ -73,7 +73,7 @@ class StatusBubbleViews::StatusView : public views::Label, public ui::AnimationDelegate { public: StatusView(StatusBubble* status_bubble, views::Widget* popup, - ThemeProvider* theme_provider) + ui::ThemeProvider* theme_provider) : ALLOW_THIS_IN_INITIALIZER_LIST(ui::LinearAnimation(kFramerate, this)), stage_(BUBBLE_HIDDEN), style_(STYLE_STANDARD), @@ -174,7 +174,7 @@ class StatusBubbleViews::StatusView : public views::Label, double opacity_end_; // Holds the theme provider of the frame that created us. - ThemeProvider* theme_provider_; + ui::ThemeProvider* theme_provider_; }; void StatusBubbleViews::StatusView::SetText(const string16& text, @@ -648,7 +648,7 @@ void StatusBubbleViews::SetURL(const GURL& url, const string16& languages) { popup_->GetBounds(&popup_bounds, true); int text_width = static_cast<int>(popup_bounds.width() - (kShadowThickness * 2) - kTextPositionX - kTextHorizPadding - 1); - url_text_ = gfx::ElideUrl(url, view_->Label::font(), + url_text_ = ui::ElideUrl(url, view_->Label::font(), text_width, UTF16ToWideHack(languages)); std::wstring original_url_text = @@ -803,7 +803,7 @@ void StatusBubbleViews::ExpandBubble() { gfx::Rect popup_bounds; popup_->GetBounds(&popup_bounds, true); int max_status_bubble_width = GetMaxStatusBubbleWidth(); - url_text_ = gfx::ElideUrl(url_, view_->Label::font(), + url_text_ = ui::ElideUrl(url_, view_->Label::font(), max_status_bubble_width, UTF16ToWideHack(languages_)); int expanded_bubble_width =std::max(GetStandardStatusBubbleWidth(), std::min(view_->Label::font().GetStringWidth(url_text_) + diff --git a/chrome/browser/ui/views/tab_icon_view.cc b/chrome/browser/ui/views/tab_icon_view.cc index 40b4ca2..7fb1560 100644 --- a/chrome/browser/ui/views/tab_icon_view.cc +++ b/chrome/browser/ui/views/tab_icon_view.cc @@ -10,7 +10,6 @@ #endif #include "app/resource_bundle.h" -#include "app/theme_provider.h" #include "base/file_util.h" #include "base/logging.h" #include "chrome/app/chrome_command_ids.h" @@ -18,6 +17,7 @@ #include "gfx/favicon_size.h" #include "grit/app_resources.h" #include "grit/theme_resources.h" +#include "ui/base/theme_provider.h" #if defined(OS_WIN) #include "chrome/browser/app_icon_win.h" diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc index 5e00eb9..ae745c5 100644 --- a/chrome/browser/ui/views/tabs/base_tab.cc +++ b/chrome/browser/ui/views/tabs/base_tab.cc @@ -8,7 +8,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/theme_provider.h" #include "base/command_line.h" #include "base/utf_string_conversions.h" #include "chrome/browser/tab_contents/tab_contents.h" @@ -24,6 +23,7 @@ #include "grit/theme_resources.h" #include "ui/base/animation/slide_animation.h" #include "ui/base/animation/throb_animation.h" +#include "ui/base/theme_provider.h" #include "views/controls/button/image_button.h" // How long the pulse throb takes. @@ -305,8 +305,8 @@ AccessibilityTypes::Role BaseTab::GetAccessibleRole() { return AccessibilityTypes::ROLE_PAGETAB; } -ThemeProvider* BaseTab::GetThemeProvider() { - ThemeProvider* tp = View::GetThemeProvider(); +ui::ThemeProvider* BaseTab::GetThemeProvider() { + ui::ThemeProvider* tp = View::GetThemeProvider(); return tp ? tp : theme_provider_; } @@ -359,7 +359,7 @@ void BaseTab::PaintIcon(gfx::Canvas* canvas, int x, int y) { favicon_x += (data().favicon.width() - kFavIconSize) / 2; if (data().network_state != TabRendererData::NETWORK_STATE_NONE) { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); SkBitmap frames(*tp->GetBitmapNamed( (data().network_state == TabRendererData::NETWORK_STATE_WAITING) ? IDR_THROBBER_WAITING : IDR_THROBBER)); diff --git a/chrome/browser/ui/views/tabs/base_tab.h b/chrome/browser/ui/views/tabs/base_tab.h index b4ce54d..ae362ad 100644 --- a/chrome/browser/ui/views/tabs/base_tab.h +++ b/chrome/browser/ui/views/tabs/base_tab.h @@ -72,7 +72,7 @@ class BaseTab : public ui::AnimationDelegate, // Set the theme provider - because we get detached, we are frequently // outside of a hierarchy with a theme provider at the top. This should be // called whenever we're detached or attached to a hierarchy. - void set_theme_provider(ThemeProvider* provider) { + void set_theme_provider(ui::ThemeProvider* provider) { theme_provider_ = provider; } @@ -191,7 +191,7 @@ class BaseTab : public ui::AnimationDelegate, // animations. bool throbber_disabled_; - ThemeProvider* theme_provider_; + ui::ThemeProvider* theme_provider_; // The offset used to animate the favicon location. This is used when the tab // crashes. diff --git a/chrome/browser/ui/views/tabs/base_tab_strip.h b/chrome/browser/ui/views/tabs/base_tab_strip.h index 4f5dc01..1fe7e3c 100644 --- a/chrome/browser/ui/views/tabs/base_tab_strip.h +++ b/chrome/browser/ui/views/tabs/base_tab_strip.h @@ -17,7 +17,6 @@ class BaseTab; class DraggedTabController; class TabStripController; -class ThemeProvider; // Base class for the view tab strip implementations. class BaseTabStrip : public views::View, diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc index e24478e..b751330 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc @@ -525,7 +525,7 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) { void Tab::PaintActiveTabBackground(gfx::Canvas* canvas) { int offset = GetX(views::View::APPLY_MIRRORING_TRANSFORMATION) + background_offset_.x(); - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); DCHECK(tp) << "Unable to get theme provider"; SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(IDR_THEME_TOOLBAR); diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 7145017..9c7ca46 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -498,7 +498,7 @@ void TabStrip::Init() { } void TabStrip::LoadNewTabButtonImage() { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); // If we don't have a theme provider yet, it means we do not have a // root view, and are therefore in a test. diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h index b15b86b..6b2ab25 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.h +++ b/chrome/browser/ui/views/tabs/tab_strip.h @@ -261,7 +261,7 @@ class TabStrip : public BaseTabStrip, // The size of the new tab button must be hardcoded because we need to be // able to lay it out before we are able to get its image from the - // ThemeProvider. It also makes sense to do this, because the size of the + // ui::ThemeProvider. It also makes sense to do this, because the size of the // new tab button should not need to be calculated dynamically. static const int kNewTabButtonWidth = 28; static const int kNewTabButtonHeight = 18; diff --git a/chrome/browser/ui/views/theme_background.cc b/chrome/browser/ui/views/theme_background.cc index be8e8f7..857731f 100644 --- a/chrome/browser/ui/views/theme_background.cc +++ b/chrome/browser/ui/views/theme_background.cc @@ -30,7 +30,7 @@ void ThemeBackground::Paint(gfx::Canvas* canvas, views::View* view) const { background = rb.GetBitmapNamed(IDR_THEME_FRAME_INACTIVE); } else { Profile* profile = browser_view_->browser()->profile(); - ThemeProvider* theme = profile->GetThemeProvider(); + ui::ThemeProvider* theme = profile->GetThemeProvider(); if (browser_view_->IsActive()) { background = theme->GetBitmapNamed( profile->IsOffTheRecord() ? diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index e396d37..8e82fc4 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -657,7 +657,7 @@ int ToolbarView::PopupTopSpacing() const { } void ToolbarView::LoadImages() { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); back_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_BACK)); back_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_BACK_H)); @@ -717,7 +717,7 @@ void ToolbarView::UpdateAppMenuBadge() { } SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); int id = 0; switch (state) { diff --git a/chrome/browser/ui/views/update_recommended_message_box.cc b/chrome/browser/ui/views/update_recommended_message_box.cc index c3f8f6a..d03eabb 100644 --- a/chrome/browser/ui/views/update_recommended_message_box.cc +++ b/chrome/browser/ui/views/update_recommended_message_box.cc @@ -5,7 +5,6 @@ #include "chrome/browser/ui/views/update_recommended_message_box.h" #include "app/l10n_util.h" -#include "app/message_box_flags.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" @@ -14,6 +13,7 @@ #include "chrome/common/pref_names.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +#include "ui/base/message_box_flags.h" #include "views/controls/message_box_view.h" #include "views/window/window.h" @@ -47,15 +47,15 @@ bool UpdateRecommendedMessageBox::Accept() { } int UpdateRecommendedMessageBox::GetDialogButtons() const { - return MessageBoxFlags::DIALOGBUTTON_OK | - MessageBoxFlags::DIALOGBUTTON_CANCEL; + return ui::MessageBoxFlags::DIALOGBUTTON_OK | + ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; } std::wstring UpdateRecommendedMessageBox::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { - DCHECK(button == MessageBoxFlags::DIALOGBUTTON_OK || - button == MessageBoxFlags::DIALOGBUTTON_CANCEL); - return button == MessageBoxFlags::DIALOGBUTTON_OK ? + ui::MessageBoxFlags::DialogButton button) const { + DCHECK(button == ui::MessageBoxFlags::DIALOGBUTTON_OK || + button == ui::MessageBoxFlags::DIALOGBUTTON_CANCEL); + return button == ui::MessageBoxFlags::DIALOGBUTTON_OK ? UTF16ToWide(l10n_util::GetStringUTF16(IDS_RESTART_AND_UPDATE)) : UTF16ToWide(l10n_util::GetStringUTF16(IDS_NOT_NOW)); } @@ -90,7 +90,8 @@ UpdateRecommendedMessageBox::UpdateRecommendedMessageBox( const string16 product_name = l10n_util::GetStringUTF16(kProductNameId); // Also deleted when the window closes. message_box_view_ = new MessageBoxView( - MessageBoxFlags::kFlagHasMessage | MessageBoxFlags::kFlagHasOKButton, + ui::MessageBoxFlags::kFlagHasMessage | + ui::MessageBoxFlags::kFlagHasOKButton, UTF16ToWide(l10n_util::GetStringFUTF16(IDS_UPDATE_RECOMMENDED, product_name)), std::wstring(), diff --git a/chrome/browser/ui/views/user_data_dir_dialog.cc b/chrome/browser/ui/views/user_data_dir_dialog.cc index e76415d..83fcf8a 100644 --- a/chrome/browser/ui/views/user_data_dir_dialog.cc +++ b/chrome/browser/ui/views/user_data_dir_dialog.cc @@ -3,12 +3,12 @@ // found in the LICENSE file. #include "app/l10n_util.h" -#include "app/message_box_flags.h" #include "base/logging.h" #include "base/utf_string_conversions.h" #include "chrome/browser/ui/views/user_data_dir_dialog.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +#include "ui/base/message_box_flags.h" #include "views/controls/message_box_view.h" #include "views/widget/widget.h" #include "views/window/window.h" @@ -30,7 +30,8 @@ UserDataDirDialog::UserDataDirDialog(const FilePath& user_data_dir) IDS_CANT_WRITE_USER_DIRECTORY_SUMMARY, WideToUTF16Hack(user_data_dir.ToWStringHack()))); const int kDialogWidth = 400; - message_box_view_ = new MessageBoxView(MessageBoxFlags::kIsConfirmMessageBox, + message_box_view_ = new MessageBoxView( + ui::MessageBoxFlags::kIsConfirmMessageBox, message_text.c_str(), std::wstring(), kDialogWidth); views::Window::CreateChromeWindow(NULL, gfx::Rect(), this)->Show(); @@ -41,13 +42,13 @@ UserDataDirDialog::~UserDataDirDialog() { } std::wstring UserDataDirDialog::GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { + ui::MessageBoxFlags::DialogButton button) const { switch (button) { - case MessageBoxFlags::DIALOGBUTTON_OK: + case ui::MessageBoxFlags::DIALOGBUTTON_OK: return UTF16ToWide(l10n_util::GetStringUTF16( IDS_CANT_WRITE_USER_DIRECTORY_CHOOSE_DIRECTORY_BUTTON)); - case MessageBoxFlags::DIALOGBUTTON_CANCEL: + case ui::MessageBoxFlags::DIALOGBUTTON_CANCEL: return UTF16ToWide(l10n_util::GetStringUTF16( IDS_CANT_WRITE_USER_DIRECTORY_EXIT_BUTTON)); default: diff --git a/chrome/browser/unload_uitest.cc b/chrome/browser/unload_uitest.cc index 251693c..f30ed16 100644 --- a/chrome/browser/unload_uitest.cc +++ b/chrome/browser/unload_uitest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/message_box_flags.h" #include "base/file_util.h" #include "base/test/test_timeouts.h" #include "chrome/browser/net/url_request_mock_http_job.h" @@ -13,6 +12,7 @@ #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" #include "net/url_request/url_request_unittest.h" +#include "ui/base/message_box_flags.h" #include "views/event.h" const std::string NOLISTENERS_HTML = @@ -165,9 +165,9 @@ class UnloadTest : public UITest { EXPECT_TRUE(CloseBrowser(browser.get(), &application_closed)); } - void ClickModalDialogButton(MessageBoxFlags::DialogButton button) { + void ClickModalDialogButton(ui::MessageBoxFlags::DialogButton button) { bool modal_dialog_showing = false; - MessageBoxFlags::DialogButton available_buttons; + ui::MessageBoxFlags::DialogButton available_buttons; EXPECT_TRUE(automation()->WaitForAppModalDialog()); EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &available_buttons)); @@ -300,7 +300,7 @@ TEST_F(UnloadTest, BrowserCloseBeforeUnloadOK) { NavigateToDataURL(BEFORE_UNLOAD_HTML, L"beforeunload"); CloseBrowserAsync(browser.get()); - ClickModalDialogButton(MessageBoxFlags::DIALOGBUTTON_OK); + ClickModalDialogButton(ui::MessageBoxFlags::DIALOGBUTTON_OK); WaitForBrowserClosed(); } @@ -312,14 +312,14 @@ TEST_F(UnloadTest, BrowserCloseBeforeUnloadCancel) { NavigateToDataURL(BEFORE_UNLOAD_HTML, L"beforeunload"); CloseBrowserAsync(browser.get()); - ClickModalDialogButton(MessageBoxFlags::DIALOGBUTTON_CANCEL); + ClickModalDialogButton(ui::MessageBoxFlags::DIALOGBUTTON_CANCEL); // There's no real graceful way to wait for something _not_ to happen, so // we just wait a short period. CrashAwareSleep(500); ASSERT_TRUE(IsBrowserRunning()); CloseBrowserAsync(browser.get()); - ClickModalDialogButton(MessageBoxFlags::DIALOGBUTTON_OK); + ClickModalDialogButton(ui::MessageBoxFlags::DIALOGBUTTON_OK); WaitForBrowserClosed(); } @@ -341,7 +341,7 @@ TEST_F(UnloadTest, MAYBE_BrowserCloseWithInnerFocusedFrame) { NavigateToDataURL(INNER_FRAME_WITH_FOCUS_HTML, L"innerframewithfocus"); CloseBrowserAsync(browser.get()); - ClickModalDialogButton(MessageBoxFlags::DIALOGBUTTON_OK); + ClickModalDialogButton(ui::MessageBoxFlags::DIALOGBUTTON_OK); WaitForBrowserClosed(); } diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc index 1400e4a..280a6a2 100644 --- a/chrome/plugin/plugin_thread.cc +++ b/chrome/plugin/plugin_thread.cc @@ -38,7 +38,7 @@ #endif #if defined(USE_X11) -#include "app/x11_util.h" +#include "ui/base/x/x11_util.h" #elif defined(OS_MACOSX) #include "app/l10n_util.h" #include "base/mac/mac_util.h" @@ -76,7 +76,7 @@ PluginThread::PluginThread() setenv("GDK_NATIVE_WINDOWS", "1", 1); } - x11_util::SetDefaultX11ErrorHandlers(); + ui::SetDefaultX11ErrorHandlers(); #endif PatchNPNFunctions(); diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index a7c6106..6448239 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -35,7 +35,7 @@ #endif #if defined(USE_X11) -#include "app/x11_util_internal.h" +#include "ui/base/x/x11_util_internal.h" #endif using WebKit::WebBindings; @@ -73,10 +73,9 @@ WebPluginProxy::WebPluginProxy( // If the X server supports SHM pixmaps // and the color depth and masks match, // then consider using SHM pixmaps for windowless plugin painting. - Display* display = x11_util::GetXDisplay(); - if (x11_util::QuerySharedMemorySupport(display) == - x11_util::SHARED_MEMORY_PIXMAP && - x11_util::BitsPerPixelForPixmapDepth( + Display* display = ui::GetXDisplay(); + if (ui::QuerySharedMemorySupport(display) == ui::SHARED_MEMORY_PIXMAP && + ui::BitsPerPixelForPixmapDepth( display, DefaultDepth(display, 0)) == 32) { Visual* vis = DefaultVisual(display, 0); @@ -94,7 +93,7 @@ WebPluginProxy::~WebPluginProxy() { #if defined(USE_X11) if (windowless_shm_pixmap_ != None) - XFreePixmap(x11_util::GetXDisplay(), windowless_shm_pixmap_); + XFreePixmap(ui::GetXDisplay(), windowless_shm_pixmap_); #endif #if defined(OS_MACOSX) @@ -618,8 +617,8 @@ void WebPluginProxy::SetWindowlessBuffer( // If SHM pixmaps support is available, create a SHM pixmap and // pass it to the delegate for windowless plugin painting. if (delegate_->IsWindowless() && use_shm_pixmap_ && windowless_dib_.get()) { - Display* display = x11_util::GetXDisplay(); - XID root_window = x11_util::GetX11RootWindow(); + Display* display = ui::GetXDisplay(); + XID root_window = ui::GetX11RootWindow(); XShmSegmentInfo shminfo = {0}; if (windowless_shm_pixmap_ != None) diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index 2a1f1aee..c5a0a1d 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -9,7 +9,7 @@ #include <string> #if defined(USE_X11) -#include "app/x11_util.h" +#include "ui/base/x/x11_util.h" #endif #include "app/surface/transport_dib.h" #include "base/hash_tables.h" diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index 1633aec..e903c88 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -10,7 +10,6 @@ #include <vector> #include "app/l10n_util.h" -#include "app/message_box_flags.h" #include "app/resource_bundle.h" #include "base/callback.h" #include "base/command_line.h" @@ -159,6 +158,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" #include "third_party/cld/encodings/compact_lang_det/win/cld_unicodetext.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/message_box_flags.h" #include "v8/include/v8.h" #include "v8/include/v8-testing.h" #include "webkit/appcache/web_application_cache_host_impl.h" @@ -2385,7 +2385,7 @@ bool RenderView::runFileChooser( void RenderView::runModalAlertDialog( WebFrame* frame, const WebString& message) { - RunJavaScriptMessage(MessageBoxFlags::kIsJavascriptAlert, + RunJavaScriptMessage(ui::MessageBoxFlags::kIsJavascriptAlert, UTF16ToWideHack(message), std::wstring(), frame->url(), @@ -2394,7 +2394,7 @@ void RenderView::runModalAlertDialog( bool RenderView::runModalConfirmDialog( WebFrame* frame, const WebString& message) { - return RunJavaScriptMessage(MessageBoxFlags::kIsJavascriptConfirm, + return RunJavaScriptMessage(ui::MessageBoxFlags::kIsJavascriptConfirm, UTF16ToWideHack(message), std::wstring(), frame->url(), @@ -2405,7 +2405,7 @@ bool RenderView::runModalPromptDialog( WebFrame* frame, const WebString& message, const WebString& default_value, WebString* actual_value) { std::wstring result; - bool ok = RunJavaScriptMessage(MessageBoxFlags::kIsJavascriptPrompt, + bool ok = RunJavaScriptMessage(ui::MessageBoxFlags::kIsJavascriptPrompt, UTF16ToWideHack(message), UTF16ToWideHack(default_value), frame->url(), diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index 18ddc3e..989c91a 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -284,7 +284,7 @@ bool AutomationProxy::WaitForWindowCountToBecome(int count) { bool AutomationProxy::GetShowingAppModalDialog( bool* showing_app_modal_dialog, - MessageBoxFlags::DialogButton* button) { + ui::MessageBoxFlags::DialogButton* button) { if (!showing_app_modal_dialog || !button) { NOTREACHED(); return false; @@ -297,12 +297,12 @@ bool AutomationProxy::GetShowingAppModalDialog( return false; } - *button = static_cast<MessageBoxFlags::DialogButton>(button_int); + *button = static_cast<ui::MessageBoxFlags::DialogButton>(button_int); return true; } bool AutomationProxy::ClickAppModalDialogButton( - MessageBoxFlags::DialogButton button) { + ui::MessageBoxFlags::DialogButton button) { bool succeeded = false; if (!Send(new AutomationMsg_ClickAppModalDialogButton( diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h index d1dcf19..323538c 100644 --- a/chrome/test/automation/automation_proxy.h +++ b/chrome/test/automation/automation_proxy.h @@ -9,7 +9,6 @@ #include <string> #include <vector> -#include "app/message_box_flags.h" #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/threading/platform_thread.h" @@ -27,6 +26,7 @@ #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_message.h" #include "ipc/ipc_sync_channel.h" +#include "ui/base/message_box_flags.h" class BrowserProxy; class ExtensionProxy; @@ -123,11 +123,11 @@ class AutomationProxy : public IPC::Channel::Listener, // Returns whether an app modal dialog window is showing right now (i.e., a // javascript alert), and what buttons it contains. bool GetShowingAppModalDialog(bool* showing_app_modal_dialog, - MessageBoxFlags::DialogButton* button) WARN_UNUSED_RESULT; + ui::MessageBoxFlags::DialogButton* button) WARN_UNUSED_RESULT; // Simulates a click on a dialog button. Synchronous. bool ClickAppModalDialogButton( - MessageBoxFlags::DialogButton button) WARN_UNUSED_RESULT; + ui::MessageBoxFlags::DialogButton button) WARN_UNUSED_RESULT; // Block the thread until a modal dialog is displayed. Returns true on // success. diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc index fcee17f..e6db497 100644 --- a/chrome/test/automation/automation_proxy_uitest.cc +++ b/chrome/test/automation/automation_proxy_uitest.cc @@ -5,7 +5,6 @@ #include <string> #include "app/app_switches.h" -#include "app/message_box_flags.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/file_path.h" @@ -42,6 +41,7 @@ #define GMOCK_MUTANT_INCLUDE_LATE_OBJECT_BINDING #include "testing/gmock_mutant.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/message_box_flags.h" #include "views/event.h" using ui_test_utils::TimedMessageLoopRunner; @@ -1455,11 +1455,12 @@ TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) { ASSERT_TRUE(tab.get()); bool modal_dialog_showing = false; - MessageBoxFlags::DialogButton button = MessageBoxFlags::DIALOGBUTTON_NONE; + ui::MessageBoxFlags::DialogButton button = + ui::MessageBoxFlags::DIALOGBUTTON_NONE; EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &button)); EXPECT_FALSE(modal_dialog_showing); - EXPECT_EQ(MessageBoxFlags::DIALOGBUTTON_NONE, button); + EXPECT_EQ(ui::MessageBoxFlags::DIALOGBUTTON_NONE, button); // Show a simple alert. std::string content = @@ -1472,19 +1473,19 @@ TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) { EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &button)); EXPECT_TRUE(modal_dialog_showing); - EXPECT_EQ(MessageBoxFlags::DIALOGBUTTON_OK, button); + EXPECT_EQ(ui::MessageBoxFlags::DIALOGBUTTON_OK, button); // Test that clicking missing button fails graciously and does not close the // dialog. EXPECT_FALSE(automation()->ClickAppModalDialogButton( - MessageBoxFlags::DIALOGBUTTON_CANCEL)); + ui::MessageBoxFlags::DIALOGBUTTON_CANCEL)); EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &button)); EXPECT_TRUE(modal_dialog_showing); // Now click OK, that should close the dialog. EXPECT_TRUE(automation()->ClickAppModalDialogButton( - MessageBoxFlags::DIALOGBUTTON_OK)); + ui::MessageBoxFlags::DIALOGBUTTON_OK)); EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &button)); EXPECT_FALSE(modal_dialog_showing); @@ -1500,12 +1501,12 @@ TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) { EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &button)); EXPECT_TRUE(modal_dialog_showing); - EXPECT_EQ(MessageBoxFlags::DIALOGBUTTON_OK | - MessageBoxFlags::DIALOGBUTTON_CANCEL, button); + EXPECT_EQ(ui::MessageBoxFlags::DIALOGBUTTON_OK | + ui::MessageBoxFlags::DIALOGBUTTON_CANCEL, button); // Click OK. EXPECT_TRUE(automation()->ClickAppModalDialogButton( - MessageBoxFlags::DIALOGBUTTON_OK)); + ui::MessageBoxFlags::DIALOGBUTTON_OK)); EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &button)); EXPECT_FALSE(modal_dialog_showing); @@ -1521,12 +1522,12 @@ TEST_F(AutomationProxyTest, FLAKY_AppModalDialogTest) { EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &button)); EXPECT_TRUE(modal_dialog_showing); - EXPECT_EQ(MessageBoxFlags::DIALOGBUTTON_OK | - MessageBoxFlags::DIALOGBUTTON_CANCEL, button); + EXPECT_EQ(ui::MessageBoxFlags::DIALOGBUTTON_OK | + ui::MessageBoxFlags::DIALOGBUTTON_CANCEL, button); // Click Cancel this time. EXPECT_TRUE(automation()->ClickAppModalDialogButton( - MessageBoxFlags::DIALOGBUTTON_CANCEL)); + ui::MessageBoxFlags::DIALOGBUTTON_CANCEL)); EXPECT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &button)); EXPECT_FALSE(modal_dialog_showing); diff --git a/chrome/test/interactive_ui/fast_shutdown_interactive_uitest.cc b/chrome/test/interactive_ui/fast_shutdown_interactive_uitest.cc index fb617a5..da3d527 100644 --- a/chrome/test/interactive_ui/fast_shutdown_interactive_uitest.cc +++ b/chrome/test/interactive_ui/fast_shutdown_interactive_uitest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/message_box_flags.h" #include "base/file_path.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/ui/view_ids.h" @@ -13,6 +12,7 @@ #include "chrome/test/ui/ui_test.h" #include "chrome/test/ui_test_utils.h" #include "gfx/rect.h" +#include "ui/base/message_box_flags.h" #include "views/event.h" class FastShutdown : public UITest { @@ -53,7 +53,7 @@ TEST_F(FastShutdown, MAYBE_SlowTermination) { ASSERT_TRUE(browser->ApplyAccelerator(IDC_CLOSE_WINDOW)); ASSERT_TRUE(automation()->WaitForAppModalDialog()); ASSERT_TRUE(automation()->ClickAppModalDialogButton( - MessageBoxFlags::DIALOGBUTTON_OK)); + ui::MessageBoxFlags::DIALOGBUTTON_OK)); ASSERT_TRUE(WaitForBrowserProcessToQuit( TestTimeouts::wait_for_terminate_timeout_ms())); } diff --git a/chrome/test/render_view_test.cc b/chrome/test/render_view_test.cc index 5788eba..3a95cbb 100644 --- a/chrome/test/render_view_test.cc +++ b/chrome/test/render_view_test.cc @@ -29,7 +29,7 @@ #include "webkit/glue/webkit_glue.h" #if defined(OS_LINUX) -#include "app/event_synthesis_gtk.h" +#include "ui/base/gtk/event_synthesis_gtk.h" #endif using WebKit::WebFrame; @@ -213,7 +213,7 @@ int RenderViewTest::SendKeyEvent(MockKeyboard::Layout layout, // We ignore |layout|, which means we are only testing the layout of the // current locale. TODO(estade): fix this to respect |layout|. std::vector<GdkEvent*> events; - app::SynthesizeKeyPressEvents( + ui::SynthesizeKeyPressEvents( NULL, static_cast<ui::KeyboardCode>(key_code), modifiers & (MockKeyboard::LEFT_CONTROL | MockKeyboard::RIGHT_CONTROL), modifiers & (MockKeyboard::LEFT_SHIFT | MockKeyboard::RIGHT_SHIFT), diff --git a/chrome/test/ui/npapi_uitest.cc b/chrome/test/ui/npapi_uitest.cc index 9bdc0c2..be0a7c9 100644 --- a/chrome/test/ui/npapi_uitest.cc +++ b/chrome/test/ui/npapi_uitest.cc @@ -174,23 +174,23 @@ TEST_F(NPAPIVisiblePluginTester, AlertInWindowMessage) { ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); bool modal_dialog_showing = false; - MessageBoxFlags::DialogButton available_buttons; + ui::MessageBoxFlags::DialogButton available_buttons; ASSERT_TRUE(automation()->WaitForAppModalDialog()); ASSERT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &available_buttons)); ASSERT_TRUE(modal_dialog_showing); - ASSERT_NE((MessageBoxFlags::DIALOGBUTTON_OK & available_buttons), 0); + ASSERT_NE((ui::MessageBoxFlags::DIALOGBUTTON_OK & available_buttons), 0); ASSERT_TRUE(automation()->ClickAppModalDialogButton( - MessageBoxFlags::DIALOGBUTTON_OK)); + ui::MessageBoxFlags::DIALOGBUTTON_OK)); modal_dialog_showing = false; ASSERT_TRUE(automation()->WaitForAppModalDialog()); ASSERT_TRUE(automation()->GetShowingAppModalDialog(&modal_dialog_showing, &available_buttons)); ASSERT_TRUE(modal_dialog_showing); - ASSERT_NE((MessageBoxFlags::DIALOGBUTTON_OK & available_buttons), 0); + ASSERT_NE((ui::MessageBoxFlags::DIALOGBUTTON_OK & available_buttons), 0); ASSERT_TRUE(automation()->ClickAppModalDialogButton( - MessageBoxFlags::DIALOGBUTTON_OK)); + ui::MessageBoxFlags::DIALOGBUTTON_OK)); } TEST_F(NPAPIVisiblePluginTester, VerifyNPObjectLifetimeTest) { diff --git a/printing/DEPS b/printing/DEPS index cfb3f60..1144038 100644 --- a/printing/DEPS +++ b/printing/DEPS @@ -1,7 +1,7 @@ include_rules = [ - "+app/gfx", # Font's are here. "+app", # win_util::FormatSystemTime/Date. "+base", "+gfx", "+skia/ext", + "+ui/base/text", ] diff --git a/printing/page_overlays.cc b/printing/page_overlays.cc index eb0c2a6..f6a7c28 100644 --- a/printing/page_overlays.cc +++ b/printing/page_overlays.cc @@ -4,7 +4,6 @@ #include "printing/page_overlays.h" -#include "app/text_elider.h" #include "base/logging.h" #include "base/string_number_conversions.h" #include "base/string_util.h" @@ -192,7 +191,7 @@ std::wstring PageOverlays::ReplaceVariables(const std::wstring& input, } else if (0 == output.compare(offset, wcslen(kUrl), kUrl)) { - // TODO(maruel): http://b/1126373 gfx::ElideUrl(document.url(), ...) + // TODO(maruel): http://b/1126373 ui::ElideUrl(document.url(), ...) offset = ReplaceKey(&output, offset, wcslen(kUrl), diff --git a/printing/printed_document.cc b/printing/printed_document.cc index 5993b3d..f50bf83 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc @@ -9,7 +9,6 @@ #include <string> #include <vector> -#include "app/text_elider.h" #include "base/file_path.h" #include "base/file_util.h" #include "base/i18n/file_util_icu.h" @@ -25,6 +24,7 @@ #include "printing/printed_page.h" #include "printing/units.h" #include "skia/ext/platform_device.h" +#include "ui/base/text/text_elider.h" namespace { @@ -225,10 +225,10 @@ void PrintedDocument::PrintHeaderFooter(gfx::NativeDrawingContext context, if (string_size.width() > bounding.width()) { if (line == PageOverlays::kUrl) { - output = UTF16ToWideHack(gfx::ElideUrl(url(), font, bounding.width(), - std::wstring())); + output = UTF16ToWideHack(ui::ElideUrl(url(), font, bounding.width(), + std::wstring())); } else { - output = UTF16ToWideHack(gfx::ElideText(WideToUTF16Hack(output), + output = UTF16ToWideHack(ui::ElideText(WideToUTF16Hack(output), font, bounding.width(), false)); } } diff --git a/app/event_synthesis_gtk.cc b/ui/base/gtk/event_synthesis_gtk.cc index 72dd7b9..bd3cb8a 100644 --- a/app/event_synthesis_gtk.cc +++ b/ui/base/gtk/event_synthesis_gtk.cc @@ -1,12 +1,12 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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 "app/event_synthesis_gtk.h" +#include "ui/base/gtk/event_synthesis_gtk.h" #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" -namespace app { +namespace ui { GdkEvent* SynthesizeKeyEvent(GdkWindow* window, bool press, guint gdk_key, guint state) { @@ -39,7 +39,7 @@ GdkEvent* SynthesizeKeyEvent(GdkWindow* window, } void SynthesizeKeyPressEvents(GdkWindow* window, - ui::KeyboardCode key, + KeyboardCode key, bool control, bool shift, bool alt, std::vector<GdkEvent*>* events) { if (control) @@ -87,4 +87,4 @@ void SynthesizeKeyPressEvents(GdkWindow* window, } } -} // namespace app +} // namespace ui diff --git a/app/event_synthesis_gtk.h b/ui/base/gtk/event_synthesis_gtk.h index 3ee1cb3..9ffdf40 100644 --- a/app/event_synthesis_gtk.h +++ b/ui/base/gtk/event_synthesis_gtk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. // @@ -6,8 +6,8 @@ // only keyboard events). This is useful for a variety of testing purposes. // NOTE: This should not be used outside of testing. -#ifndef APP_EVENT_SYNTHESIS_GTK_ -#define APP_EVENT_SYNTHESIS_GTK_ +#ifndef UI_BASE_GTK_EVENT_SYNTHESIS_GTK_ +#define UI_BASE_GTK_EVENT_SYNTHESIS_GTK_ #pragma once #include <gdk/gdk.h> @@ -16,7 +16,7 @@ #include "ui/base/keycodes/keyboard_codes.h" -namespace app { +namespace ui { // Creates and returns a key event. Passes ownership to the caller. GdkEvent* SynthesizeKeyEvent(GdkWindow* event_window, @@ -28,10 +28,10 @@ GdkEvent* SynthesizeKeyEvent(GdkWindow* event_window, // Ownership of the events in the vector is passed to the caller. void SynthesizeKeyPressEvents( GdkWindow* window, - ui::KeyboardCode key, + KeyboardCode key, bool control, bool shift, bool alt, std::vector<GdkEvent*>* events); -} // namespace app +} // namespace ui -#endif // APP_EVENT_SYNTHESIS_GTK_ +#endif // UI_BASE_GTK_EVENT_SYNTHESIS_GTK_ diff --git a/app/gtk_integers.h b/ui/base/gtk/gtk_integers.h index 6bc6013..41eeb93 100644 --- a/app/gtk_integers.h +++ b/ui/base/gtk/gtk_integers.h @@ -1,9 +1,9 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_GTK_INTEGERS_H_ -#define APP_GTK_INTEGERS_H_ +#ifndef UI_BASE_GTK_GTK_INTEGERS_H_ +#define UI_BASE_GTK_GTK_INTEGERS_H_ #pragma once // GLib/Gobject/Gtk all use their own integer typedefs. They are copied here @@ -25,4 +25,4 @@ typedef unsigned int guint32; typedef void* gpointer; typedef const void *gconstpointer; -#endif // APP_GTK_INTEGERS_H_ +#endif // UI_BASE_GTK_GTK_INTEGERS_H_ diff --git a/app/gtk_signal.h b/ui/base/gtk/gtk_signal.h index 5d3defe..64d59d6 100644 --- a/app/gtk_signal.h +++ b/ui/base/gtk/gtk_signal.h @@ -1,9 +1,9 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_GTK_SIGNAL_H_ -#define APP_GTK_SIGNAL_H_ +#ifndef UI_BASE_GTK_GTK_SIGNAL_H_ +#define UI_BASE_GTK_GTK_SIGNAL_H_ #pragma once typedef void* gpointer; @@ -114,4 +114,4 @@ typedef struct _GtkWidget GtkWidget; CHROMEG_CALLBACK_6(CLASS, RETURN, METHOD, GtkWidget*, ARG1, ARG2, ARG3, \ ARG4, ARG5, ARG6); -#endif // APP_GTK_SIGNAL_H_ +#endif // UI_BASE_GTK_GTK_SIGNAL_H_ diff --git a/app/gtk_signal_registrar.cc b/ui/base/gtk/gtk_signal_registrar.cc index 5530405..c6b170f 100644 --- a/app/gtk_signal_registrar.cc +++ b/ui/base/gtk/gtk_signal_registrar.cc @@ -1,13 +1,15 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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 "app/gtk_signal_registrar.h" +#include "ui/base/gtk/gtk_signal_registrar.h" #include <glib-object.h> #include "base/logging.h" +namespace ui { + GtkSignalRegistrar::GtkSignalRegistrar() { } @@ -72,3 +74,5 @@ void GtkSignalRegistrar::WeakNotify(GObject* where_the_object_was) { // handler id list. handler_lists_.erase(iter); } + +} // namespace ui diff --git a/app/gtk_signal_registrar.h b/ui/base/gtk/gtk_signal_registrar.h index 65e0917..b7e4e2f 100644 --- a/app/gtk_signal_registrar.h +++ b/ui/base/gtk/gtk_signal_registrar.h @@ -1,9 +1,9 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_GTK_SIGNAL_REGISTRAR_H_ -#define APP_GTK_SIGNAL_REGISTRAR_H_ +#ifndef UI_BASE_GTK_GTK_SIGNAL_REGISTRAR_H_ +#define UI_BASE_GTK_GTK_SIGNAL_REGISTRAR_H_ #pragma once #include <glib.h> @@ -16,6 +16,8 @@ typedef void (*GCallback) (void); typedef struct _GObject GObject; typedef struct _GtkWidget GtkWidget; +namespace ui { + // A class that ensures that callbacks don't run on stale owner objects. Similar // in spirit to NotificationRegistrar. Use as follows: // @@ -65,4 +67,6 @@ class GtkSignalRegistrar { DISALLOW_COPY_AND_ASSIGN(GtkSignalRegistrar); }; -#endif // APP_GTK_SIGNAL_REGISTRAR_H_ +} // namespace ui + +#endif // UI_BASE_GTK_GTK_SIGNAL_REGISTRAR_H_ diff --git a/app/scoped_handle_gtk.h b/ui/base/gtk/scoped_handle_gtk.h index 95b1cd5..4ee4ec6 100644 --- a/app/scoped_handle_gtk.h +++ b/ui/base/gtk/scoped_handle_gtk.h @@ -1,13 +1,15 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_SCOPED_HANDLE_GTK_H_ -#define APP_SCOPED_HANDLE_GTK_H_ +#ifndef UI_BASE_GTK_SCOPED_HANDLE_GTK_H_ +#define UI_BASE_GTK_SCOPED_HANDLE_GTK_H_ #pragma once #include <gdk/gdk.h> +namespace ui { + // Wraps a GdkRegion. This class provides the same methods as ScopedGDIObject in // scoped_handle_win. class ScopedRegion { @@ -48,4 +50,6 @@ class ScopedRegion { DISALLOW_COPY_AND_ASSIGN(ScopedRegion); }; -#endif // APP_SCOPED_HANDLE_GTK_H_ +} // namespace ui + +#endif // UI_BASE_GTK_SCOPED_HANDLE_GTK_H_ diff --git a/app/gfx/font_util.cc b/ui/base/l10n/l10n_font_util.cc index a977f57..19f058f 100644 --- a/app/gfx/font_util.cc +++ b/ui/base/l10n/l10n_font_util.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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 "app/gfx/font_util.h" +#include "ui/base/l10n/l10n_font_util.h" #include "app/l10n_util.h" #include "base/logging.h" @@ -10,7 +10,7 @@ #include "base/utf_string_conversions.h" #include "gfx/font.h" -namespace gfx { +namespace ui { int GetLocalizedContentsWidthForFont(int col_resource_id, const gfx::Font& font) { @@ -37,4 +37,4 @@ gfx::Size GetLocalizedContentsSizeForFont(int col_resource_id, GetLocalizedContentsHeightForFont(row_resource_id, font)); } -} // namespace gfx +} // namespace ui diff --git a/app/gfx/font_util.h b/ui/base/l10n/l10n_font_util.h index c7c3e97..eca17ee 100644 --- a/app/gfx/font_util.h +++ b/ui/base/l10n/l10n_font_util.h @@ -1,16 +1,18 @@ -// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_GFX_FONT_UTIL_H_ -#define APP_GFX_FONT_UTIL_H_ +#ifndef UI_BASE_L10N_FONT_UTIL_H_ +#define UI_BASE_L10N_FONT_UTIL_H_ #pragma once #include "gfx/size.h" namespace gfx { - class Font; +} + +namespace ui { // Returns the preferred size of the contents view of a window based on // its localized size data and the given font. The width in cols is held in a @@ -24,7 +26,6 @@ gfx::Size GetLocalizedContentsSizeForFont(int col_resource_id, int row_resource_id, const gfx::Font& font); -} // namespace gfx - -#endif // APP_GFX_FONT_UTIL_H_ +} // namespace ui +#endif // UI_BASE_L10N_FONT_UTIL_H_ diff --git a/app/message_box_flags.h b/ui/base/message_box_flags.h index 25816e9..d3cd569 100644 --- a/app/message_box_flags.h +++ b/ui/base/message_box_flags.h @@ -1,13 +1,15 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_MESSAGE_BOX_FLAGS_H_ -#define APP_MESSAGE_BOX_FLAGS_H_ +#ifndef UI_BASE_MESSAGE_BOX_FLAGS_H_ +#define UI_BASE_MESSAGE_BOX_FLAGS_H_ #pragma once #include "base/basictypes.h" +namespace ui { + // This class contains flags used to communicate the type of message box // to show. E.g., the renderer can request the browser to show a // javascript alert or a javascript confirm message. @@ -55,4 +57,6 @@ class MessageBoxFlags { DISALLOW_COPY_AND_ASSIGN(MessageBoxFlags); }; -#endif // APP_MESSAGE_BOX_FLAGS_H_ +} // namespace ui + +#endif // UI_BASE_MESSAGE_BOX_FLAGS_H_ diff --git a/app/text_elider.cc b/ui/base/text/text_elider.cc index 77ad958..8a262fd 100644 --- a/app/text_elider.cc +++ b/ui/base/text/text_elider.cc @@ -4,7 +4,8 @@ #include <vector> -#include "app/text_elider.h" +#include "ui/base/text/text_elider.h" + #include "base/file_path.h" #include "base/i18n/break_iterator.h" #include "base/i18n/char_iterator.h" @@ -19,6 +20,8 @@ #include "net/base/net_util.h" #include "net/base/registry_controlled_domain.h" +namespace ui { + namespace { const char* kEllipsis = "\xE2\x80\xA6"; @@ -46,8 +49,6 @@ string16 CutString(const string16& text, } // namespace -namespace gfx { - // This function takes a GURL object and elides it. It returns a string // which composed of parts from subdomain, domain, path, filename and query. // A "..." is added automatically at the end if the elided string is bigger @@ -497,7 +498,7 @@ bool ElideString(const std::wstring& input, int max_len, std::wstring* output) { return true; } -} // namespace gfx +} // namespace ui namespace { @@ -651,7 +652,7 @@ void RectangleString::NewLine() { } // namespace -namespace gfx { +namespace ui { bool ElideRectangleString(const string16& input, size_t max_rows, size_t max_cols, string16* output) { @@ -661,5 +662,4 @@ bool ElideRectangleString(const string16& input, size_t max_rows, return rect.Finalize(); } -} // namespace gfx - +} // namespace ui diff --git a/app/text_elider.h b/ui/base/text/text_elider.h index d6da860..97b9542 100644 --- a/app/text_elider.h +++ b/ui/base/text/text_elider.h @@ -1,9 +1,9 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_TEXT_ELIDER_H_ -#define APP_TEXT_ELIDER_H_ +#ifndef UI_BASE_TEXT_TEXT_ELIDER_H_ +#define UI_BASE_TEXT_TEXT_ELIDER_H_ #pragma once #include <unicode/coll.h> @@ -17,7 +17,7 @@ class FilePath; class GURL; // TODO(port): this file should deal in string16s rather than wstrings. -namespace gfx { +namespace ui { // This function takes a GURL object and elides it. It returns a string // which composed of parts from subdomain, domain, path, filename and query. @@ -114,6 +114,6 @@ bool ElideRectangleString(const string16& input, size_t max_rows, size_t max_cols, string16* output); -} // namespace gfx. +} // namespace ui -#endif // APP_TEXT_ELIDER_H_ +#endif // UI_BASE_TEXT_TEXT_ELIDER_H_ diff --git a/app/text_elider_unittest.cc b/ui/base/text/text_elider_unittest.cc index 7d0cbda..0889d27 100644 --- a/app/text_elider_unittest.cc +++ b/ui/base/text/text_elider_unittest.cc @@ -1,8 +1,7 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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 "app/text_elider.h" #include "base/file_path.h" #include "base/i18n/rtl.h" #include "base/scoped_ptr.h" @@ -11,6 +10,9 @@ #include "gfx/font.h" #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/text/text_elider.h" + +namespace ui { namespace { @@ -253,7 +255,7 @@ TEST(TextEliderTest, ElideTextLongStrings) { // Verifies display_url is set correctly. TEST(TextEliderTest, SortedDisplayURL) { - gfx::SortedDisplayURL d_url(GURL("http://www.google.com"), std::wstring()); + ui::SortedDisplayURL d_url(GURL("http://www.google.com"), std::wstring()); EXPECT_EQ("www.google.com", UTF16ToASCII(d_url.display_url())); } @@ -288,8 +290,8 @@ TEST(TextEliderTest, SortedDisplayURLCompare) { }; for (size_t i = 0; i < arraysize(tests); ++i) { - gfx::SortedDisplayURL url1(GURL(tests[i].a), std::wstring()); - gfx::SortedDisplayURL url2(GURL(tests[i].b), std::wstring()); + ui::SortedDisplayURL url1(GURL(tests[i].a), std::wstring()); + ui::SortedDisplayURL url2(GURL(tests[i].b), std::wstring()); EXPECT_EQ(tests[i].compare_result, url1.Compare(url2, collator.get())); EXPECT_EQ(-tests[i].compare_result, url2.Compare(url1, collator.get())); } @@ -317,7 +319,7 @@ TEST(TextEliderTest, ElideString) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { std::wstring output; EXPECT_EQ(cases[i].result, - gfx::ElideString(cases[i].input, cases[i].max_len, &output)); + ui::ElideString(cases[i].input, cases[i].max_len, &output)); EXPECT_EQ(cases[i].output, output); } } @@ -398,9 +400,9 @@ TEST(TextEliderTest, ElideRectangleString) { string16 output; for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) { EXPECT_EQ(cases[i].result, - gfx::ElideRectangleString(WideToUTF16(cases[i].input), - cases[i].max_rows, cases[i].max_cols, - &output)); + ui::ElideRectangleString(WideToUTF16(cases[i].input), + cases[i].max_rows, cases[i].max_cols, + &output)); EXPECT_EQ(cases[i].output, UTF16ToWide(output)); } } @@ -418,9 +420,9 @@ TEST(TextEliderTest, ElideRectangleWide16) { L"\x03a0\x03b1\x03b3\x03ba\x03cc\x03c3\x03bc\x03b9\x03bf\x03c2\x0020\n" L"\x0399\x03c3\x03c4\x03cc\x03c2")); string16 output; - EXPECT_TRUE(gfx::ElideRectangleString(str, 2, 4, &output)); + EXPECT_TRUE(ui::ElideRectangleString(str, 2, 4, &output)); EXPECT_EQ(out1, output); - EXPECT_FALSE(gfx::ElideRectangleString(str, 2, 12, &output)); + EXPECT_FALSE(ui::ElideRectangleString(str, 2, 12, &output)); EXPECT_EQ(out2, output); } @@ -433,7 +435,8 @@ TEST(TextEliderTest, ElideRectangleWide32) { "\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C\xF0\x9D\x92\x9C\n" "\xF0\x9D\x92\x9C \naaa\n...")); string16 output; - EXPECT_TRUE(gfx::ElideRectangleString(str, 3, 3, &output)); + EXPECT_TRUE(ui::ElideRectangleString(str, 3, 3, &output)); EXPECT_EQ(out, output); } +} // namespace ui diff --git a/app/theme_provider.cc b/ui/base/theme_provider.cc index 7593e15..a32c7aa 100644 --- a/app/theme_provider.cc +++ b/ui/base/theme_provider.cc @@ -1,8 +1,10 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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 "app/theme_provider.h" +#include "ui/base/theme_provider.h" + +namespace ui { // We have the destructor here because GCC puts the vtable in the first file // that includes a virtual function of the class. Leaving it just in the .h file @@ -10,3 +12,5 @@ ThemeProvider::~ThemeProvider() { } + +} // namespace ui diff --git a/app/theme_provider.h b/ui/base/theme_provider.h index 3d92e4d..43aa28f 100644 --- a/app/theme_provider.h +++ b/ui/base/theme_provider.h @@ -1,9 +1,9 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_THEME_PROVIDER_H_ -#define APP_THEME_PROVIDER_H_ +#ifndef UI_BASE_THEME_PROVIDER_H_ +#define UI_BASE_THEME_PROVIDER_H_ #pragma once #include "base/basictypes.h" @@ -28,6 +28,8 @@ class Profile; class RefCountedMemory; class SkBitmap; +namespace ui { + //////////////////////////////////////////////////////////////////////////////// // // ThemeProvider @@ -41,6 +43,7 @@ class ThemeProvider { public: virtual ~ThemeProvider(); + // TODO(beng): This dependency is horrible! // Initialize the provider with the passed in profile. virtual void Init(Profile* profile) = 0; @@ -112,4 +115,6 @@ class ThemeProvider { #endif }; -#endif // APP_THEME_PROVIDER_H_ +} // namespace ui + +#endif // UI_BASE_THEME_PROVIDER_H_ diff --git a/app/view_prop.cc b/ui/base/view_prop.cc index d71b95c..119228f 100644 --- a/app/view_prop.cc +++ b/ui/base/view_prop.cc @@ -1,12 +1,12 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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 "app/view_prop.h" +#include "ui/base/view_prop.h" #include <set> -namespace app { +namespace ui { // Maints the actual view, key and data. class ViewProp::Data : public base::RefCounted<ViewProp::Data> { @@ -100,4 +100,4 @@ const char* ViewProp::Key() const { return data_->key(); } -} // namespace app +} // namespace ui diff --git a/app/view_prop.h b/ui/base/view_prop.h index c319460..339ef7b 100644 --- a/app/view_prop.h +++ b/ui/base/view_prop.h @@ -1,16 +1,16 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_VIEW_PROP_H_ -#define APP_VIEW_PROP_H_ +#ifndef UI_BASE_VIEW_PROP_H_ +#define UI_BASE_VIEW_PROP_H_ #pragma once #include "base/basictypes.h" #include "base/ref_counted.h" #include "gfx/native_widget_types.h" -namespace app { +namespace ui { // ViewProp maintains a key/value pair for a particular view. ViewProp is // designed as a replacement for the Win32's SetProp, but does not make use of @@ -42,6 +42,6 @@ class ViewProp { DISALLOW_COPY_AND_ASSIGN(ViewProp); }; -} // namespace app +} // namespace ui -#endif // APP_VIEW_PROP_H_ +#endif // UI_BASE_VIEW_PROP_H_ diff --git a/app/view_prop_unittest.cc b/ui/base/view_prop_unittest.cc index 9b81cd5..686099f 100644 --- a/app/view_prop_unittest.cc +++ b/ui/base/view_prop_unittest.cc @@ -1,18 +1,20 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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 "testing/gtest/include/gtest/gtest.h" -#include "app/view_prop.h" #include "base/scoped_ptr.h" +#include "ui/base/view_prop.h" + +namespace ui { typedef testing::Test ViewPropTest; static const char* kKey1 = "key_1"; static const char* kKey2 = "key_2"; -using app::ViewProp; +using ui::ViewProp; // Test a handful of viewprop assertions. TEST_F(ViewPropTest, Basic) { @@ -68,3 +70,5 @@ TEST_F(ViewPropTest, Basic) { EXPECT_EQ(NULL, ViewProp::GetValue(nv2, kKey2)); } } + +} // namespace ui diff --git a/app/active_window_watcher_x.cc b/ui/base/x/active_window_watcher_x.cc index 65749648..97e0466 100644 --- a/app/active_window_watcher_x.cc +++ b/ui/base/x/active_window_watcher_x.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -6,7 +6,9 @@ #include <gdk/gdk.h> #include <gdk/gdkx.h> -#include "app/active_window_watcher_x.h" +#include "ui/base/x/active_window_watcher_x.h" + +namespace ui { static Atom kNetActiveWindowAtom = None; @@ -100,3 +102,5 @@ GdkFilterReturn ActiveWindowWatcherX::OnWindowXEvent(GdkXEvent* xevent, return GDK_FILTER_CONTINUE; } + +} // namespace ui diff --git a/app/active_window_watcher_x.h b/ui/base/x/active_window_watcher_x.h index 4a89686..68907c4 100644 --- a/app/active_window_watcher_x.h +++ b/ui/base/x/active_window_watcher_x.h @@ -1,9 +1,9 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_ACTIVE_WINDOW_WATCHER_X_H_ -#define APP_ACTIVE_WINDOW_WATCHER_X_H_ +#ifndef UI_BASE_X_ACTIVE_WINDOW_WATCHER_X_H_ +#define UI_BASE_X_ACTIVE_WINDOW_WATCHER_X_H_ #pragma once #include <gdk/gdk.h> @@ -12,6 +12,8 @@ #include "base/observer_list.h" #include "base/singleton.h" +namespace ui { + // This is a helper class that is used to keep track of which window the X // window manager thinks is active. Add an Observer to listener for changes to // the active window. @@ -53,4 +55,6 @@ class ActiveWindowWatcherX { DISALLOW_COPY_AND_ASSIGN(ActiveWindowWatcherX); }; -#endif // APP_ACTIVE_WINDOW_WATCHER_X_H_ +} // namespace ui + +#endif // UI_BASE_X_ACTIVE_WINDOW_WATCHER_X_H_ diff --git a/app/x11_util.cc b/ui/base/x/x11_util.cc index 549cca8..2b5863a 100644 --- a/app/x11_util.cc +++ b/ui/base/x/x11_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -6,7 +6,7 @@ // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support // remains woefully incomplete. -#include "app/x11_util.h" +#include "ui/base/x/x11_util.h" #include <gdk/gdk.h> #include <gdk/gdkx.h> @@ -23,11 +23,11 @@ #include "base/stringprintf.h" #include "base/string_number_conversions.h" #include "base/threading/thread.h" -#include "app/x11_util_internal.h" #include "gfx/rect.h" #include "gfx/size.h" +#include "ui/base/x/x11_util_internal.h" -namespace x11_util { +namespace ui { namespace { @@ -341,7 +341,7 @@ XID GetParentWindow(XID window) { XID GetHighestAncestorWindow(XID window, XID root) { while (true) { - XID parent = x11_util::GetParentWindow(window); + XID parent = GetParentWindow(window); if (parent == None) return None; if (parent == root) @@ -644,9 +644,9 @@ bool GetWindowParent(XID* parent_window, bool* parent_is_root, XID window) { bool GetWindowManagerName(std::string* wm_name) { DCHECK(wm_name); int wm_window = 0; - if (!x11_util::GetIntProperty(x11_util::GetX11RootWindow(), - "_NET_SUPPORTING_WM_CHECK", - &wm_window)) { + if (!GetIntProperty(GetX11RootWindow(), + "_NET_SUPPORTING_WM_CHECK", + &wm_window)) { return false; } @@ -661,7 +661,7 @@ bool GetWindowManagerName(std::string* wm_name) { // check that too. gdk_error_trap_push(); int wm_window_property = 0; - bool result = x11_util::GetIntProperty( + bool result = GetIntProperty( wm_window, "_NET_SUPPORTING_WM_CHECK", &wm_window_property); gdk_flush(); bool got_error = gdk_error_trap_pop(); @@ -669,7 +669,7 @@ bool GetWindowManagerName(std::string* wm_name) { return false; gdk_error_trap_push(); - result = x11_util::GetStringProperty( + result = GetStringProperty( static_cast<XID>(wm_window), "_NET_WM_NAME", wm_name); gdk_flush(); got_error = gdk_error_trap_pop(); @@ -877,4 +877,4 @@ std::string GetErrorEventDescription(Display *dpy, // End of x11_util_internal.h -} // namespace x11_util +} // namespace ui diff --git a/app/x11_util.h b/ui/base/x/x11_util.h index c07f42c..58f9157 100644 --- a/app/x11_util.h +++ b/ui/base/x/x11_util.h @@ -1,9 +1,9 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_X11_UTIL_H_ -#define APP_X11_UTIL_H_ +#ifndef UI_BASE_X_X11_UTIL_H_ +#define UI_BASE_X_X11_UTIL_H_ #pragma once // This file declares utility functions for X11 (Linux only). @@ -28,7 +28,7 @@ namespace gfx { class Rect; } -namespace x11_util { +namespace ui { // These functions use the GDK default display and this /must/ be called from // the UI thread. Thus, they don't support multiple displays. @@ -178,6 +178,6 @@ bool ChangeWindowDesktop(XID window, XID destination); // to set your own error handlers. void SetDefaultX11ErrorHandlers(); -} // namespace x11_util +} // namespace ui -#endif // APP_X11_UTIL_H_ +#endif // UI_BASE_X_X11_UTIL_H_ diff --git a/app/x11_util_internal.h b/ui/base/x/x11_util_internal.h index a4953b5..cee2bec 100644 --- a/app/x11_util_internal.h +++ b/ui/base/x/x11_util_internal.h @@ -1,9 +1,9 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. -#ifndef APP_X11_UTIL_INTERNAL_H_ -#define APP_X11_UTIL_INTERNAL_H_ +#ifndef UI_BASE_X_X11_UTIL_INTERNAL_H_ +#define UI_BASE_X_X11_UTIL_INTERNAL_H_ #pragma once // This file declares utility functions for X11 (Linux only). @@ -19,7 +19,8 @@ extern "C" { #include <X11/extensions/Xrender.h> } -namespace x11_util { +namespace ui { + // -------------------------------------------------------------------------- // NOTE: these functions cache the results and must be called from the UI // thread. @@ -41,6 +42,7 @@ namespace x11_util { // Returns a string suitable for logging the error event. std::string GetErrorEventDescription(Display* dpy, XErrorEvent* error_event); -}; -#endif // APP_X11_UTIL_INTERNAL_H_ +} // namespace ui + +#endif // UI_BASE_X_X11_UTIL_INTERNAL_H_ diff --git a/views/accessibility/view_accessibility.cc b/views/accessibility/view_accessibility.cc index c94e779..4e7d8a5 100644 --- a/views/accessibility/view_accessibility.cc +++ b/views/accessibility/view_accessibility.cc @@ -4,7 +4,7 @@ #include "views/accessibility/view_accessibility.h" -#include "app/view_prop.h" +#include "ui/base/view_prop.h" #include "views/controls/button/native_button.h" #include "views/widget/widget.h" #include "views/widget/widget_win.h" @@ -725,8 +725,8 @@ HRESULT ViewAccessibility::GetNativeIAccessibleInterface( return E_INVALIDARG; HWND native_view_window = static_cast<HWND>( - app::ViewProp::GetValue(native_host->native_view(), - kViewsNativeHostPropForAccessibility)); + ui::ViewProp::GetValue(native_host->native_view(), + kViewsNativeHostPropForAccessibility)); if (!IsWindow(native_view_window)) { native_view_window = native_host->native_view(); } diff --git a/views/controls/button/native_button_gtk.h b/views/controls/button/native_button_gtk.h index 2ae38b1..8e0d5bf 100644 --- a/views/controls/button/native_button_gtk.h +++ b/views/controls/button/native_button_gtk.h @@ -6,7 +6,7 @@ #define VIEWS_CONTROLS_BUTTON_NATIVE_BUTTON_GTK_H_ #pragma once -#include "app/gtk_signal.h" +#include "ui/base/gtk/gtk_signal.h" #include "views/controls/button/native_button_wrapper.h" #include "views/controls/native_control_gtk.h" diff --git a/views/controls/combobox/native_combobox_gtk.h b/views/controls/combobox/native_combobox_gtk.h index 56e8666..7d5f30a 100644 --- a/views/controls/combobox/native_combobox_gtk.h +++ b/views/controls/combobox/native_combobox_gtk.h @@ -6,7 +6,7 @@ #define VIEWS_CONTROLS_COMBOBOX_NATIVE_COMBOBOX_GTK_H_ #pragma once -#include "app/gtk_signal.h" +#include "ui/base/gtk/gtk_signal.h" #include "views/controls/combobox/native_combobox_wrapper.h" #include "views/controls/native_control_gtk.h" diff --git a/views/controls/label.cc b/views/controls/label.cc index 62a9198..c54d6dd 100644 --- a/views/controls/label.cc +++ b/views/controls/label.cc @@ -8,7 +8,6 @@ #include <limits> #include "app/resource_bundle.h" -#include "app/text_elider.h" #include "base/i18n/rtl.h" #include "base/logging.h" #include "base/string_split.h" @@ -18,6 +17,7 @@ #include "gfx/color_utils.h" #include "gfx/font.h" #include "gfx/insets.h" +#include "ui/base/text/text_elider.h" #include "views/background.h" namespace views { @@ -428,7 +428,7 @@ void Label::CalculateDrawStringParams(std::wstring* paint_text, // TODO(jungshik) : Figure out how to get 'intl.accept_languages' // preference and use it when calling ElideUrl. *paint_text = UTF16ToWideHack( - gfx::ElideUrl(url_, font_, GetAvailableRect().width(), std::wstring())); + ui::ElideUrl(url_, font_, GetAvailableRect().width(), std::wstring())); // An URLs is always treated as an LTR text and therefore we should // explicitly mark it as such if the locale is RTL so that URLs containing @@ -442,7 +442,7 @@ void Label::CalculateDrawStringParams(std::wstring* paint_text, *paint_text = UTF16ToWide(base::i18n::GetDisplayStringInLTRDirectionality( WideToUTF16(*paint_text))); } else if (elide_in_middle_) { - *paint_text = UTF16ToWideHack(gfx::ElideText(text_, + *paint_text = UTF16ToWideHack(ui::ElideText(text_, font_, GetAvailableRect().width(), true)); } else { *paint_text = UTF16ToWideHack(text_); diff --git a/views/controls/menu/native_menu_gtk.h b/views/controls/menu/native_menu_gtk.h index 58a6993..c3ab15c 100644 --- a/views/controls/menu/native_menu_gtk.h +++ b/views/controls/menu/native_menu_gtk.h @@ -10,9 +10,9 @@ #include <vector> -#include "app/gtk_signal.h" #include "base/message_loop.h" #include "base/task.h" +#include "ui/base/gtk/gtk_signal.h" #include "views/controls/menu/menu_wrapper.h" namespace ui { diff --git a/views/controls/message_box_view.cc b/views/controls/message_box_view.cc index 245b861..a239a16 100644 --- a/views/controls/message_box_view.cc +++ b/views/controls/message_box_view.cc @@ -4,12 +4,12 @@ #include "views/controls/message_box_view.h" -#include "app/message_box_flags.h" #include "base/i18n/rtl.h" #include "base/message_loop.h" #include "base/utf_string_conversions.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/clipboard/scoped_clipboard_writer.h" +#include "ui/base/message_box_flags.h" #include "views/controls/button/checkbox.h" #include "views/standard_layout.h" #include "views/views_delegate.h" @@ -118,7 +118,7 @@ void MessageBoxView::Init(int dialog_flags, const std::wstring& default_prompt) { message_label_->SetMultiLine(true); message_label_->SetAllowCharacterBreak(true); - if (dialog_flags & MessageBoxFlags::kAutoDetectAlignment) { + if (dialog_flags & ui::MessageBoxFlags::kAutoDetectAlignment) { // Determine the alignment and directionality based on the first character // with strong directionality. base::i18n::TextDirection direction = @@ -137,7 +137,7 @@ void MessageBoxView::Init(int dialog_flags, message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); } - if (dialog_flags & MessageBoxFlags::kFlagHasPromptField) { + if (dialog_flags & ui::MessageBoxFlags::kFlagHasPromptField) { prompt_field_ = new views::Textfield; prompt_field_->SetText(WideToUTF16Hack(default_prompt)); } diff --git a/views/controls/native_control.cc b/views/controls/native_control.cc index d1cc36d..01cbb15 100644 --- a/views/controls/native_control.cc +++ b/views/controls/native_control.cc @@ -11,12 +11,12 @@ #include <atlmisc.h> #include "app/l10n_util_win.h" -#include "app/view_prop.h" #include "base/logging.h" #include "base/scoped_ptr.h" #include "gfx/native_theme_win.h" #include "ui/base/keycodes/keyboard_codes.h" #include "ui/base/keycodes/keyboard_code_conversion_win.h" +#include "ui/base/view_prop.h" #include "ui/base/win/hwnd_util.h" #include "views/background.h" #include "views/border.h" @@ -24,7 +24,7 @@ #include "views/focus/focus_manager.h" #include "views/widget/widget.h" -using app::ViewProp; +using ui::ViewProp; namespace views { diff --git a/views/controls/native_control_win.cc b/views/controls/native_control_win.cc index 6e805b8f..af27b4c 100644 --- a/views/controls/native_control_win.cc +++ b/views/controls/native_control_win.cc @@ -7,12 +7,12 @@ #include <windowsx.h> #include "app/l10n_util_win.h" -#include "app/view_prop.h" #include "base/logging.h" +#include "ui/base/view_prop.h" #include "ui/base/win/hwnd_util.h" #include "views/focus/focus_manager.h" -using app::ViewProp; +using ui::ViewProp; namespace views { diff --git a/views/controls/native_control_win.h b/views/controls/native_control_win.h index d27efa4..289c679 100644 --- a/views/controls/native_control_win.h +++ b/views/controls/native_control_win.h @@ -12,7 +12,7 @@ #include "views/controls/native/native_view_host.h" #include "views/widget/child_window_message_processor.h" -namespace app { +namespace ui { class ViewProp; } @@ -73,7 +73,7 @@ class NativeControlWin : public ChildWindowMessageProcessor, DWORD GetAdditionalRTLStyle() const; private: - typedef ScopedVector<app::ViewProp> ViewProps; + typedef ScopedVector<ui::ViewProp> ViewProps; // Called by the containing WidgetWin when a message of type WM_CTLCOLORBTN or // WM_CTLCOLORSTATIC is sent from the HWND created by an object dreived from diff --git a/views/controls/table/native_table_gtk.h b/views/controls/table/native_table_gtk.h index e9bf008..d7516de 100644 --- a/views/controls/table/native_table_gtk.h +++ b/views/controls/table/native_table_gtk.h @@ -6,8 +6,8 @@ #define VIEWS_CONTROLS_TABLE_NATIVE_TABLE_GTK_H_ #pragma once -#include "app/gtk_signal.h" #include "ui/base/models/table_model.h" +#include "ui/base/gtk/gtk_signal.h" #include "views/controls/native_control_gtk.h" #include "views/controls/table/native_table_wrapper.h" diff --git a/views/focus/focus_util_win.cc b/views/focus/focus_util_win.cc index 26f5550..245fbf4 100644 --- a/views/focus/focus_util_win.cc +++ b/views/focus/focus_util_win.cc @@ -6,11 +6,11 @@ #include <windowsx.h> -#include "app/view_prop.h" #include "base/auto_reset.h" +#include "ui/base/view_prop.h" #include "ui/base/win/hwnd_util.h" -using app::ViewProp; +using ui::ViewProp; namespace views { diff --git a/views/focus/focus_util_win.h b/views/focus/focus_util_win.h index 6394f5d..3bfeec4 100644 --- a/views/focus/focus_util_win.h +++ b/views/focus/focus_util_win.h @@ -8,7 +8,7 @@ #include <windows.h> -namespace app { +namespace ui { class ViewProp; } @@ -18,7 +18,7 @@ namespace views { // We reroute the mouse wheel messages to such HWND when they are under the // mouse pointer (but are not the active window). Callers own the returned // object. -app::ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); +ui::ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); // Forwards mouse wheel messages to the window under it. // Windows sends mouse wheel messages to the currently active window. diff --git a/views/view.cc b/views/view.cc index 241d86e..ebbb36a 100644 --- a/views/view.cc +++ b/views/view.cc @@ -29,7 +29,7 @@ #include "views/accessibility/view_accessibility.h" #endif #if defined(OS_LINUX) -#include "app/scoped_handle_gtk.h" +#include "ui/base/gtk/scoped_handle_gtk.h" #endif namespace views { @@ -455,7 +455,7 @@ bool View::HitTest(const gfx::Point& l) const { base::win::ScopedRegion rgn(mask.CreateNativeRegion()); return !!PtInRegion(rgn, l.x(), l.y()); #elif defined(TOOLKIT_USES_GTK) - ScopedRegion rgn(mask.CreateNativeRegion()); + ui::ScopedRegion rgn(mask.CreateNativeRegion()); return gdk_region_point_in(rgn.Get(), l.x(), l.y()); #endif } diff --git a/views/view.h b/views/view.h index 02111b0..a026c6a 100644 --- a/views/view.h +++ b/views/view.h @@ -26,14 +26,18 @@ using ui::OSExchangeData; +class ViewAccessibility; + namespace gfx { class Canvas; class Insets; class Path; } +namespace ui { class ThemeProvider; -class ViewAccessibility; +} +using ui::ThemeProvider; namespace views { diff --git a/views/widget/child_window_message_processor.cc b/views/widget/child_window_message_processor.cc index 7e94ea2..e1cfa31 100644 --- a/views/widget/child_window_message_processor.cc +++ b/views/widget/child_window_message_processor.cc @@ -4,25 +4,25 @@ #include "views/widget/child_window_message_processor.h" -#include "app/view_prop.h" #include "base/logging.h" +#include "ui/base/view_prop.h" namespace views { static const char* const kChildWindowKey = "__CHILD_WINDOW_MESSAGE_PROCESSOR__"; // static -app::ViewProp* ChildWindowMessageProcessor::Register( +ui::ViewProp* ChildWindowMessageProcessor::Register( HWND hwnd, ChildWindowMessageProcessor* processor) { DCHECK(processor); - return new app::ViewProp(hwnd, kChildWindowKey, processor); + return new ui::ViewProp(hwnd, kChildWindowKey, processor); } // static ChildWindowMessageProcessor* ChildWindowMessageProcessor::Get(HWND hwnd) { return reinterpret_cast<ChildWindowMessageProcessor*>( - app::ViewProp::GetValue(hwnd, kChildWindowKey)); + ui::ViewProp::GetValue(hwnd, kChildWindowKey)); } } // namespace diff --git a/views/widget/child_window_message_processor.h b/views/widget/child_window_message_processor.h index 3490864..ab18997 100644 --- a/views/widget/child_window_message_processor.h +++ b/views/widget/child_window_message_processor.h @@ -8,7 +8,7 @@ #include <windows.h> -namespace app { +namespace ui { class ViewProp; } @@ -23,7 +23,7 @@ class ChildWindowMessageProcessor { public: // Registers |processor| for |hwnd|. The caller takes ownership of the // returned object. - static app::ViewProp* Register(HWND hwnd, + static ui::ViewProp* Register(HWND hwnd, ChildWindowMessageProcessor* processor); // Returns the ChildWindowMessageProcessor for |hwnd|, NULL if there isn't diff --git a/views/widget/default_theme_provider.h b/views/widget/default_theme_provider.h index 79366a9..d9bdf2d 100644 --- a/views/widget/default_theme_provider.h +++ b/views/widget/default_theme_provider.h @@ -8,20 +8,20 @@ #include <vector> -#include "app/theme_provider.h" #include "base/basictypes.h" +#include "ui/base/theme_provider.h" class Profile; class ResourceBundle; namespace views { -class DefaultThemeProvider : public ThemeProvider { +class DefaultThemeProvider : public ui::ThemeProvider { public: DefaultThemeProvider() { }; virtual ~DefaultThemeProvider() { }; - // Overridden from ThemeProvider. + // Overridden from ui::ThemeProvider. virtual void Init(Profile* profile) { } virtual SkBitmap* GetBitmapNamed(int id) const; virtual SkColor GetColor(int id) const { diff --git a/views/widget/tooltip_manager.cc b/views/widget/tooltip_manager.cc index d71a566..c6bc2b8 100644 --- a/views/widget/tooltip_manager.cc +++ b/views/widget/tooltip_manager.cc @@ -6,8 +6,8 @@ #include <vector> -#include "app/text_elider.h" #include "base/utf_string_conversions.h" +#include "ui/base/text/text_elider.h" namespace views { @@ -58,7 +58,7 @@ void TooltipManager::TrimTooltipToFit(std::wstring* text, std::wstring result; for (std::vector<std::wstring>::iterator i = lines.begin(); i != lines.end(); ++i) { - string16 elided_text = gfx::ElideText(WideToUTF16Hack(*i), + string16 elided_text = ui::ElideText(WideToUTF16Hack(*i), font, available_width, false); *max_width = std::max(*max_width, font.GetStringWidth(elided_text)); if (i == lines.begin() && i + 1 == lines.end()) { diff --git a/views/widget/tooltip_window_gtk.h b/views/widget/tooltip_window_gtk.h index fad4d0e..0c9fcb0 100644 --- a/views/widget/tooltip_window_gtk.h +++ b/views/widget/tooltip_window_gtk.h @@ -8,9 +8,9 @@ #include <string> -#include "app/gtk_integers.h" -#include "app/gtk_signal.h" #include "base/basictypes.h" +#include "ui/base/gtk/gtk_integers.h" +#include "ui/base/gtk/gtk_signal.h" typedef struct _GdkEventExpose GdkEventExpose; typedef struct _GtkLabel GtkLabel; diff --git a/views/widget/widget.h b/views/widget/widget.h index 9c4be31..2cc37f6 100644 --- a/views/widget/widget.h +++ b/views/widget/widget.h @@ -10,8 +10,6 @@ #include "gfx/native_widget_types.h" -class ThemeProvider; - namespace gfx { class Path; class Point; @@ -20,7 +18,9 @@ class Rect; namespace ui { class Accelerator; +class ThemeProvider; } +using ui::ThemeProvider; namespace views { diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 8568da1..9d3c359 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -31,6 +31,7 @@ using ui::OSExchangeData; using ui::OSExchangeDataProviderGtk; +using ui::ActiveWindowWatcherX; namespace { diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h index 4895356..af66ea6 100644 --- a/views/widget/widget_gtk.h +++ b/views/widget/widget_gtk.h @@ -8,10 +8,10 @@ #include <gtk/gtk.h> -#include "app/active_window_watcher_x.h" -#include "app/gtk_signal.h" #include "base/message_loop.h" #include "gfx/size.h" +#include "ui/base/gtk/gtk_signal.h" +#include "ui/base/x/active_window_watcher_x.h" #include "views/focus/focus_manager.h" #include "views/widget/widget.h" @@ -39,7 +39,7 @@ class WindowGtk; class WidgetGtk : public Widget, public FocusTraversable, - public ActiveWindowWatcherX::Observer { + public ui::ActiveWindowWatcherX::Observer { public: // Type of widget. enum Type { @@ -158,7 +158,7 @@ class WidgetGtk // size of other kinds of widgets. void GetRequestedSize(gfx::Size* out) const; - // Overriden from ActiveWindowWatcherX::Observer. + // Overriden from ui::ActiveWindowWatcherX::Observer. virtual void ActiveWindowChanged(GdkWindow* active_window); // Overridden from Widget: diff --git a/views/widget/widget_utils.h b/views/widget/widget_utils.h index 78fdba9..d447935 100644 --- a/views/widget/widget_utils.h +++ b/views/widget/widget_utils.h @@ -6,7 +6,10 @@ #define VIEWS_WIDGET_WIDGET_UTILS_H_ #pragma once +namespace ui { class ThemeProvider; +} +using ui::ThemeProvider; namespace views { diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h index 10c9e3b..6c45ae0 100644 --- a/views/widget/widget_win.h +++ b/views/widget/widget_win.h @@ -22,7 +22,7 @@ #include "views/layout_manager.h" #include "views/widget/widget.h" -namespace app { +namespace ui { class ViewProp; } @@ -484,7 +484,7 @@ class WidgetWin : public ui::WindowImpl, bool is_window_; private: - typedef ScopedVector<app::ViewProp> ViewProps; + typedef ScopedVector<ui::ViewProp> ViewProps; // Implementation of GetWindow. Ascends the parents of |hwnd| returning the // first ancestor that is a Window. diff --git a/views/window/dialog_client_view.cc b/views/window/dialog_client_view.cc index 1eda791..365f81b4 100644 --- a/views/window/dialog_client_view.cc +++ b/views/window/dialog_client_view.cc @@ -34,6 +34,8 @@ #include "views/widget/widget.h" #endif +using ui::MessageBoxFlags; + namespace views { namespace { diff --git a/views/window/dialog_delegate.h b/views/window/dialog_delegate.h index 6c8b27c..ac6d4e9 100644 --- a/views/window/dialog_delegate.h +++ b/views/window/dialog_delegate.h @@ -6,11 +6,13 @@ #define VIEWS_WINDOW_DIALOG_DELEGATE_H_ #pragma once -#include "app/message_box_flags.h" +#include "ui/base/message_box_flags.h" #include "views/accessibility/accessibility_types.h" #include "views/window/dialog_client_view.h" #include "views/window/window_delegate.h" +using ui::MessageBoxFlags; + namespace views { class View; @@ -37,22 +39,24 @@ class DialogDelegate : public WindowDelegate { // // To use the extra button you need to override GetDialogButtons() virtual int GetDialogButtons() const { - return MessageBoxFlags::DIALOGBUTTON_OK | - MessageBoxFlags::DIALOGBUTTON_CANCEL; + return ui::MessageBoxFlags::DIALOGBUTTON_OK | + ui::MessageBoxFlags::DIALOGBUTTON_CANCEL; } // Returns whether accelerators are enabled on the button. This is invoked // when an accelerator is pressed, not at construction time. This // returns true. - virtual bool AreAcceleratorsEnabled(MessageBoxFlags::DialogButton button) { + virtual bool AreAcceleratorsEnabled( + ui::MessageBoxFlags::DialogButton button) { return true; } // Returns the label of the specified DialogButton. virtual std::wstring GetDialogButtonLabel( - MessageBoxFlags::DialogButton button) const { - // empty string results in defaults for MessageBoxFlags::DIALOGBUTTON_OK, - // MessageBoxFlags::DIALOGBUTTON_CANCEL. + ui::MessageBoxFlags::DialogButton button) const { + // empty string results in defaults for + // ui::MessageBoxFlags::DIALOGBUTTON_OK, + // ui::MessageBoxFlags::DIALOGBUTTON_CANCEL. return L""; } @@ -69,21 +73,21 @@ class DialogDelegate : public WindowDelegate { // Returns the default dialog button. This should not be a mask as only // one button should ever be the default button. Return - // MessageBoxFlags::DIALOGBUTTON_NONE if there is no default. Default - // behavior is to return MessageBoxFlags::DIALOGBUTTON_OK or - // MessageBoxFlags::DIALOGBUTTON_CANCEL (in that order) if they are - // present, MessageBoxFlags::DIALOGBUTTON_NONE otherwise. + // ui::MessageBoxFlags::DIALOGBUTTON_NONE if there is no default. Default + // behavior is to return ui::MessageBoxFlags::DIALOGBUTTON_OK or + // ui::MessageBoxFlags::DIALOGBUTTON_CANCEL (in that order) if they are + // present, ui::MessageBoxFlags::DIALOGBUTTON_NONE otherwise. virtual int GetDefaultDialogButton() const; // Returns whether the specified dialog button is enabled. virtual bool IsDialogButtonEnabled( - MessageBoxFlags::DialogButton button) const { + ui::MessageBoxFlags::DialogButton button) const { return true; } // Returns whether the specified dialog button is visible. virtual bool IsDialogButtonVisible( - MessageBoxFlags::DialogButton button) const { + ui::MessageBoxFlags::DialogButton button) const { return true; } diff --git a/views/window/window.cc b/views/window/window.cc index 522050f..e8b5ddf 100644 --- a/views/window/window.cc +++ b/views/window/window.cc @@ -4,24 +4,24 @@ #include "views/window/window.h" -#include "app/gfx/font_util.h" #include "app/resource_bundle.h" #include "base/string_util.h" #include "gfx/font.h" #include "gfx/size.h" +#include "ui/base/l10n/l10n_font_util.h" #include "views/widget/widget.h" namespace views { // static int Window::GetLocalizedContentsWidth(int col_resource_id) { - return gfx::GetLocalizedContentsWidthForFont(col_resource_id, + return ui::GetLocalizedContentsWidthForFont(col_resource_id, ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); } // static int Window::GetLocalizedContentsHeight(int row_resource_id) { - return gfx::GetLocalizedContentsHeightForFont(row_resource_id, + return ui::GetLocalizedContentsHeightForFont(row_resource_id, ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont)); } diff --git a/views/window/window_win.cc b/views/window/window_win.cc index 14993a4..2e3481b 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -7,7 +7,6 @@ #include <dwmapi.h> #include <shellapi.h> -#include "app/theme_provider.h" #include "app/win/win_util.h" #include "base/i18n/rtl.h" #include "base/win/windows_version.h" @@ -16,6 +15,7 @@ #include "gfx/icon_util.h" #include "gfx/path.h" #include "ui/base/keycodes/keyboard_code_conversion_win.h" +#include "ui/base/theme_provider.h" #include "ui/base/win/hwnd_util.h" #include "views/accessibility/view_accessibility.h" #include "views/widget/root_view.h" @@ -538,7 +538,7 @@ gfx::NativeWindow WindowWin::GetNativeWindow() const { } bool WindowWin::ShouldUseNativeFrame() const { - ThemeProvider* tp = GetThemeProvider(); + ui::ThemeProvider* tp = GetThemeProvider(); if (!tp) return ui::ShouldUseVistaFrame(); return tp->ShouldUseNativeFrame(); diff --git a/webkit/plugins/npapi/DEPS b/webkit/plugins/npapi/DEPS index c3cbc8c..3ebbd9e 100644 --- a/webkit/plugins/npapi/DEPS +++ b/webkit/plugins/npapi/DEPS @@ -1,5 +1,5 @@ include_rules = [ - "+app", + "+app", # app/win/iat_patch_function.h "+ppapi", # Files in this directory must not depend on the proxy, because the proxy @@ -8,4 +8,5 @@ include_rules = [ "+printing", "+skia", + "+ui/base", ] diff --git a/webkit/plugins/npapi/webplugin_delegate_impl.h b/webkit/plugins/npapi/webplugin_delegate_impl.h index 84131f2..9f64f3a 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl.h +++ b/webkit/plugins/npapi/webplugin_delegate_impl.h @@ -21,7 +21,7 @@ #include "webkit/glue/webcursor.h" #if defined(USE_X11) -#include "app/x11_util.h" +#include "ui/base/x/x11_util.h" typedef struct _GdkDrawable GdkPixmap; #endif |