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 "content/browser/tab_contents/interstitial_page.h" | 5 #include "content/browser/tab_contents/interstitial_page.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/threading/thread.h" | 12 #include "base/threading/thread.h" |
13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
14 #include "content/browser/browser_thread.h" | 14 #include "content/browser/browser_thread.h" |
15 #include "content/browser/content_browser_client.h" | 15 #include "content/browser/content_browser_client.h" |
16 #include "content/browser/renderer_host/render_process_host.h" | 16 #include "content/browser/renderer_host/render_process_host.h" |
17 #include "content/browser/renderer_host/render_view_host.h" | 17 #include "content/browser/renderer_host/render_view_host.h" |
18 #include "content/browser/renderer_host/render_widget_host_view.h" | 18 #include "content/browser/renderer_host/render_widget_host_view.h" |
19 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 19 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
20 #include "content/browser/site_instance.h" | 20 #include "content/browser/site_instance.h" |
21 #include "content/browser/tab_contents/navigation_controller.h" | 21 #include "content/browser/tab_contents/navigation_controller.h" |
22 #include "content/browser/tab_contents/navigation_entry.h" | 22 #include "content/browser/tab_contents/navigation_entry.h" |
23 #include "content/browser/tab_contents/tab_contents.h" | 23 #include "content/browser/tab_contents/tab_contents.h" |
24 #include "content/browser/tab_contents/tab_contents_view.h" | 24 #include "content/browser/tab_contents/tab_contents_view.h" |
25 #include "content/common/dom_storage_common.h" | 25 #include "content/common/dom_storage_common.h" |
26 #include "content/common/notification_service.h" | 26 #include "content/common/notification_service.h" |
27 #include "content/common/notification_source.h" | 27 #include "content/common/notification_source.h" |
28 #include "content/common/page_transition_types.h" | |
29 #include "content/common/view_messages.h" | 28 #include "content/common/view_messages.h" |
30 #include "content/public/common/bindings_policy.h" | 29 #include "content/public/common/bindings_policy.h" |
| 30 #include "content/public/common/page_transition_types.h" |
31 #include "content/public/common/view_types.h" | 31 #include "content/public/common/view_types.h" |
32 #include "net/base/escape.h" | 32 #include "net/base/escape.h" |
33 #include "net/url_request/url_request_context_getter.h" | 33 #include "net/url_request/url_request_context_getter.h" |
34 | 34 |
35 using WebKit::WebDragOperation; | 35 using WebKit::WebDragOperation; |
36 using WebKit::WebDragOperationsMask; | 36 using WebKit::WebDragOperationsMask; |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
40 class ResourceRequestTask : public Task { | 40 class ResourceRequestTask : public Task { |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 void InterstitialPage::DidNavigate( | 328 void InterstitialPage::DidNavigate( |
329 RenderViewHost* render_view_host, | 329 RenderViewHost* render_view_host, |
330 const ViewHostMsg_FrameNavigate_Params& params) { | 330 const ViewHostMsg_FrameNavigate_Params& params) { |
331 // A fast user could have navigated away from the page that triggered the | 331 // A fast user could have navigated away from the page that triggered the |
332 // interstitial while the interstitial was loading, that would have disabled | 332 // interstitial while the interstitial was loading, that would have disabled |
333 // us. In that case we can dismiss ourselves. | 333 // us. In that case we can dismiss ourselves. |
334 if (!enabled_) { | 334 if (!enabled_) { |
335 DontProceed(); | 335 DontProceed(); |
336 return; | 336 return; |
337 } | 337 } |
338 if (params.transition == PageTransition::AUTO_SUBFRAME) { | 338 if (params.transition == content::PAGE_TRANSITION_AUTO_SUBFRAME) { |
339 // No need to handle navigate message from iframe in the interstitial page. | 339 // No need to handle navigate message from iframe in the interstitial page. |
340 return; | 340 return; |
341 } | 341 } |
342 | 342 |
343 // The RenderViewHost has loaded its contents, we can show it now. | 343 // The RenderViewHost has loaded its contents, we can show it now. |
344 render_view_host_->view()->Show(); | 344 render_view_host_->view()->Show(); |
345 tab_->set_interstitial_page(this); | 345 tab_->set_interstitial_page(this); |
346 | 346 |
347 // This notification hides the bookmark bar. Note that this has to happen | 347 // This notification hides the bookmark bar. Note that this has to happen |
348 // after the interstitial page was registered with |tab_|, since there will be | 348 // after the interstitial page was registered with |tab_|, since there will be |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus( | 657 void InterstitialPage::InterstitialPageRVHViewDelegate::TakeFocus( |
658 bool reverse) { | 658 bool reverse) { |
659 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) | 659 if (interstitial_page_->tab() && interstitial_page_->tab()->GetViewDelegate()) |
660 interstitial_page_->tab()->GetViewDelegate()->TakeFocus(reverse); | 660 interstitial_page_->tab()->GetViewDelegate()->TakeFocus(reverse); |
661 } | 661 } |
662 | 662 |
663 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( | 663 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( |
664 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 664 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
665 int active_match_ordinal, bool final_update) { | 665 int active_match_ordinal, bool final_update) { |
666 } | 666 } |
OLD | NEW |