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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_win.h" 5 #include "content/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <peninputpanel_i.c> 8 #include <peninputpanel_i.c>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 #include "ui/base/ime/composition_text.h" 48 #include "ui/base/ime/composition_text.h"
49 #include "ui/base/l10n/l10n_util_win.h" 49 #include "ui/base/l10n/l10n_util_win.h"
50 #include "ui/base/text/text_elider.h" 50 #include "ui/base/text/text_elider.h"
51 #include "ui/base/view_prop.h" 51 #include "ui/base/view_prop.h"
52 #include "ui/base/win/hwnd_util.h" 52 #include "ui/base/win/hwnd_util.h"
53 #include "ui/base/win/mouse_wheel_util.h" 53 #include "ui/base/win/mouse_wheel_util.h"
54 #include "ui/gfx/canvas.h" 54 #include "ui/gfx/canvas.h"
55 #include "ui/gfx/canvas_skia.h" 55 #include "ui/gfx/canvas_skia.h"
56 #include "ui/gfx/gdi_util.h" 56 #include "ui/gfx/gdi_util.h"
57 #include "ui/gfx/rect.h" 57 #include "ui/gfx/rect.h"
58 #include "ui/gfx/scoped_sk_region.h"
58 #include "ui/gfx/screen.h" 59 #include "ui/gfx/screen.h"
59 #include "webkit/glue/webaccessibility.h" 60 #include "webkit/glue/webaccessibility.h"
60 #include "webkit/glue/webcursor.h" 61 #include "webkit/glue/webcursor.h"
61 #include "webkit/plugins/npapi/plugin_constants_win.h" 62 #include "webkit/plugins/npapi/plugin_constants_win.h"
62 #include "webkit/plugins/npapi/webplugin.h" 63 #include "webkit/plugins/npapi/webplugin.h"
63 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" 64 #include "webkit/plugins/npapi/webplugin_delegate_impl.h"
64 65
65 using base::TimeDelta; 66 using base::TimeDelta;
66 using base::TimeTicks; 67 using base::TimeTicks;
67 using content::BrowserThread; 68 using content::BrowserThread;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 weak_factory_(this), 322 weak_factory_(this),
322 parent_hwnd_(NULL), 323 parent_hwnd_(NULL),
323 is_loading_(false), 324 is_loading_(false),
324 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), 325 text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
325 is_fullscreen_(false), 326 is_fullscreen_(false),
326 ignore_mouse_movement_(true), 327 ignore_mouse_movement_(true),
327 composition_range_(ui::Range::InvalidRange()), 328 composition_range_(ui::Range::InvalidRange()),
328 touch_state_(this), 329 touch_state_(this),
329 pointer_down_context_(false), 330 pointer_down_context_(false),
330 focus_on_editable_field_(false), 331 focus_on_editable_field_(false),
331 received_focus_change_after_pointer_down_(false) { 332 received_focus_change_after_pointer_down_(false),
333 transparent_region_(0) {
332 render_widget_host_->SetView(this); 334 render_widget_host_->SetView(this);
333 registrar_.Add(this, 335 registrar_.Add(this,
334 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, 336 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
335 content::NotificationService::AllBrowserContextsAndSources()); 337 content::NotificationService::AllBrowserContextsAndSources());
336 registrar_.Add(this, 338 registrar_.Add(this,
337 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, 339 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
338 content::NotificationService::AllBrowserContextsAndSources()); 340 content::NotificationService::AllBrowserContextsAndSources());
339 } 341 }
340 342
341 RenderWidgetHostViewWin::~RenderWidgetHostViewWin() { 343 RenderWidgetHostViewWin::~RenderWidgetHostViewWin() {
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); 1150 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
1149 dc->FillRect(&dirty_rect, white_brush); 1151 dc->FillRect(&dirty_rect, white_brush);
1150 } 1152 }
1151 } 1153 }
1152 1154
1153 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) { 1155 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) {
1154 // Do nothing. This suppresses the resize corner that Windows would 1156 // Do nothing. This suppresses the resize corner that Windows would
1155 // otherwise draw for us. 1157 // otherwise draw for us.
1156 } 1158 }
1157 1159
1160 void RenderWidgetHostViewWin::SetClickthroughRegion(SkRegion* region) {
1161 if (transparent_region_.Get())
1162 transparent_region_.release();
1163 transparent_region_.Set(region);
1164 }
1165
1166 LRESULT RenderWidgetHostViewWin::OnNCHitTest(const CPoint& point) {
1167 RECT rc;
1168 GetWindowRect(&rc);
1169 if (transparent_region_.Get() &&
1170 transparent_region_.Get()->contains(point.x - rc.left,
1171 point.y - rc.top)) {
1172 SetMsgHandled(TRUE);
1173 return HTTRANSPARENT;
1174 }
1175 SetMsgHandled(FALSE);
1176 return 0;
1177 }
1178
1158 LRESULT RenderWidgetHostViewWin::OnEraseBkgnd(HDC dc) { 1179 LRESULT RenderWidgetHostViewWin::OnEraseBkgnd(HDC dc) {
1159 return 1; 1180 return 1;
1160 } 1181 }
1161 1182
1162 LRESULT RenderWidgetHostViewWin::OnSetCursor(HWND window, UINT hittest_code, 1183 LRESULT RenderWidgetHostViewWin::OnSetCursor(HWND window, UINT hittest_code,
1163 UINT mouse_message_id) { 1184 UINT mouse_message_id) {
1164 UpdateCursorIfOverSelf(); 1185 UpdateCursorIfOverSelf();
1165 return 0; 1186 return 0;
1166 } 1187 }
1167 1188
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
2593 void RenderWidgetHostViewWin::ResetPointerDownContext() { 2614 void RenderWidgetHostViewWin::ResetPointerDownContext() {
2594 // If the default focus on the page is on an edit field and we did not 2615 // If the default focus on the page is on an edit field and we did not
2595 // receive a focus change in the context of a pointer down message, it means 2616 // receive a focus change in the context of a pointer down message, it means
2596 // that the pointer down message occurred on the edit field and we should 2617 // that the pointer down message occurred on the edit field and we should
2597 // display the on screen keyboard 2618 // display the on screen keyboard
2598 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 2619 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
2599 DisplayOnScreenKeyboardIfNeeded(); 2620 DisplayOnScreenKeyboardIfNeeded();
2600 received_focus_change_after_pointer_down_ = false; 2621 received_focus_change_after_pointer_down_ = false;
2601 pointer_down_context_ = false; 2622 pointer_down_context_ = false;
2602 } 2623 }
OLDNEW
« 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