| 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/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 this, | 353 this, |
| 354 this), | 354 this), |
| 355 is_loading_(false), | 355 is_loading_(false), |
| 356 is_load_to_different_document_(false), | 356 is_load_to_different_document_(false), |
| 357 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), | 357 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), |
| 358 crashed_error_code_(0), | 358 crashed_error_code_(0), |
| 359 waiting_for_response_(false), | 359 waiting_for_response_(false), |
| 360 load_state_(net::LOAD_STATE_IDLE, base::string16()), | 360 load_state_(net::LOAD_STATE_IDLE, base::string16()), |
| 361 upload_size_(0), | 361 upload_size_(0), |
| 362 upload_position_(0), | 362 upload_position_(0), |
| 363 is_resume_pending_(false), |
| 363 displayed_insecure_content_(false), | 364 displayed_insecure_content_(false), |
| 364 has_accessed_initial_document_(false), | 365 has_accessed_initial_document_(false), |
| 365 theme_color_(SK_ColorTRANSPARENT), | 366 theme_color_(SK_ColorTRANSPARENT), |
| 366 last_sent_theme_color_(SK_ColorTRANSPARENT), | 367 last_sent_theme_color_(SK_ColorTRANSPARENT), |
| 367 did_first_visually_non_empty_paint_(false), | 368 did_first_visually_non_empty_paint_(false), |
| 368 capturer_count_(0), | 369 capturer_count_(0), |
| 369 should_normally_be_visible_(true), | 370 should_normally_be_visible_(true), |
| 370 is_being_destroyed_(false), | 371 is_being_destroyed_(false), |
| 371 notify_disconnection_(false), | 372 notify_disconnection_(false), |
| 372 dialog_manager_(NULL), | 373 dialog_manager_(NULL), |
| (...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1810 #endif | 1811 #endif |
| 1811 } | 1812 } |
| 1812 | 1813 |
| 1813 void WebContentsImpl::ShowCreatedWindow(int route_id, | 1814 void WebContentsImpl::ShowCreatedWindow(int route_id, |
| 1814 WindowOpenDisposition disposition, | 1815 WindowOpenDisposition disposition, |
| 1815 const gfx::Rect& initial_rect, | 1816 const gfx::Rect& initial_rect, |
| 1816 bool user_gesture) { | 1817 bool user_gesture) { |
| 1817 WebContentsImpl* contents = GetCreatedWindow(route_id); | 1818 WebContentsImpl* contents = GetCreatedWindow(route_id); |
| 1818 if (contents) { | 1819 if (contents) { |
| 1819 WebContentsDelegate* delegate = GetDelegate(); | 1820 WebContentsDelegate* delegate = GetDelegate(); |
| 1821 contents->is_resume_pending_ = true; |
| 1820 if (!delegate || delegate->ShouldResumeRequestsForCreatedWindow()) | 1822 if (!delegate || delegate->ShouldResumeRequestsForCreatedWindow()) |
| 1821 contents->ResumeLoadingCreatedWebContents(); | 1823 contents->ResumeLoadingCreatedWebContents(); |
| 1822 | 1824 |
| 1823 if (delegate) { | 1825 if (delegate) { |
| 1824 delegate->AddNewContents( | 1826 delegate->AddNewContents( |
| 1825 this, contents, disposition, initial_rect, user_gesture, NULL); | 1827 this, contents, disposition, initial_rect, user_gesture, NULL); |
| 1826 } | 1828 } |
| 1827 } | 1829 } |
| 1828 } | 1830 } |
| 1829 | 1831 |
| (...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2660 | 2662 |
| 2661 void WebContentsImpl::ExitFullscreen() { | 2663 void WebContentsImpl::ExitFullscreen() { |
| 2662 // Clean up related state and initiate the fullscreen exit. | 2664 // Clean up related state and initiate the fullscreen exit. |
| 2663 GetRenderViewHost()->RejectMouseLockOrUnlockIfNecessary(); | 2665 GetRenderViewHost()->RejectMouseLockOrUnlockIfNecessary(); |
| 2664 ExitFullscreenMode(); | 2666 ExitFullscreenMode(); |
| 2665 } | 2667 } |
| 2666 | 2668 |
| 2667 void WebContentsImpl::ResumeLoadingCreatedWebContents() { | 2669 void WebContentsImpl::ResumeLoadingCreatedWebContents() { |
| 2668 // Resume blocked requests for both the RenderViewHost and RenderFrameHost. | 2670 // Resume blocked requests for both the RenderViewHost and RenderFrameHost. |
| 2669 // TODO(brettw): It seems bogus to reach into here and initialize the host. | 2671 // TODO(brettw): It seems bogus to reach into here and initialize the host. |
| 2670 GetRenderViewHost()->Init(); | 2672 if (is_resume_pending_) { |
| 2671 GetMainFrame()->Init(); | 2673 is_resume_pending_ = false; |
| 2674 GetRenderViewHost()->Init(); |
| 2675 GetMainFrame()->Init(); |
| 2676 } |
| 2672 } | 2677 } |
| 2673 | 2678 |
| 2674 bool WebContentsImpl::FocusLocationBarByDefault() { | 2679 bool WebContentsImpl::FocusLocationBarByDefault() { |
| 2675 NavigationEntry* entry = controller_.GetVisibleEntry(); | 2680 NavigationEntry* entry = controller_.GetVisibleEntry(); |
| 2676 if (entry && entry->GetURL() == GURL(url::kAboutBlankURL)) | 2681 if (entry && entry->GetURL() == GURL(url::kAboutBlankURL)) |
| 2677 return true; | 2682 return true; |
| 2678 return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this); | 2683 return delegate_ && delegate_->ShouldFocusLocationBarByDefault(this); |
| 2679 } | 2684 } |
| 2680 | 2685 |
| 2681 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { | 2686 void WebContentsImpl::SetFocusToLocationBar(bool select_all) { |
| (...skipping 1814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4496 player_map->erase(it); | 4501 player_map->erase(it); |
| 4497 } | 4502 } |
| 4498 | 4503 |
| 4499 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4504 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
| 4500 force_disable_overscroll_content_ = force_disable; | 4505 force_disable_overscroll_content_ = force_disable; |
| 4501 if (view_) | 4506 if (view_) |
| 4502 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4507 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
| 4503 } | 4508 } |
| 4504 | 4509 |
| 4505 } // namespace content | 4510 } // namespace content |
| OLD | NEW |