OLD | NEW |
1 | 1 |
2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "content/browser/browser_url_handler.h" | 6 #include "content/browser/browser_url_handler.h" |
7 #include "content/browser/renderer_host/test_backing_store.h" | 7 #include "content/browser/renderer_host/test_backing_store.h" |
8 #include "content/browser/renderer_host/test_render_view_host.h" | 8 #include "content/browser/renderer_host/test_render_view_host.h" |
9 #include "content/browser/site_instance.h" | 9 #include "content/browser/site_instance.h" |
10 #include "content/browser/tab_contents/navigation_controller.h" | 10 #include "content/browser/tab_contents/navigation_controller.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 params->searchable_form_url = GURL(); | 33 params->searchable_form_url = GURL(); |
34 params->searchable_form_encoding = std::string(); | 34 params->searchable_form_encoding = std::string(); |
35 params->password_form = PasswordForm(); | 35 params->password_form = PasswordForm(); |
36 params->security_info = std::string(); | 36 params->security_info = std::string(); |
37 params->gesture = NavigationGestureUser; | 37 params->gesture = NavigationGestureUser; |
38 params->was_within_same_page = false; | 38 params->was_within_same_page = false; |
39 params->is_post = false; | 39 params->is_post = false; |
40 params->content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); | 40 params->content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); |
41 } | 41 } |
42 | 42 |
| 43 void SimulateUpdateRect(RenderWidgetHost* widget, |
| 44 TransportDIB::Id bitmap, |
| 45 const gfx::Rect& rect) { |
| 46 ViewHostMsg_UpdateRect_Params params; |
| 47 params.bitmap_rect = rect; |
| 48 params.view_size = params.bitmap_rect.size(); |
| 49 params.copy_rects.push_back(params.bitmap_rect); |
| 50 params.flags = 0; |
| 51 params.bitmap = bitmap; |
| 52 |
| 53 ViewHostMsg_UpdateRect msg(1, params); |
| 54 widget->OnMessageReceived(msg); |
| 55 } |
| 56 |
43 TestRenderViewHost::TestRenderViewHost(SiteInstance* instance, | 57 TestRenderViewHost::TestRenderViewHost(SiteInstance* instance, |
44 RenderViewHostDelegate* delegate, | 58 RenderViewHostDelegate* delegate, |
45 int routing_id) | 59 int routing_id) |
46 : RenderViewHost(instance, delegate, routing_id, | 60 : RenderViewHost(instance, delegate, routing_id, |
47 kInvalidSessionStorageNamespaceId), | 61 kInvalidSessionStorageNamespaceId), |
48 render_view_created_(false), | 62 render_view_created_(false), |
49 delete_counter_(NULL), | 63 delete_counter_(NULL), |
50 simulate_fetch_via_proxy_(false), | 64 simulate_fetch_via_proxy_(false), |
51 contents_mime_type_("text/html") { | 65 contents_mime_type_("text/html") { |
52 // For normal RenderViewHosts, this is freed when |Shutdown()| is called. | 66 // For normal RenderViewHosts, this is freed when |Shutdown()| is called. |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 SetContents(NULL); | 377 SetContents(NULL); |
364 | 378 |
365 // Make sure that we flush any messages related to TabContents destruction | 379 // Make sure that we flush any messages related to TabContents destruction |
366 // before we destroy the browser context. | 380 // before we destroy the browser context. |
367 MessageLoop::current()->RunAllPending(); | 381 MessageLoop::current()->RunAllPending(); |
368 | 382 |
369 // Release the browser context on the UI thread. | 383 // Release the browser context on the UI thread. |
370 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); | 384 message_loop_.DeleteSoon(FROM_HERE, browser_context_.release()); |
371 message_loop_.RunAllPending(); | 385 message_loop_.RunAllPending(); |
372 } | 386 } |
OLD | NEW |