Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1214723012: Track whether a created WebContents has a resume pending. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing logic Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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->SetIsResumePending();
Maria 2015/07/08 21:02:51 I think it's a bit odd to keep this set if the del
gone 2015/07/08 21:04:45 The current codepath resumes loading of the WebCon
Maria 2015/07/08 21:20:29 Oops, you are right, I misread the code. This is f
jam 2015/07/09 16:50:28 it seems there's no need for a function, and this
gone 2015/07/09 17:11:49 Done.
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
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_) {
jam 2015/07/09 16:50:28 shouldn't this be a CHECK(is_resume_pending_)?
gone 2015/07/09 17:11:49 It could be, but that'd require exposing an IsResu
jam 2015/07/10 16:35:41 oh, the java side always calls through to this eve
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
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
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698