Chromium Code Reviews| Index: content/renderer/navigation_state_impl.h |
| diff --git a/content/renderer/navigation_state_impl.h b/content/renderer/navigation_state_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..dfc973d47428f00bab58f529a847a613b8840748 |
| --- /dev/null |
| +++ b/content/renderer/navigation_state_impl.h |
| @@ -0,0 +1,70 @@ |
| +// 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.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_RENDERER_NAVIGATION_STATE_IMPL_H_ |
| +#define CONTENT_RENDERER_NAVIGATION_STATE_IMPL_H_ |
| + |
| +#include <string> |
| + |
| +#include "content/common/navigation_params.h" |
| +#include "content/public/renderer/navigation_state.h" |
| + |
| +namespace content { |
| + |
| +class CONTENT_EXPORT NavigationStateImpl : public NavigationState { |
| + public: |
| + ~NavigationStateImpl() override; |
| + |
| + static NavigationStateImpl* CreateBrowserInitiated( |
| + const CommonNavigationParams& common_params, |
| + const StartNavigationParams& start_params, |
| + const HistoryNavigationParams& history_params); |
| + |
| + static NavigationStateImpl* CreateContentInitiated(); |
| + |
| + 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.
|
| + const StartNavigationParams& start_params() const { return start_params_; } |
| + const HistoryNavigationParams& history_params() const { |
| + return history_params_; |
| + } |
| + bool request_committed() const { return request_committed_; } |
| + void set_request_committed(bool value) { request_committed_ = value; } |
| + void set_was_within_same_page(bool value) { was_within_same_page_ = value; } |
| + |
| + // NavigationState implementation. |
| + 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.
|
| + bool GetWasWithinSamePage() const override; |
| + bool IsContentInitiated() const override; |
| + |
| + private: |
| + NavigationStateImpl(const CommonNavigationParams& common_params, |
| + const StartNavigationParams& start_params, |
| + const HistoryNavigationParams& history_params, |
| + bool is_content_initiated); |
| + |
| + bool request_committed_; |
| + bool was_within_same_page_; |
| + // 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.
|
| + const bool is_content_initiated_; |
| + |
| + CommonNavigationParams common_params_; |
| + const StartNavigationParams start_params_; |
| + // 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.
|
| + // replace the current entry in the back/forward history list is determined by |
| + // the should_replace_current_entry field in |history_params|. Otherwise, use |
| + // replacesCurrentHistoryItem() on the WebDataSource. |
| + // |
| + // TODO(davidben): It would be good to unify these and have only one source |
| + // for the two cases. We can plumb this through WebFrame::loadRequest to set |
| + // lockBackForwardList on the FrameLoadRequest. However, this breaks process |
| + // swaps because FrameLoader::loadWithNavigationAction treats loads before a |
| + // FrameLoader has committedFirstRealDocumentLoad as a replacement. (Added for |
| + // http://crbug.com/178380). |
| + const HistoryNavigationParams history_params_; |
| + 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.
|
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_NAVIGATION_STATE_IMPL_H_ |