summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-08 04:53:40 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-08 04:53:40 +0000
commit251db7d9e7748f673d69cda2f911a9506b653bb5 (patch)
tree1d12fd01fc3bbbac297791b80d8ba9cbcc7adc80 /views
parent19099fff2106c1518d47a2c4a34376f703826e61 (diff)
downloadchromium_src-251db7d9e7748f673d69cda2f911a9506b653bb5.zip
chromium_src-251db7d9e7748f673d69cda2f911a9506b653bb5.tar.gz
chromium_src-251db7d9e7748f673d69cda2f911a9506b653bb5.tar.bz2
Revert 88271, this broke the clang build thusly:
chrome/browser/chromeos/login/screen_locker.cc:225:16:error: 'ClearNativeFocus' marked 'override' but does not override any member functions virtual void ClearNativeFocus() OVERRIDE { ^ CXX(target) out/Debug/obj.target/browser/chrome/browser/chromeos/login/take_photo_view.o 1 error generated. Looks like a real bug in the CL. 88271 - Wait showing html dialog until renderre finish painting after page is loaded. This change keeps track of state transition to make sure we only show the window on the paint after page load. minor change; use gdk's debug paint. Views no longer manage the damaged rect by itself so we can simply use gdk's debug paint. Note to mazda. Please consider adding fade-in animation. I believe it will make it much nicer. BUG=chromium-os:15809 TEST=open keyboard overlay on device. no white flicker should be observed. Review URL: http://codereview.chromium.org/7024032 TBR=oshima@google.com Review URL: http://codereview.chromium.org/6995067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88280 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/native_widget_gtk.cc27
-rw-r--r--views/widget/native_widget_gtk.h11
2 files changed, 19 insertions, 19 deletions
diff --git a/views/widget/native_widget_gtk.cc b/views/widget/native_widget_gtk.cc
index 91af0e3..392abe8 100644
--- a/views/widget/native_widget_gtk.cc
+++ b/views/widget/native_widget_gtk.cc
@@ -279,6 +279,7 @@ static GtkWidget* CreateDragIconWidget(GdkPixbuf* drag_image) {
// static
GtkWidget* NativeWidgetGtk::null_parent_ = NULL;
+bool NativeWidgetGtk::debug_paint_enabled_ = false;
////////////////////////////////////////////////////////////////////////////////
// NativeWidgetGtk, public:
@@ -501,7 +502,7 @@ void NativeWidgetGtk::ActiveWindowChanged(GdkWindow* active_window) {
}
////////////////////////////////////////////////////////////////////////////////
-// NativeWidgetGtk implementation:
+// NativeWidgetGtk, Widget implementation:
void NativeWidgetGtk::ClearNativeFocus() {
DCHECK(!child_);
@@ -544,17 +545,9 @@ bool NativeWidgetGtk::HandleKeyboardEvent(const KeyEvent& key) {
return handled;
}
-bool NativeWidgetGtk::SuppressFreezeUpdates() {
- if (!painted_) {
- painted_ = true;
- return true;
- }
- return false;
-}
-
// static
void NativeWidgetGtk::EnableDebugPaint() {
- gdk_window_set_debug_updates(true);
+ debug_paint_enabled_ = true;
}
// static
@@ -1189,6 +1182,20 @@ gboolean NativeWidgetGtk::OnPaint(GtkWidget* widget, GdkEventExpose* event) {
}
}
+ if (debug_paint_enabled_) {
+ // Using cairo directly because using skia didn't have immediate effect.
+ cairo_t* cr = gdk_cairo_create(event->window);
+ gdk_cairo_region(cr, event->region);
+ cairo_set_source_rgb(cr, 1, 0, 0); // red
+ cairo_rectangle(cr,
+ event->area.x, event->area.y,
+ event->area.width, event->area.height);
+ cairo_fill(cr);
+ cairo_destroy(cr);
+ // Make sure that users see the red flash.
+ XSync(ui::GetXDisplay(), false /* don't discard events */);
+ }
+
ui::ScopedRegion region(gdk_region_copy(event->region));
if (!gdk_region_empty(region.Get())) {
GdkRectangle clip_bounds;
diff --git a/views/widget/native_widget_gtk.h b/views/widget/native_widget_gtk.h
index 52b5b2b..2603298 100644
--- a/views/widget/native_widget_gtk.h
+++ b/views/widget/native_widget_gtk.h
@@ -108,22 +108,15 @@ class NativeWidgetGtk : public NativeWidget,
void GetRequestedSize(gfx::Size* out) const;
// Overridden from ui::ActiveWindowWatcherX::Observer.
- virtual void ActiveWindowChanged(GdkWindow* active_window) OVERRIDE;
+ virtual void ActiveWindowChanged(GdkWindow* active_window);
// Clears the focus on the native widget having the focus.
- void ClearNativeFocus();
+ virtual void ClearNativeFocus();
// Handles a keyboard event by sending it to our focus manager.
// Returns true if it's handled by the focus manager.
bool HandleKeyboardEvent(const KeyEvent& key);
- // Tells widget not to remove FREEZE_UPDATES property when the
- // widget is painted. This is used if painting the gtk widget
- // is not enough to show the window and has to wait further like
- // keyboard overlay. Returns true if this is called before
- // FREEZE_UPDATES property is removed, or false otherwise.
- bool SuppressFreezeUpdates();
-
// Enables debug painting. See |debug_paint_enabled_| for details.
static void EnableDebugPaint();