Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(893)

Unified Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 9391024: Custom frame UI for platform apps on Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: "Transparent" -> "Clickthrough", fix patchset Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_win.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc
index 74e7d71b4fdb86bc43c4982064c607dd5fd962e6..36b90501b1967bbdbebad86fbd1b8789b35effa7 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -55,6 +55,7 @@
#include "ui/gfx/canvas_skia.h"
#include "ui/gfx/gdi_util.h"
#include "ui/gfx/rect.h"
+#include "ui/gfx/scoped_sk_region.h"
#include "ui/gfx/screen.h"
#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webcursor.h"
@@ -328,7 +329,8 @@ RenderWidgetHostViewWin::RenderWidgetHostViewWin(RenderWidgetHost* widget)
touch_state_(this),
pointer_down_context_(false),
focus_on_editable_field_(false),
- received_focus_change_after_pointer_down_(false) {
+ received_focus_change_after_pointer_down_(false),
+ transparent_region_(0) {
render_widget_host_->SetView(this);
registrar_.Add(this,
content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
@@ -1155,6 +1157,25 @@ void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) {
// otherwise draw for us.
}
+void RenderWidgetHostViewWin::SetClickthroughRegion(SkRegion* region) {
+ if (transparent_region_.Get())
+ transparent_region_.release();
+ transparent_region_.Set(region);
+}
+
+LRESULT RenderWidgetHostViewWin::OnNCHitTest(const CPoint& point) {
+ RECT rc;
+ GetWindowRect(&rc);
+ if (transparent_region_.Get() &&
+ transparent_region_.Get()->contains(point.x - rc.left,
+ point.y - rc.top)) {
+ SetMsgHandled(TRUE);
+ return HTTRANSPARENT;
+ }
+ SetMsgHandled(FALSE);
+ return 0;
+}
+
LRESULT RenderWidgetHostViewWin::OnEraseBkgnd(HDC dc) {
return 1;
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.h ('k') | content/public/browser/render_widget_host_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698