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

Side by Side Diff: content/browser/frame_host/frame_tree_node.h

Issue 1545973002: Remove the is_loading_ field from WebContentsImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + addressed Nasko's nits Created 4 years, 10 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/frame_host/frame_tree.cc ('k') | content/browser/frame_host/frame_tree_node.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 5 #ifndef CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 6 #define CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 // Returns true if this node is in a state where the loading progress is being 228 // Returns true if this node is in a state where the loading progress is being
229 // tracked. 229 // tracked.
230 bool has_started_loading() const; 230 bool has_started_loading() const;
231 231
232 // Resets this node's loading progress. 232 // Resets this node's loading progress.
233 void reset_loading_progress(); 233 void reset_loading_progress();
234 234
235 // A RenderFrameHost in this node started loading. 235 // A RenderFrameHost in this node started loading.
236 // |to_different_document| will be true unless the load is a fragment 236 // |to_different_document| will be true unless the load is a fragment
237 // navigation, or triggered by history.pushState/replaceState. 237 // navigation, or triggered by history.pushState/replaceState.
238 void DidStartLoading(bool to_different_document); 238 // |was_previously_loading| is false if the FrameTree was not loading before.
239 // The caller is required to provide this boolean as the delegate should only
240 // be called if the FrameTree went from non-loading to loading state.
241 // However, when it is called, the FrameTree should be in a loading state.
242 void DidStartLoading(bool to_different_document, bool was_previously_loading);
239 243
240 // A RenderFrameHost in this node stopped loading. 244 // A RenderFrameHost in this node stopped loading.
241 void DidStopLoading(); 245 void DidStopLoading();
242 246
243 // The load progress for a RenderFrameHost in this node was updated to 247 // The load progress for a RenderFrameHost in this node was updated to
244 // |load_progress|. This will notify the FrameTree which will in turn notify 248 // |load_progress|. This will notify the FrameTree which will in turn notify
245 // the WebContents. 249 // the WebContents.
246 void DidChangeLoadProgress(double load_progress); 250 void DidChangeLoadProgress(double load_progress);
247 251
248 // Called when the user directed the page to stop loading. Stops all loads 252 // Called when the user directed the page to stop loading. Stops all loads
249 // happening in the FrameTreeNode. This method should be used with 253 // happening in the FrameTreeNode. This method should be used with
250 // FrameTree::ForEach to stop all loads in the entire FrameTree. 254 // FrameTree::ForEach to stop all loads in the entire FrameTree.
251 bool StopLoading(); 255 bool StopLoading();
252 256
253 // Returns the time this frame was last focused. 257 // Returns the time this frame was last focused.
254 base::TimeTicks last_focus_time() const { return last_focus_time_; } 258 base::TimeTicks last_focus_time() const { return last_focus_time_; }
255 259
256 // Called when this node becomes focused. Updates the node's last focused 260 // Called when this node becomes focused. Updates the node's last focused
257 // time and notifies observers. 261 // time and notifies observers.
258 void DidFocus(); 262 void DidFocus();
259 263
264 // Called when the user closed the modal dialogue for BeforeUnload and
265 // cancelled the navigation. This should stop the loads.
266 void BeforeUnloadCanceled();
267
260 private: 268 private:
261 class OpenerDestroyedObserver; 269 class OpenerDestroyedObserver;
262 270
263 void set_parent(FrameTreeNode* parent) { parent_ = parent; } 271 void set_parent(FrameTreeNode* parent) { parent_ = parent; }
264 272
265 // The next available browser-global FrameTreeNode ID. 273 // The next available browser-global FrameTreeNode ID.
266 static int next_frame_tree_node_id_; 274 static int next_frame_tree_node_id_;
267 275
268 // The FrameTree that owns us. 276 // The FrameTree that owns us.
269 FrameTree* frame_tree_; // not owned. 277 FrameTree* frame_tree_; // not owned.
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 base::ObserverList<Observer> observers_; 349 base::ObserverList<Observer> observers_;
342 350
343 base::TimeTicks last_focus_time_; 351 base::TimeTicks last_focus_time_;
344 352
345 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode); 353 DISALLOW_COPY_AND_ASSIGN(FrameTreeNode);
346 }; 354 };
347 355
348 } // namespace content 356 } // namespace content
349 357
350 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_ 358 #endif // CONTENT_BROWSER_FRAME_HOST_FRAME_TREE_NODE_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree.cc ('k') | content/browser/frame_host/frame_tree_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698