OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/common/automation_messages.h" | 10 #include "chrome/common/automation_messages.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 WebSize fixed_size = view->fixedLayoutSize(); | 44 WebSize fixed_size = view->fixedLayoutSize(); |
45 | 45 |
46 frame->setCanHaveScrollbars(false); | 46 frame->setCanHaveScrollbars(false); |
47 view->setFixedLayoutSize(old_size); | 47 view->setFixedLayoutSize(old_size); |
48 view->enableFixedLayoutMode(true); | 48 view->enableFixedLayoutMode(true); |
49 view->resize(new_size); | 49 view->resize(new_size); |
50 view->layout(); | 50 view->layout(); |
51 frame->setScrollOffset(WebSize(0, 0)); | 51 frame->setScrollOffset(WebSize(0, 0)); |
52 | 52 |
53 skia::PlatformCanvas canvas( | 53 skia::PlatformCanvas canvas( |
54 new_size.width, new_size.height, true /* is_opaque */); | 54 new_size.width, new_size.height, skia::PlatformDevice::FLAGS_OPAQUE); |
55 view->paint(webkit_glue::ToWebCanvas(&canvas), | 55 view->paint(webkit_glue::ToWebCanvas(&canvas), |
56 gfx::Rect(0, 0, new_size.width, new_size.height)); | 56 gfx::Rect(0, 0, new_size.width, new_size.height)); |
57 | 57 |
58 frame->setCanHaveScrollbars(true); | 58 frame->setCanHaveScrollbars(true); |
59 view->setFixedLayoutSize(fixed_size); | 59 view->setFixedLayoutSize(fixed_size); |
60 view->enableFixedLayoutMode(fixed_layout_enabled); | 60 view->enableFixedLayoutMode(fixed_layout_enabled); |
61 view->resize(old_size); | 61 view->resize(old_size); |
62 view->layout(); | 62 view->layout(); |
63 frame->setScrollOffset(WebSize(old_scroll.width - min_scroll.width, | 63 frame->setScrollOffset(WebSize(old_scroll.width - min_scroll.width, |
64 old_scroll.height - min_scroll.height)); | 64 old_scroll.height - min_scroll.height)); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 void AutomationRendererHelper::DidCancelClientRedirect(WebFrame* frame) { | 126 void AutomationRendererHelper::DidCancelClientRedirect(WebFrame* frame) { |
127 Send(new AutomationMsg_DidCompleteOrCancelClientRedirect( | 127 Send(new AutomationMsg_DidCompleteOrCancelClientRedirect( |
128 routing_id(), frame->identifier())); | 128 routing_id(), frame->identifier())); |
129 } | 129 } |
130 | 130 |
131 void AutomationRendererHelper::DidCompleteClientRedirect( | 131 void AutomationRendererHelper::DidCompleteClientRedirect( |
132 WebFrame* frame, const WebURL& from) { | 132 WebFrame* frame, const WebURL& from) { |
133 Send(new AutomationMsg_DidCompleteOrCancelClientRedirect( | 133 Send(new AutomationMsg_DidCompleteOrCancelClientRedirect( |
134 routing_id(), frame->identifier())); | 134 routing_id(), frame->identifier())); |
135 } | 135 } |
OLD | NEW |