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

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

Issue 9254046: Custom frame UI for platform apps on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.h ('k') | ui/views/widget/native_widget_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 22efa499362bc12ad74ade7e72fee700990d537f..8b1444ed3b048e768e197d5fb41fa88a86f90133 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -54,6 +54,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"
@@ -333,7 +334,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,
@@ -1148,6 +1150,25 @@ void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) {
// otherwise draw for us.
}
+void RenderWidgetHostViewWin::SetTransparentRegion(SkRegion* region) {
+ if (transparent_region_.Get())
+ transparent_region_.release();
sail 2012/02/24 04:19:09 quick question, why do you need to do a release he
+ 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') | ui/views/widget/native_widget_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698