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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 983973002: Revert of Refactor the loading tracking logic in WebContentsImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed patch conflict Created 5 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 case blink::WebTextDirectionRightToLeft: 98 case blink::WebTextDirectionRightToLeft:
99 return base::i18n::RIGHT_TO_LEFT; 99 return base::i18n::RIGHT_TO_LEFT;
100 default: 100 default:
101 NOTREACHED(); 101 NOTREACHED();
102 return base::i18n::UNKNOWN_DIRECTION; 102 return base::i18n::UNKNOWN_DIRECTION;
103 } 103 }
104 } 104 }
105 105
106 } // namespace 106 } // namespace
107 107
108 const double RenderFrameHostImpl::kLoadingProgressNotStarted = 0.0;
109 const double RenderFrameHostImpl::kLoadingProgressMinimum = 0.1;
110 const double RenderFrameHostImpl::kLoadingProgressDone = 1.0;
111
112 // static 108 // static
113 bool RenderFrameHostImpl::IsRFHStateActive(RenderFrameHostImplState rfh_state) { 109 bool RenderFrameHostImpl::IsRFHStateActive(RenderFrameHostImplState rfh_state) {
114 return rfh_state == STATE_DEFAULT; 110 return rfh_state == STATE_DEFAULT;
115 } 111 }
116 112
117 // static 113 // static
118 RenderFrameHost* RenderFrameHost::FromID(int render_process_id, 114 RenderFrameHost* RenderFrameHost::FromID(int render_process_id,
119 int render_frame_id) { 115 int render_frame_id) {
120 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id); 116 return RenderFrameHostImpl::FromID(render_process_id, render_frame_id);
121 } 117 }
(...skipping 25 matching lines...) Expand all
147 frame_tree_(frame_tree), 143 frame_tree_(frame_tree),
148 frame_tree_node_(frame_tree_node), 144 frame_tree_node_(frame_tree_node),
149 routing_id_(routing_id), 145 routing_id_(routing_id),
150 render_frame_created_(false), 146 render_frame_created_(false),
151 navigations_suspended_(false), 147 navigations_suspended_(false),
152 has_beforeunload_handlers_(false), 148 has_beforeunload_handlers_(false),
153 has_unload_handlers_(false), 149 has_unload_handlers_(false),
154 override_sudden_termination_status_(false), 150 override_sudden_termination_status_(false),
155 is_waiting_for_beforeunload_ack_(false), 151 is_waiting_for_beforeunload_ack_(false),
156 unload_ack_is_for_navigation_(false), 152 unload_ack_is_for_navigation_(false),
157 is_loading_(false),
158 loading_progress_(kLoadingProgressNotStarted),
159 accessibility_reset_token_(0), 153 accessibility_reset_token_(0),
160 accessibility_reset_count_(0), 154 accessibility_reset_count_(0),
161 no_create_browser_accessibility_manager_for_testing_(false), 155 no_create_browser_accessibility_manager_for_testing_(false),
162 weak_ptr_factory_(this) { 156 weak_ptr_factory_(this) {
163 bool is_swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); 157 bool is_swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT);
164 bool hidden = !!(flags & CREATE_RF_HIDDEN); 158 bool hidden = !!(flags & CREATE_RF_HIDDEN);
165 frame_tree_->RegisterRenderFrameHost(this); 159 frame_tree_->RegisterRenderFrameHost(this);
166 GetProcess()->AddRoute(routing_id_, this); 160 GetProcess()->AddRoute(routing_id_, this);
167 g_routing_id_frame_map.Get().insert(std::make_pair( 161 g_routing_id_frame_map.Get().insert(std::make_pair(
168 RenderFrameHostID(GetProcess()->GetID(), routing_id_), 162 RenderFrameHostID(GetProcess()->GetID(), routing_id_),
(...skipping 1789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 void RenderFrameHostImpl::DidUseGeolocationPermission() { 1952 void RenderFrameHostImpl::DidUseGeolocationPermission() {
1959 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); 1953 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame();
1960 GetContentClient()->browser()->RegisterPermissionUsage( 1954 GetContentClient()->browser()->RegisterPermissionUsage(
1961 PERMISSION_GEOLOCATION, 1955 PERMISSION_GEOLOCATION,
1962 delegate_->GetAsWebContents(), 1956 delegate_->GetAsWebContents(),
1963 GetLastCommittedURL().GetOrigin(), 1957 GetLastCommittedURL().GetOrigin(),
1964 top_frame->GetLastCommittedURL().GetOrigin()); 1958 top_frame->GetLastCommittedURL().GetOrigin());
1965 } 1959 }
1966 1960
1967 } // namespace content 1961 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698