| 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 "content/browser/web_contents/test_web_contents.h" | 5 #include "content/browser/web_contents/test_web_contents.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "content/browser/browser_url_handler_impl.h" | 9 #include "content/browser/browser_url_handler_impl.h" |
| 10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 ViewHostMsg_FrameNavigate_Params params; | 70 ViewHostMsg_FrameNavigate_Params params; |
| 71 | 71 |
| 72 params.page_id = page_id; | 72 params.page_id = page_id; |
| 73 params.url = url; | 73 params.url = url; |
| 74 params.referrer = referrer; | 74 params.referrer = referrer; |
| 75 params.transition = transition; | 75 params.transition = transition; |
| 76 params.redirects = std::vector<GURL>(); | 76 params.redirects = std::vector<GURL>(); |
| 77 params.should_update_history = false; | 77 params.should_update_history = false; |
| 78 params.searchable_form_url = GURL(); | 78 params.searchable_form_url = GURL(); |
| 79 params.searchable_form_encoding = std::string(); | 79 params.searchable_form_encoding = std::string(); |
| 80 params.password_form = content::PasswordForm(); | 80 params.password_form = PasswordForm(); |
| 81 params.security_info = std::string(); | 81 params.security_info = std::string(); |
| 82 params.gesture = NavigationGestureUser; | 82 params.gesture = NavigationGestureUser; |
| 83 params.was_within_same_page = false; | 83 params.was_within_same_page = false; |
| 84 params.is_post = false; | 84 params.is_post = false; |
| 85 params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); | 85 params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); |
| 86 | 86 |
| 87 DidNavigate(render_view_host, params); | 87 DidNavigate(render_view_host, params); |
| 88 } | 88 } |
| 89 | 89 |
| 90 webkit_glue::WebPreferences TestWebContents::TestGetWebkitPrefs() { | 90 webkit_glue::WebPreferences TestWebContents::TestGetWebkitPrefs() { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 RenderViewHostDelegateView* TestWebContents::GetDelegateView() { | 167 RenderViewHostDelegateView* TestWebContents::GetDelegateView() { |
| 168 if (delegate_view_override_) | 168 if (delegate_view_override_) |
| 169 return delegate_view_override_; | 169 return delegate_view_override_; |
| 170 return WebContentsImpl::GetDelegateView(); | 170 return WebContentsImpl::GetDelegateView(); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void TestWebContents::SetOpener(TestWebContents* opener) { | 173 void TestWebContents::SetOpener(TestWebContents* opener) { |
| 174 // This is normally only set in the WebContents constructor, which also | 174 // This is normally only set in the WebContents constructor, which also |
| 175 // registers an observer for when the opener gets closed. | 175 // registers an observer for when the opener gets closed. |
| 176 opener_ = opener; | 176 opener_ = opener; |
| 177 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 177 registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 178 content::Source<WebContents>(opener_)); | 178 Source<WebContents>(opener_)); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void TestWebContents::ExpectSetHistoryLengthAndPrune( | 181 void TestWebContents::ExpectSetHistoryLengthAndPrune( |
| 182 const SiteInstance* site_instance, | 182 const SiteInstance* site_instance, |
| 183 int history_length, | 183 int history_length, |
| 184 int32 min_page_id) { | 184 int32 min_page_id) { |
| 185 expect_set_history_length_and_prune_ = true; | 185 expect_set_history_length_and_prune_ = true; |
| 186 expect_set_history_length_and_prune_site_instance_ = | 186 expect_set_history_length_and_prune_site_instance_ = |
| 187 static_cast<const SiteInstanceImpl*>(site_instance); | 187 static_cast<const SiteInstanceImpl*>(site_instance); |
| 188 expect_set_history_length_and_prune_history_length_ = history_length; | 188 expect_set_history_length_and_prune_history_length_ = history_length; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 } | 220 } |
| 221 | 221 |
| 222 void TestWebContents::ShowCreatedWidget(int route_id, | 222 void TestWebContents::ShowCreatedWidget(int route_id, |
| 223 const gfx::Rect& initial_pos) { | 223 const gfx::Rect& initial_pos) { |
| 224 } | 224 } |
| 225 | 225 |
| 226 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { | 226 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace content | 229 } // namespace content |
| OLD | NEW |