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

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

Issue 11825007: Fix the loading progress bar for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made LoadProgressChanged no only Android Created 7 years, 11 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 | Annotate | Revision Log
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/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 1966 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 int64 parent_frame_id, 1977 int64 parent_frame_id,
1978 bool is_main_frame, 1978 bool is_main_frame,
1979 const GURL& url) { 1979 const GURL& url) {
1980 bool is_error_page = (url.spec() == kUnreachableWebDataURL); 1980 bool is_error_page = (url.spec() == kUnreachableWebDataURL);
1981 bool is_iframe_srcdoc = (url.spec() == chrome::kAboutSrcDocURL); 1981 bool is_iframe_srcdoc = (url.spec() == chrome::kAboutSrcDocURL);
1982 GURL validated_url(url); 1982 GURL validated_url(url);
1983 RenderProcessHost* render_process_host = 1983 RenderProcessHost* render_process_host =
1984 render_view_host->GetProcess(); 1984 render_view_host->GetProcess();
1985 RenderViewHost::FilterURL(render_process_host, false, &validated_url); 1985 RenderViewHost::FilterURL(render_process_host, false, &validated_url);
1986 1986
1987 if (delegate_ && is_main_frame)
1988 delegate_->LoadProgressChanged(this, 0);
1989
1987 // Notify observers about the start of the provisional load. 1990 // Notify observers about the start of the provisional load.
1988 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 1991 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
1989 DidStartProvisionalLoadForFrame(frame_id, parent_frame_id, 1992 DidStartProvisionalLoadForFrame(frame_id, parent_frame_id,
1990 is_main_frame, validated_url, is_error_page, 1993 is_main_frame, validated_url, is_error_page,
1991 is_iframe_srcdoc, render_view_host)); 1994 is_iframe_srcdoc, render_view_host));
1992 1995
1993 if (is_main_frame) { 1996 if (is_main_frame) {
1994 // Notify observers about the provisional change in the main frame URL. 1997 // Notify observers about the provisional change in the main frame URL.
1995 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 1998 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
1996 ProvisionalChangeToMainFrameUrl(validated_url, 1999 ProvisionalChangeToMainFrameUrl(validated_url,
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
2869 } 2872 }
2870 2873
2871 void WebContentsImpl::DidCancelLoading() { 2874 void WebContentsImpl::DidCancelLoading() {
2872 controller_.DiscardNonCommittedEntries(); 2875 controller_.DiscardNonCommittedEntries();
2873 2876
2874 // Update the URL display. 2877 // Update the URL display.
2875 NotifyNavigationStateChanged(INVALIDATE_TYPE_URL); 2878 NotifyNavigationStateChanged(INVALIDATE_TYPE_URL);
2876 } 2879 }
2877 2880
2878 void WebContentsImpl::DidChangeLoadProgress(double progress) { 2881 void WebContentsImpl::DidChangeLoadProgress(double progress) {
2879 #if defined(OS_ANDROID)
2880 if (delegate_) 2882 if (delegate_)
2881 delegate_->LoadProgressChanged(this, progress); 2883 delegate_->LoadProgressChanged(this, progress);
2882 #endif
2883 } 2884 }
2884 2885
2885 void WebContentsImpl::DidDisownOpener(RenderViewHost* rvh) { 2886 void WebContentsImpl::DidDisownOpener(RenderViewHost* rvh) {
2886 // Clear our opener so that future cross-process navigations don't have an 2887 // Clear our opener so that future cross-process navigations don't have an
2887 // opener assigned. 2888 // opener assigned.
2888 opener_ = NULL; 2889 opener_ = NULL;
2889 2890
2890 // Notify all swapped out RenderViewHosts for this tab. This is important 2891 // Notify all swapped out RenderViewHosts for this tab. This is important
2891 // in case we go back to them, or if another window in those processes tries 2892 // in case we go back to them, or if another window in those processes tries
2892 // to access window.opener. 2893 // to access window.opener.
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
3383 3384
3384 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() { 3385 BrowserPluginGuest* WebContentsImpl::GetBrowserPluginGuest() {
3385 return browser_plugin_guest_.get(); 3386 return browser_plugin_guest_.get();
3386 } 3387 }
3387 3388
3388 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() { 3389 BrowserPluginEmbedder* WebContentsImpl::GetBrowserPluginEmbedder() {
3389 return browser_plugin_embedder_.get(); 3390 return browser_plugin_embedder_.get();
3390 } 3391 }
3391 3392
3392 } // namespace content 3393 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698