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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "ui/base/ime/composition_text.h" 47 #include "ui/base/ime/composition_text.h"
48 #include "ui/base/l10n/l10n_util_win.h" 48 #include "ui/base/l10n/l10n_util_win.h"
49 #include "ui/base/text/text_elider.h" 49 #include "ui/base/text/text_elider.h"
50 #include "ui/base/view_prop.h" 50 #include "ui/base/view_prop.h"
51 #include "ui/base/win/hwnd_util.h" 51 #include "ui/base/win/hwnd_util.h"
52 #include "ui/base/win/mouse_wheel_util.h" 52 #include "ui/base/win/mouse_wheel_util.h"
53 #include "ui/gfx/canvas.h" 53 #include "ui/gfx/canvas.h"
54 #include "ui/gfx/canvas_skia.h" 54 #include "ui/gfx/canvas_skia.h"
55 #include "ui/gfx/gdi_util.h" 55 #include "ui/gfx/gdi_util.h"
56 #include "ui/gfx/rect.h" 56 #include "ui/gfx/rect.h"
57 #include "ui/gfx/scoped_sk_region.h"
57 #include "ui/gfx/screen.h" 58 #include "ui/gfx/screen.h"
58 #include "webkit/glue/webaccessibility.h" 59 #include "webkit/glue/webaccessibility.h"
59 #include "webkit/glue/webcursor.h" 60 #include "webkit/glue/webcursor.h"
60 #include "webkit/plugins/npapi/plugin_constants_win.h" 61 #include "webkit/plugins/npapi/plugin_constants_win.h"
61 #include "webkit/plugins/npapi/webplugin.h" 62 #include "webkit/plugins/npapi/webplugin.h"
62 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" 63 #include "webkit/plugins/npapi/webplugin_delegate_impl.h"
63 64
64 using base::TimeDelta; 65 using base::TimeDelta;
65 using base::TimeTicks; 66 using base::TimeTicks;
66 using content::BrowserThread; 67 using content::BrowserThread;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 is_loading_(false), 327 is_loading_(false),
327 text_input_type_(ui::TEXT_INPUT_TYPE_NONE), 328 text_input_type_(ui::TEXT_INPUT_TYPE_NONE),
328 is_fullscreen_(false), 329 is_fullscreen_(false),
329 ignore_mouse_movement_(true), 330 ignore_mouse_movement_(true),
330 composition_range_(ui::Range::InvalidRange()), 331 composition_range_(ui::Range::InvalidRange()),
331 ignore_next_lbutton_message_at_same_location(false), 332 ignore_next_lbutton_message_at_same_location(false),
332 last_pointer_down_location_(0), 333 last_pointer_down_location_(0),
333 touch_state_(this), 334 touch_state_(this),
334 pointer_down_context_(false), 335 pointer_down_context_(false),
335 focus_on_editable_field_(false), 336 focus_on_editable_field_(false),
336 received_focus_change_after_pointer_down_(false) { 337 received_focus_change_after_pointer_down_(false),
338 transparent_region_(0) {
337 render_widget_host_->SetView(this); 339 render_widget_host_->SetView(this);
338 registrar_.Add(this, 340 registrar_.Add(this,
339 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, 341 content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
340 content::NotificationService::AllBrowserContextsAndSources()); 342 content::NotificationService::AllBrowserContextsAndSources());
341 registrar_.Add(this, 343 registrar_.Add(this,
342 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, 344 content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
343 content::NotificationService::AllBrowserContextsAndSources()); 345 content::NotificationService::AllBrowserContextsAndSources());
344 } 346 }
345 347
346 RenderWidgetHostViewWin::~RenderWidgetHostViewWin() { 348 RenderWidgetHostViewWin::~RenderWidgetHostViewWin() {
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); 1143 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
1142 dc->FillRect(&dirty_rect, white_brush); 1144 dc->FillRect(&dirty_rect, white_brush);
1143 } 1145 }
1144 } 1146 }
1145 1147
1146 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) { 1148 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) {
1147 // Do nothing. This suppresses the resize corner that Windows would 1149 // Do nothing. This suppresses the resize corner that Windows would
1148 // otherwise draw for us. 1150 // otherwise draw for us.
1149 } 1151 }
1150 1152
1153 void RenderWidgetHostViewWin::SetTransparentRegion(SkRegion* region) {
1154 if (transparent_region_.Get())
1155 transparent_region_.release();
sail 2012/02/24 04:19:09 quick question, why do you need to do a release he
1156 transparent_region_.Set(region);
1157 }
1158
1159 LRESULT RenderWidgetHostViewWin::OnNCHitTest(const CPoint& point) {
1160 RECT rc;
1161 GetWindowRect(&rc);
1162 if (transparent_region_.Get() &&
1163 transparent_region_.Get()->contains(point.x - rc.left,
1164 point.y - rc.top)) {
1165 SetMsgHandled(TRUE);
1166 return HTTRANSPARENT;
1167 }
1168 SetMsgHandled(FALSE);
1169 return 0;
1170 }
1171
1151 LRESULT RenderWidgetHostViewWin::OnEraseBkgnd(HDC dc) { 1172 LRESULT RenderWidgetHostViewWin::OnEraseBkgnd(HDC dc) {
1152 return 1; 1173 return 1;
1153 } 1174 }
1154 1175
1155 LRESULT RenderWidgetHostViewWin::OnSetCursor(HWND window, UINT hittest_code, 1176 LRESULT RenderWidgetHostViewWin::OnSetCursor(HWND window, UINT hittest_code,
1156 UINT mouse_message_id) { 1177 UINT mouse_message_id) {
1157 UpdateCursorIfOverSelf(); 1178 UpdateCursorIfOverSelf();
1158 return 0; 1179 return 0;
1159 } 1180 }
1160 1181
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
2601 void RenderWidgetHostViewWin::ResetPointerDownContext() { 2622 void RenderWidgetHostViewWin::ResetPointerDownContext() {
2602 // If the default focus on the page is on an edit field and we did not 2623 // If the default focus on the page is on an edit field and we did not
2603 // receive a focus change in the context of a pointer down message, it means 2624 // receive a focus change in the context of a pointer down message, it means
2604 // that the pointer down message occurred on the edit field and we should 2625 // that the pointer down message occurred on the edit field and we should
2605 // display the on screen keyboard 2626 // display the on screen keyboard
2606 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 2627 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
2607 DisplayOnScreenKeyboardIfNeeded(); 2628 DisplayOnScreenKeyboardIfNeeded();
2608 received_focus_change_after_pointer_down_ = false; 2629 received_focus_change_after_pointer_down_ = false;
2609 pointer_down_context_ = false; 2630 pointer_down_context_ = false;
2610 } 2631 }
OLDNEW
« 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