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

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

Issue 1001043002: Refactor NavigationState to use NavigationParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
Avi (use Gerrit) 2015/03/16 18:10:24 No (c).
clamy 2015/03/17 16:08:18 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_NAVIGATION_STATE_IMPL_H_
6 #define CONTENT_RENDERER_NAVIGATION_STATE_IMPL_H_
7
8 #include <string>
9
10 #include "content/common/navigation_params.h"
11 #include "content/public/renderer/navigation_state.h"
12
13 namespace content {
14
15 class CONTENT_EXPORT NavigationStateImpl : public NavigationState {
16 public:
17 ~NavigationStateImpl() override;
18
19 static NavigationStateImpl* CreateBrowserInitiated(
20 const CommonNavigationParams& common_params,
21 const StartNavigationParams& start_params,
22 const HistoryNavigationParams& history_params);
23
24 static NavigationStateImpl* CreateContentInitiated();
25
26 CommonNavigationParams& common_params() { return common_params_; }
Charlie Reis 2015/03/17 03:26:30 This needs to be const. (No non-const refs allowe
clamy 2015/03/17 16:08:18 Done.
27 const StartNavigationParams& start_params() const { return start_params_; }
28 const HistoryNavigationParams& history_params() const {
29 return history_params_;
30 }
31 bool request_committed() const { return request_committed_; }
32 void set_request_committed(bool value) { request_committed_ = value; }
33 void set_was_within_same_page(bool value) { was_within_same_page_ = value; }
34
35 // NavigationState implementation.
36 ui::PageTransition GetTransitionType() const override;
Charlie Reis 2015/03/17 03:26:30 This needs a setter.
clamy 2015/03/17 16:08:18 Done.
37 bool GetWasWithinSamePage() const override;
38 bool IsContentInitiated() const override;
39
40 private:
41 NavigationStateImpl(const CommonNavigationParams& common_params,
42 const StartNavigationParams& start_params,
43 const HistoryNavigationParams& history_params,
44 bool is_content_initiated);
45
46 bool request_committed_;
47 bool was_within_same_page_;
48 // True if this navigation was not initiated via WebFrame::LoadRequest.
Charlie Reis 2015/03/17 03:26:30 nit: Blank line above.
clamy 2015/03/17 16:08:18 Done.
49 const bool is_content_initiated_;
50
51 CommonNavigationParams common_params_;
52 const StartNavigationParams start_params_;
53 // Note: if is_content_initiated() is false, whether this navigation should
Charlie Reis 2015/03/17 03:26:30 nit: Blank line above. nit: IsContentInitiated()
clamy 2015/03/17 16:08:18 Done.
54 // replace the current entry in the back/forward history list is determined by
55 // the should_replace_current_entry field in |history_params|. Otherwise, use
56 // replacesCurrentHistoryItem() on the WebDataSource.
57 //
58 // TODO(davidben): It would be good to unify these and have only one source
59 // for the two cases. We can plumb this through WebFrame::loadRequest to set
60 // lockBackForwardList on the FrameLoadRequest. However, this breaks process
61 // swaps because FrameLoader::loadWithNavigationAction treats loads before a
62 // FrameLoader has committedFirstRealDocumentLoad as a replacement. (Added for
63 // http://crbug.com/178380).
64 const HistoryNavigationParams history_params_;
65 DISALLOW_COPY_AND_ASSIGN(NavigationStateImpl);
Charlie Reis 2015/03/17 03:26:30 nit: Blank line above.
clamy 2015/03/17 16:08:18 Done.
66 };
67
68 } // namespace content
69
70 #endif // CONTENT_RENDERER_NAVIGATION_STATE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698