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

Side by Side Diff: content/renderer/history_controller.h

Issue 1157863005: Use WebFrame::loadRequest for reloads and history navigations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 /* 5 /*
6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
8 * (http://www.torchmobile.com/) 8 * (http://www.torchmobile.com/)
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 23 matching lines...) Expand all
34 34
35 #ifndef CONTENT_RENDERER_HISTORY_CONTROLLER_H_ 35 #ifndef CONTENT_RENDERER_HISTORY_CONTROLLER_H_
36 #define CONTENT_RENDERER_HISTORY_CONTROLLER_H_ 36 #define CONTENT_RENDERER_HISTORY_CONTROLLER_H_
37 37
38 #include "base/containers/hash_tables.h" 38 #include "base/containers/hash_tables.h"
39 #include "base/memory/scoped_ptr.h" 39 #include "base/memory/scoped_ptr.h"
40 #include "base/memory/scoped_vector.h" 40 #include "base/memory/scoped_vector.h"
41 #include "content/common/content_export.h" 41 #include "content/common/content_export.h"
42 #include "content/renderer/history_entry.h" 42 #include "content/renderer/history_entry.h"
43 #include "third_party/WebKit/public/platform/WebURLRequest.h" 43 #include "third_party/WebKit/public/platform/WebURLRequest.h"
44 #include "third_party/WebKit/public/web/WebFrame.h"
44 #include "third_party/WebKit/public/web/WebHistoryCommitType.h" 45 #include "third_party/WebKit/public/web/WebHistoryCommitType.h"
45 #include "third_party/WebKit/public/web/WebHistoryItem.h" 46 #include "third_party/WebKit/public/web/WebHistoryItem.h"
46 47
47 namespace blink {
48 class WebFrame;
49 }
50
51 namespace content { 48 namespace content {
52 class RenderFrameImpl; 49 class RenderFrameImpl;
53 class RenderViewImpl; 50 class RenderViewImpl;
54 struct NavigationParams; 51 struct NavigationParams;
55 52
56 // A guide to history state in the renderer: 53 // A guide to history state in the renderer:
57 // 54 //
58 // HistoryController: Owned by RenderView, is the entry point for interacting 55 // HistoryController: Owned by RenderView, is the entry point for interacting
59 // with history. Handles most of the operations to modify history state, 56 // with history. Handles most of the operations to modify history state,
60 // navigate to an existing back/forward entry, etc. 57 // navigate to an existing back/forward entry, etc.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // 104 //
108 class CONTENT_EXPORT HistoryController { 105 class CONTENT_EXPORT HistoryController {
109 public: 106 public:
110 explicit HistoryController(RenderViewImpl* render_view); 107 explicit HistoryController(RenderViewImpl* render_view);
111 ~HistoryController(); 108 ~HistoryController();
112 109
113 void GoToEntry(scoped_ptr<HistoryEntry> entry, 110 void GoToEntry(scoped_ptr<HistoryEntry> entry,
114 scoped_ptr<NavigationParams> navigation_params, 111 scoped_ptr<NavigationParams> navigation_params,
115 blink::WebURLRequest::CachePolicy cache_policy); 112 blink::WebURLRequest::CachePolicy cache_policy);
116 113
114 // Returns the WebHistoryItem corresponding to |target_entry|. If no item is
Charlie Reis 2015/05/27 23:34:36 This sentence doesn't make sense, since a HistoryE
clamy 2015/05/29 14:47:01 Ah I didn't know we had this method. The only thin
115 // found, then returns an empty WebHistoryItem. Also updates load_type to
Charlie Reis 2015/05/27 23:34:36 nit: |load_type| I'm not a fan of methods that do
clamy 2015/05/29 14:47:01 I'm removing the method in the next patch set.
116 // WebFrameLoadTypeBackForward or WebFrameLoadTypeHistorySameDocument
117 // depending on the type of history navigation.
118 blink::WebHistoryItem FindItemForFrame(
Charlie Reis 2015/05/27 23:34:36 I'd like to avoid adding new code to HistoryContro
clamy 2015/05/29 14:47:01 Done.
119 scoped_ptr<HistoryEntry> target_entry,
120 RenderFrameImpl* target_frame,
121 blink::WebURLRequest::CachePolicy cache_policy,
122 blink::WebFrame::WebFrameLoadType* load_type);
123
117 void UpdateForCommit(RenderFrameImpl* frame, 124 void UpdateForCommit(RenderFrameImpl* frame,
118 const blink::WebHistoryItem& item, 125 const blink::WebHistoryItem& item,
119 blink::WebHistoryCommitType commit_type, 126 blink::WebHistoryCommitType commit_type,
120 bool navigation_within_page); 127 bool navigation_within_page);
121 128
122 HistoryEntry* GetCurrentEntry(); 129 HistoryEntry* GetCurrentEntry();
123 blink::WebHistoryItem GetItemForNewChildFrame(RenderFrameImpl* frame) const; 130 blink::WebHistoryItem GetItemForNewChildFrame(RenderFrameImpl* frame) const;
124 void RemoveChildrenForRedirect(RenderFrameImpl* frame); 131 void RemoveChildrenForRedirect(RenderFrameImpl* frame);
125 132
126 private: 133 private:
(...skipping 22 matching lines...) Expand all
149 // passed into frames created after the commit that resulted from the 156 // passed into frames created after the commit that resulted from the
150 // navigation in GetItemForNewChildFrame(). 157 // navigation in GetItemForNewChildFrame().
151 scoped_ptr<NavigationParams> navigation_params_; 158 scoped_ptr<NavigationParams> navigation_params_;
152 159
153 DISALLOW_COPY_AND_ASSIGN(HistoryController); 160 DISALLOW_COPY_AND_ASSIGN(HistoryController);
154 }; 161 };
155 162
156 } // namespace content 163 } // namespace content
157 164
158 #endif // CONTENT_RENDERER_HISTORY_CONTROLLER_H_ 165 #endif // CONTENT_RENDERER_HISTORY_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698