OLD | NEW |
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 "chrome/renderer/automation/automation_renderer_helper.h" | 5 #include "chrome/renderer/automation/automation_renderer_helper.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 frame->setCanHaveScrollbars(false); | 63 frame->setCanHaveScrollbars(false); |
64 view->setFixedLayoutSize(old_size); | 64 view->setFixedLayoutSize(old_size); |
65 view->enableFixedLayoutMode(true); | 65 view->enableFixedLayoutMode(true); |
66 view->resize(new_size); | 66 view->resize(new_size); |
67 view->layout(); | 67 view->layout(); |
68 frame->setScrollOffset(WebSize(0, 0)); | 68 frame->setScrollOffset(WebSize(0, 0)); |
69 | 69 |
70 skia::ScopedPlatformCanvas canvas(new_size.width, new_size.height, true); | 70 skia::ScopedPlatformCanvas canvas(new_size.width, new_size.height, true); |
71 | 71 |
72 view->paint(webkit_glue::ToWebCanvas(canvas), | 72 view->paint(webkit_glue::ToWebCanvas(canvas.get()), |
73 gfx::Rect(0, 0, new_size.width, new_size.height)); | 73 gfx::Rect(0, 0, new_size.width, new_size.height)); |
74 | 74 |
75 frame->setCanHaveScrollbars(true); | 75 frame->setCanHaveScrollbars(true); |
76 view->setFixedLayoutSize(fixed_size); | 76 view->setFixedLayoutSize(fixed_size); |
77 view->enableFixedLayoutMode(fixed_layout_enabled); | 77 view->enableFixedLayoutMode(fixed_layout_enabled); |
78 view->resize(old_size); | 78 view->resize(old_size); |
79 view->layout(); | 79 view->layout(); |
80 frame->setScrollOffset(WebSize(old_scroll.width - min_scroll.width, | 80 frame->setScrollOffset(WebSize(old_scroll.width - min_scroll.width, |
81 old_scroll.height - min_scroll.height)); | 81 old_scroll.height - min_scroll.height)); |
82 | 82 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 routing_id(), frame->identifier())); | 281 routing_id(), frame->identifier())); |
282 } | 282 } |
283 | 283 |
284 void AutomationRendererHelper::OnProcessMouseEvent( | 284 void AutomationRendererHelper::OnProcessMouseEvent( |
285 const AutomationMouseEvent& event) { | 285 const AutomationMouseEvent& event) { |
286 std::string error_msg; | 286 std::string error_msg; |
287 bool success = ProcessMouseEvent(event, &error_msg); | 287 bool success = ProcessMouseEvent(event, &error_msg); |
288 Send(new AutomationMsg_ProcessMouseEventACK( | 288 Send(new AutomationMsg_ProcessMouseEventACK( |
289 routing_id(), success, error_msg)); | 289 routing_id(), success, error_msg)); |
290 } | 290 } |
OLD | NEW |