blob: b36db34273a219810f9b1394ac5351c37e5ea72a [file] [log] [blame]
danakjc492bf82020-09-09 20:02:441// Copyright 2013 The Chromium Authors. All rights reserved.
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_BROWSER_RENDERER_HOST_NAVIGATION_CONTROLLER_DELEGATE_H_
6#define CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_CONTROLLER_DELEGATE_H_
7
8#include <stdint.h>
9
danakjc492bf82020-09-09 20:02:4410#include "content/public/browser/invalidate_type.h"
11#include "content/public/browser/navigation_controller.h"
12#include "content/public/browser/navigation_details.h"
13#include "third_party/blink/public/common/loader/previews_state.h"
14
15namespace content {
16
17struct LoadCommittedDetails;
danakjc492bf82020-09-09 20:02:4418class WebContents;
19
20// Interface for objects embedding a NavigationController to provide the
21// functionality NavigationController needs.
danakjc492bf82020-09-09 20:02:4422class NavigationControllerDelegate {
23 public:
24 virtual ~NavigationControllerDelegate() {}
25
26 // Duplicates of WebContents methods.
danakjc492bf82020-09-09 20:02:4427 virtual void NotifyNavigationStateChanged(InvalidateTypes changed_flags) = 0;
danakjc492bf82020-09-09 20:02:4428 virtual bool IsBeingDestroyed() = 0;
danakjc492bf82020-09-09 20:02:4429
30 // Methods from WebContentsImpl that NavigationControllerImpl needs to
Matt Falkenhagen548ed1562021-07-06 01:38:2631 // call. NavigationControllerImpl cannot call them directly because
32 // renderer_host/ cannot depend on WebContents.
danakjc492bf82020-09-09 20:02:4433 virtual void NotifyBeforeFormRepostWarningShow() = 0;
34 virtual void NotifyNavigationEntryCommitted(
35 const LoadCommittedDetails& load_details) = 0;
36 virtual void NotifyNavigationEntryChanged(
37 const EntryChangedDetails& change_details) = 0;
38 virtual void NotifyNavigationListPruned(
39 const PrunedDetails& pruned_details) = 0;
40 virtual void NotifyNavigationEntriesDeleted() = 0;
danakjc492bf82020-09-09 20:02:4441 virtual void ActivateAndShowRepostFormWarningDialog() = 0;
danakjc492bf82020-09-09 20:02:4442
43 // Returns whether URLs for aborted browser-initiated navigations should be
44 // preserved in the omnibox. Defaults to false.
45 virtual bool ShouldPreserveAbortedURLs() = 0;
46
Matt Falkenhagen548ed1562021-07-06 01:38:2647 // TODO(crbug.com/1225205): Remove this. It is a layering violation as
48 // renderer_host/ cannot depend on WebContents.
49 virtual WebContents* DeprecatedGetWebContents() = 0;
danakjc492bf82020-09-09 20:02:4450
danakjc492bf82020-09-09 20:02:4451 virtual void UpdateOverridingUserAgent() = 0;
52};
53
54} // namespace content
55
56#endif // CONTENT_BROWSER_RENDERER_HOST_NAVIGATION_CONTROLLER_DELEGATE_H_