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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build Created 8 years, 1 month 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 <map> 8 #include <map>
9 #include <peninputpanel_i.c> 9 #include <peninputpanel_i.c>
10 #include <stack> 10 #include <stack>
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 SetBrowserAccessibilityManager( 630 SetBrowserAccessibilityManager(
631 BrowserAccessibilityManager::CreateEmptyDocument( 631 BrowserAccessibilityManager::CreateEmptyDocument(
632 m_hWnd, busy_state, this)); 632 m_hWnd, busy_state, this));
633 } 633 }
634 634
635 return GetBrowserAccessibilityManager()->GetRoot()-> 635 return GetBrowserAccessibilityManager()->GetRoot()->
636 ToBrowserAccessibilityWin(); 636 ToBrowserAccessibilityWin();
637 } 637 }
638 638
639 void RenderWidgetHostViewWin::MovePluginWindows( 639 void RenderWidgetHostViewWin::MovePluginWindows(
640 const gfx::Point& scroll_offset, 640 const gfx::Vector2d& scroll_offset,
641 const std::vector<webkit::npapi::WebPluginGeometry>& plugin_window_moves) { 641 const std::vector<webkit::npapi::WebPluginGeometry>& plugin_window_moves) {
642 MovePluginWindowsHelper(m_hWnd, plugin_window_moves); 642 MovePluginWindowsHelper(m_hWnd, plugin_window_moves);
643 } 643 }
644 644
645 static BOOL CALLBACK AddChildWindowToVector(HWND hwnd, LPARAM lparam) { 645 static BOOL CALLBACK AddChildWindowToVector(HWND hwnd, LPARAM lparam) {
646 std::vector<HWND>* vector = reinterpret_cast<std::vector<HWND>*>(lparam); 646 std::vector<HWND>* vector = reinterpret_cast<std::vector<HWND>*>(lparam);
647 vector->push_back(hwnd); 647 vector->push_back(hwnd);
648 return TRUE; 648 return TRUE;
649 } 649 }
650 650
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 if (whiteout_start_time_.is_null()) 1421 if (whiteout_start_time_.is_null())
1422 whiteout_start_time_ = TimeTicks::Now(); 1422 whiteout_start_time_ = TimeTicks::Now();
1423 } 1423 }
1424 } 1424 }
1425 1425
1426 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect, 1426 void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect,
1427 CPaintDC* dc) { 1427 CPaintDC* dc) {
1428 if (!background_.empty()) { 1428 if (!background_.empty()) {
1429 gfx::Rect dirty_area(dirty_rect); 1429 gfx::Rect dirty_area(dirty_rect);
1430 gfx::Canvas canvas(dirty_area.size(), ui::SCALE_FACTOR_100P, true); 1430 gfx::Canvas canvas(dirty_area.size(), ui::SCALE_FACTOR_100P, true);
1431 canvas.Translate(gfx::Point().Subtract(dirty_area.origin())); 1431 canvas.Translate(-dirty_area.DistanceFromOrigin());
1432 1432
1433 gfx::Rect dc_rect(dc->m_ps.rcPaint); 1433 gfx::Rect dc_rect(dc->m_ps.rcPaint);
1434 // TODO(pkotwicz): Fix |background_| such that it is an ImageSkia. 1434 // TODO(pkotwicz): Fix |background_| such that it is an ImageSkia.
1435 canvas.TileImageInt(gfx::ImageSkia(background_), 1435 canvas.TileImageInt(gfx::ImageSkia(background_),
1436 0, 0, dc_rect.width(), dc_rect.height()); 1436 0, 0, dc_rect.width(), dc_rect.height());
1437 1437
1438 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(), 1438 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_area.x(),
1439 dirty_area.y(), NULL); 1439 dirty_area.y(), NULL);
1440 } else { 1440 } else {
1441 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); 1441 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH));
(...skipping 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after
3111 // receive a focus change in the context of a pointer down message, it means 3111 // receive a focus change in the context of a pointer down message, it means
3112 // that the pointer down message occurred on the edit field and we should 3112 // that the pointer down message occurred on the edit field and we should
3113 // display the on screen keyboard 3113 // display the on screen keyboard
3114 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) 3114 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_)
3115 DisplayOnScreenKeyboardIfNeeded(); 3115 DisplayOnScreenKeyboardIfNeeded();
3116 received_focus_change_after_pointer_down_ = false; 3116 received_focus_change_after_pointer_down_ = false;
3117 pointer_down_context_ = false; 3117 pointer_down_context_ = false;
3118 } 3118 }
3119 3119
3120 } // namespace content 3120 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698