summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-28 13:28:38 +0000
committerfsamuel@chromium.org <fsamuel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-28 13:28:38 +0000
commit4bd55a3309fba325365ddcae9ac7c0cef1f74105 (patch)
tree3fb05542d71f5e8e7408aff094229489629cb946
parentb72ffe8133e6c15d43853d5c705866f0d76587ce (diff)
downloadchromium_src-4bd55a3309fba325365ddcae9ac7c0cef1f74105.zip
chromium_src-4bd55a3309fba325365ddcae9ac7c0cef1f74105.tar.gz
chromium_src-4bd55a3309fba325365ddcae9ac7c0cef1f74105.tar.bz2
Larger Combo box Hit Targets for TOUCH_UI
This is a chromium patch of a two-sided chromium/webkit patch that enables larger hit targets in combo box popups for TOUCH_UI builds. This was originally under this issue: http://codereview.chromium.org/7465011/ The code was committed but the webkit interface changed, afterward so this patch addresses that change. The webkit patch can be found here: https://bugs.webkit.org/show_bug.cgi?id=64897 BUG=none TEST=manually Review URL: http://codereview.chromium.org/7477036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94455 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/renderer/render_thread.cc6
-rw-r--r--ui/gfx/native_theme.cc4
-rw-r--r--ui/gfx/native_theme.h2
-rw-r--r--ui/gfx/native_theme_chromeos.cc8
-rw-r--r--ui/gfx/native_theme_chromeos.h2
-rw-r--r--webkit/glue/webthemeengine_impl_linux.cc4
-rw-r--r--webkit/glue/webthemeengine_impl_linux.h1
7 files changed, 6 insertions, 21 deletions
diff --git a/content/renderer/render_thread.cc b/content/renderer/render_thread.cc
index ba95709..5d2f33d 100644
--- a/content/renderer/render_thread.cc
+++ b/content/renderer/render_thread.cc
@@ -59,6 +59,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebNetworkStateNotifier.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispatcher.h"
@@ -98,6 +99,10 @@ using WebKit::WebView;
namespace {
static const double kInitialIdleHandlerDelayS = 1.0 /* seconds */;
+#if defined(TOUCH_UI)
+static const int kPopupListBoxMinimumRowHeight = 60;
+#endif
+
// Keep the global RenderThread in a TLS slot so it is impossible to access
// incorrectly from the wrong thread.
static base::LazyInstance<base::ThreadLocalPointer<RenderThread> > lazy_tls(
@@ -631,6 +636,7 @@ void RenderThread::EnsureWebKitInitialized() {
#ifdef TOUCH_UI
WebRuntimeFeatures::enableTouch(true);
+ WebKit::WebPopupMenu::setMinimumRowHeight(kPopupListBoxMinimumRowHeight);
#else
// TODO(saintlou): in the future touch should always be enabled
WebRuntimeFeatures::enableTouch(false);
diff --git a/ui/gfx/native_theme.cc b/ui/gfx/native_theme.cc
index e747b8e..331d429 100644
--- a/ui/gfx/native_theme.cc
+++ b/ui/gfx/native_theme.cc
@@ -12,10 +12,6 @@ unsigned int NativeTheme::thumb_inactive_color_ = 0xeaeaea;
unsigned int NativeTheme::thumb_active_color_ = 0xf4f4f4;
unsigned int NativeTheme::track_color_ = 0xd3d3d3;
-int NativeTheme::GetPopupListBoxMinimumRowHeight() const {
- return 0;
-}
-
void NativeTheme::SetScrollbarColors(unsigned inactive_color,
unsigned active_color,
unsigned track_color) const {
diff --git a/ui/gfx/native_theme.h b/ui/gfx/native_theme.h
index dd35a9e..2f1ba70 100644
--- a/ui/gfx/native_theme.h
+++ b/ui/gfx/native_theme.h
@@ -205,8 +205,6 @@ class UI_API NativeTheme {
const gfx::Rect& rect,
const ExtraParams& extra) const = 0;
- virtual int GetPopupListBoxMinimumRowHeight() const;
-
// Supports theme specific colors.
void SetScrollbarColors(unsigned inactive_color,
unsigned active_color,
diff --git a/ui/gfx/native_theme_chromeos.cc b/ui/gfx/native_theme_chromeos.cc
index 22e6bbe..a12b45f 100644
--- a/ui/gfx/native_theme_chromeos.cc
+++ b/ui/gfx/native_theme_chromeos.cc
@@ -301,14 +301,6 @@ gfx::Size NativeThemeChromeos::GetPartSize(Part part,
return gfx::Size(width, height);
}
-int NativeThemeChromeos::GetPopupListBoxMinimumRowHeight() const {
-#if defined(TOUCH_UI)
- return 60;
-#else
- return 0;
-#endif
-}
-
void NativeThemeChromeos::PaintScrollbarTrack(
SkCanvas* canvas,
Part part,
diff --git a/ui/gfx/native_theme_chromeos.h b/ui/gfx/native_theme_chromeos.h
index 609ecd7..1e1b84f 100644
--- a/ui/gfx/native_theme_chromeos.h
+++ b/ui/gfx/native_theme_chromeos.h
@@ -22,8 +22,6 @@ class NativeThemeChromeos : public gfx::NativeThemeLinux {
State state,
const ExtraParams& extra) const OVERRIDE;
- virtual int GetPopupListBoxMinimumRowHeight() const OVERRIDE;
-
// NativeThemeLinux overrides
virtual void PaintScrollbarTrack(SkCanvas* canvas,
Part part, State state,
diff --git a/webkit/glue/webthemeengine_impl_linux.cc b/webkit/glue/webthemeengine_impl_linux.cc
index 801c566..2594909 100644
--- a/webkit/glue/webthemeengine_impl_linux.cc
+++ b/webkit/glue/webthemeengine_impl_linux.cc
@@ -183,8 +183,4 @@ void WebThemeEngineImpl::paint(
native_theme_extra_params);
}
-int WebThemeEngineImpl::popupListBoxMinimumRowHeight() const {
- return gfx::NativeTheme::instance()->GetPopupListBoxMinimumRowHeight();
-}
-
} // namespace webkit_glue
diff --git a/webkit/glue/webthemeengine_impl_linux.h b/webkit/glue/webthemeengine_impl_linux.h
index 48f7d2f..89a170d 100644
--- a/webkit/glue/webthemeengine_impl_linux.h
+++ b/webkit/glue/webthemeengine_impl_linux.h
@@ -19,7 +19,6 @@ class WebThemeEngineImpl : public WebKit::WebThemeEngine {
WebKit::WebThemeEngine::State,
const WebKit::WebRect&,
const WebKit::WebThemeEngine::ExtraParams*);
- virtual int popupListBoxMinimumRowHeight() const;
};
} // namespace webkit_glue