Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / mandoline / ui / browser / navigator_host_impl.h
blobe3f66be3b6f47673f66e7ee16c168a88ec844b95
1 // Copyright 2015 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.
5 #ifndef MANDOLINE_UI_BROWSER_NAVIGATOR_HOST_IMPL_H_
6 #define MANDOLINE_UI_BROWSER_NAVIGATOR_HOST_IMPL_H_
8 #include "base/memory/weak_ptr.h"
9 #include "mandoline/services/navigation/public/interfaces/navigation.mojom.h"
10 #include "mojo/common/weak_binding_set.h"
11 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
13 namespace mandoline {
14 class Browser;
16 class NavigatorHostImpl : public mojo::NavigatorHost {
17 public:
18 explicit NavigatorHostImpl(Browser* browser);
19 ~NavigatorHostImpl() override;
21 void Bind(mojo::InterfaceRequest<mojo::NavigatorHost> request);
23 void RecordNavigation(const std::string& url);
25 // mojo::NavigatorHost implementation:
26 void DidNavigateLocally(const mojo::String& url) override;
27 void RequestNavigate(mojo::Target target,
28 mojo::URLRequestPtr request) override;
29 void RequestNavigateHistory(int32_t delta) override;
31 private:
32 std::vector<std::string> history_;
33 int32_t current_index_;
35 Browser* browser_;
36 mojo::WeakBindingSet<NavigatorHost> bindings_;
38 DISALLOW_COPY_AND_ASSIGN(NavigatorHostImpl);
41 } // namespace mandoline
43 #endif // MANDOLINE_UI_BROWSER_NAVIGATOR_HOST_IMPL_H_