summaryrefslogtreecommitdiffstats
path: root/ui/base
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 00:21:22 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-05 00:21:22 +0000
commita13283ccd0eef981bd92b5ba3b78c7d1b4a678f5 (patch)
tree2cb114cfcd3d89203d045c56ec2af4d2d52cf9b0 /ui/base
parentb09be0a7dace2e86516a2661c9c504d640abed7c (diff)
downloadchromium_src-a13283ccd0eef981bd92b5ba3b78c7d1b4a678f5.zip
chromium_src-a13283ccd0eef981bd92b5ba3b78c7d1b4a678f5.tar.gz
chromium_src-a13283ccd0eef981bd92b5ba3b78c7d1b4a678f5.tar.bz2
Remove TOOLKIT_USES_GTK and consolidate it into TOOLKIT_GTK
Add gtk dependency to base.gyp for android host_os="linux" case BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/9969080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130784 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r--ui/base/accelerators/accelerator.cc4
-rw-r--r--ui/base/clipboard/clipboard.h8
-rw-r--r--ui/base/clipboard/clipboard_unittest.cc4
-rw-r--r--ui/base/clipboard/custom_data_helper.h2
-rw-r--r--ui/base/dragdrop/os_exchange_data.h4
-rw-r--r--ui/base/keycodes/keyboard_code_conversion_x.cc2
-rw-r--r--ui/base/resource/resource_bundle.h2
-rw-r--r--ui/base/x/events_x.cc17
-rw-r--r--ui/base/x/x11_util.cc10
-rw-r--r--ui/base/x/x11_util.h6
10 files changed, 22 insertions, 37 deletions
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
index bd5d9e5..d067510 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -6,7 +6,7 @@
#if defined(OS_WIN)
#include <windows.h>
-#elif defined(TOOLKIT_USES_GTK)
+#elif defined(TOOLKIT_GTK)
#include <gdk/gdk.h>
#endif
@@ -92,7 +92,7 @@ string16 Accelerator::GetShortcutText() const {
if (c != 0) {
shortcut += static_cast<string16::value_type>(base::ToUpperASCII(c));
}
-#elif defined(TOOLKIT_USES_GTK)
+#elif defined(TOOLKIT_GTK)
const gchar* name = NULL;
switch (key_code_) {
case ui::VKEY_OEM_2:
diff --git a/ui/base/clipboard/clipboard.h b/ui/base/clipboard/clipboard.h
index 8abafac..dffb146 100644
--- a/ui/base/clipboard/clipboard.h
+++ b/ui/base/clipboard/clipboard.h
@@ -18,7 +18,7 @@
#include "base/threading/thread_checker.h"
#include "ui/base/ui_export.h"
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
#include <gdk/gdk.h>
#endif
@@ -36,7 +36,7 @@ class Size;
class FilePath;
class SkBitmap;
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
typedef struct _GtkClipboard GtkClipboard;
#endif
@@ -94,7 +94,7 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
explicit FormatType(const std::string& native_format);
const std::string& ToString() const { return data_; }
std::string data_;
-#elif defined(TOOLKIT_USES_GTK)
+#elif defined(TOOLKIT_GTK)
explicit FormatType(const std::string& native_format);
explicit FormatType(const GdkAtom& native_format);
const GdkAtom& ToGdkAtom() const { return data_; }
@@ -332,7 +332,7 @@ class UI_EXPORT Clipboard : NON_EXPORTED_BASE(public base::ThreadChecker) {
// True if we can create a window.
bool create_window_;
-#elif defined(TOOLKIT_USES_GTK)
+#elif defined(TOOLKIT_GTK)
// The public API is via WriteObjects() which dispatches to multiple
// Write*() calls, but on GTK we must write all the clipboard types
// in a single GTK call. To support this we store the current set
diff --git a/ui/base/clipboard/clipboard_unittest.cc b/ui/base/clipboard/clipboard_unittest.cc
index 697e1db..a39d27d 100644
--- a/ui/base/clipboard/clipboard_unittest.cc
+++ b/ui/base/clipboard/clipboard_unittest.cc
@@ -136,7 +136,7 @@ TEST_F(ClipboardTest, RTFTest) {
EXPECT_EQ(rtf, result);
}
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
TEST_F(ClipboardTest, MultipleBufferTest) {
Clipboard clipboard;
@@ -230,7 +230,7 @@ TEST_F(ClipboardTest, UniodeHTMLTest) {
}
#endif // defined(OS_WIN)
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
// Regression test for crbug.com/56298 (pasting empty HTML crashes Linux).
TEST_F(ClipboardTest, EmptyHTMLTest) {
Clipboard clipboard;
diff --git a/ui/base/clipboard/custom_data_helper.h b/ui/base/clipboard/custom_data_helper.h
index 0bc2405..c01dbdf 100644
--- a/ui/base/clipboard/custom_data_helper.h
+++ b/ui/base/clipboard/custom_data_helper.h
@@ -31,7 +31,7 @@ namespace ui {
#if defined(OS_MACOSX)
UI_EXPORT extern NSString* const kWebCustomDataPboardType;
-#elif (!defined(OS_WIN) && defined(USE_AURA)) || defined(TOOLKIT_USES_GTK)
+#elif (!defined(OS_WIN) && defined(USE_AURA)) || defined(TOOLKIT_GTK)
UI_EXPORT extern const char kMimeTypeWebCustomData[];
#endif
diff --git a/ui/base/dragdrop/os_exchange_data.h b/ui/base/dragdrop/os_exchange_data.h
index 13206ee..9ec452d 100644
--- a/ui/base/dragdrop/os_exchange_data.h
+++ b/ui/base/dragdrop/os_exchange_data.h
@@ -13,7 +13,7 @@
#if defined(OS_WIN)
#include <objidl.h>
-#elif defined(TOOLKIT_USES_GTK)
+#elif defined(TOOLKIT_GTK)
#include <gtk/gtk.h>
#endif
@@ -56,7 +56,7 @@ class UI_EXPORT OSExchangeData {
typedef Clipboard::FormatType CustomFormat;
#elif defined(OS_WIN)
typedef CLIPFORMAT CustomFormat;
-#elif defined(TOOLKIT_USES_GTK)
+#elif defined(TOOLKIT_GTK)
typedef GdkAtom CustomFormat;
#else
typedef void* CustomFormat;
diff --git a/ui/base/keycodes/keyboard_code_conversion_x.cc b/ui/base/keycodes/keyboard_code_conversion_x.cc
index ecb27a4..622ca1c 100644
--- a/ui/base/keycodes/keyboard_code_conversion_x.cc
+++ b/ui/base/keycodes/keyboard_code_conversion_x.cc
@@ -329,7 +329,7 @@ KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym) {
case XK_F24:
return static_cast<KeyboardCode>(VKEY_F1 + (keysym - XK_F1));
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
case XF86XK_HomePage:
case XF86XK_Search:
case XF86XK_Back:
diff --git a/ui/base/resource/resource_bundle.h b/ui/base/resource/resource_bundle.h
index 02c07c7..668823b 100644
--- a/ui/base/resource/resource_bundle.h
+++ b/ui/base/resource/resource_bundle.h
@@ -158,7 +158,7 @@ class UI_EXPORT ResourceBundle {
// Loads and returns a cursor from the app module.
HCURSOR LoadCursor(int cursor_id);
-#elif defined(TOOLKIT_USES_GTK)
+#elif defined(TOOLKIT_GTK)
// Gets the GdkPixbuf with the specified resource_id from the main data pak
// file. Returns a pointer to a shared instance of the GdkPixbuf. This
// shared GdkPixbuf is owned by the resource bundle and should not be freed.
diff --git a/ui/base/x/events_x.cc b/ui/base/x/events_x.cc
index d29a152..8bb5aebd4 100644
--- a/ui/base/x/events_x.cc
+++ b/ui/base/x/events_x.cc
@@ -10,15 +10,12 @@
#include <string.h>
#include "base/logging.h"
+#include "base/message_pump_x.h"
#include "ui/base/keycodes/keyboard_code_conversion_x.h"
#include "ui/base/touch/touch_factory.h"
#include "ui/base/x/x11_util.h"
#include "ui/gfx/point.h"
-#if !defined(TOOLKIT_USES_GTK)
-#include "base/message_pump_x.h"
-#endif
-
// Copied from xserver-properties.h
#define AXIS_LABEL_PROP_REL_HWHEEL "Rel Horiz Wheel"
#define AXIS_LABEL_PROP_REL_WHEEL "Rel Vert Wheel"
@@ -508,13 +505,11 @@ float GetTouchParamFromXEvent(XEvent* xev,
return default_value;
}
-#if !defined(TOOLKIT_USES_GTK)
Atom GetNoopEventAtom() {
return XInternAtom(
base::MessagePumpX::GetDefaultXDisplay(),
"noop", False);
}
-#endif
} // namespace
@@ -864,13 +859,8 @@ void UpdateDeviceList() {
}
bool IsNoopEvent(const base::NativeEvent& event) {
-#if defined(TOOLKIT_USES_GTK)
- NOTREACHED();
- return false;
-#else
return (event->type == ClientMessage &&
event->xclient.message_type == GetNoopEventAtom());
-#endif
}
base::NativeEvent CreateNoopEvent() {
@@ -883,14 +873,9 @@ base::NativeEvent CreateNoopEvent() {
noop->xclient.format = 8;
DCHECK(!noop->xclient.display);
}
- // TODO(oshima): Remove ifdef once gtk is removed from views.
-#if defined(TOOLKIT_USES_GTK)
- NOTREACHED();
-#else
// Make sure we use atom from current xdisplay, which may
// change during the test.
noop->xclient.message_type = GetNoopEventAtom();
-#endif
return noop;
}
diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
index 01d55c5..5df42c0 100644
--- a/ui/base/x/x11_util.cc
+++ b/ui/base/x/x11_util.cc
@@ -39,7 +39,7 @@
#include <X11/Xcursor/Xcursor.h>
#endif
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
@@ -421,7 +421,7 @@ bool GetCurrentDesktop(int* desktop) {
return GetIntProperty(GetX11RootWindow(), "_NET_CURRENT_DESKTOP", desktop);
}
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
XID GetX11WindowFromGtkWidget(GtkWidget* widget) {
return GDK_WINDOW_XID(gtk_widget_get_window(widget));
}
@@ -446,7 +446,7 @@ GtkWindow* GetGtkWindowFromX11Window(XID xid) {
void* GetVisualFromGtkWidget(GtkWidget* widget) {
return GDK_VISUAL_XVISUAL(gtk_widget_get_visual(widget));
}
-#endif // defined(TOOLKIT_USES_GTK)
+#endif // defined(TOOLKIT_GTK)
int BitsPerPixelForPixmapDepth(Display* dpy, int depth) {
int count;
@@ -646,7 +646,7 @@ bool SetIntArrayProperty(XID window,
}
Atom GetAtom(const char* name) {
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
return gdk_x11_get_xatom_by_name_for_display(
gdk_display_get_default(), name);
#else
@@ -1037,7 +1037,7 @@ bool IsX11WindowFullScreen(XID window) {
!= atom_properties.end())
return true;
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
// As the last resort, check if the window size is as large as the main
// screen.
GdkRectangle monitor_rect;
diff --git a/ui/base/x/x11_util.h b/ui/base/x/x11_util.h
index 64e7d64..771e8ef 100644
--- a/ui/base/x/x11_util.h
+++ b/ui/base/x/x11_util.h
@@ -26,7 +26,7 @@ typedef struct _XDisplay Display;
typedef unsigned long Cursor;
typedef struct _XcursorImage XcursorImage;
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
typedef struct _GdkDrawable GdkWindow;
typedef struct _GtkWidget GtkWidget;
typedef struct _GtkWindow GtkWindow;
@@ -99,7 +99,7 @@ UI_EXPORT XID GetX11RootWindow();
// Returns the user's current desktop.
bool GetCurrentDesktop(int* desktop);
-#if defined(TOOLKIT_USES_GTK)
+#if defined(TOOLKIT_GTK)
// Get the X window id for the given GTK widget.
UI_EXPORT XID GetX11WindowFromGtkWidget(GtkWidget* widget);
XID GetX11WindowFromGdkWindow(GdkWindow* window);
@@ -112,7 +112,7 @@ UI_EXPORT GtkWindow* GetGtkWindowFromX11Window(XID xid);
// Get a Visual from the given widget. Since we don't include the Xlib
// headers, this is returned as a void*.
UI_EXPORT void* GetVisualFromGtkWidget(GtkWidget* widget);
-#endif // defined(TOOLKIT_USES_GTK)
+#endif // defined(TOOLKIT_GTK)
// Return the number of bits-per-pixel for a pixmap of the given depth
UI_EXPORT int BitsPerPixelForPixmapDepth(Display* display, int depth);