disable two ClientCertStoreChromeOSTest.* unit_tests on Valgrind bots
[chromium-blink-merge.git] / mandoline / ui / desktop_ui / browser_manager.h
blobfa5f22587cd36d7f684e01078c22ad661dc4d29e
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_DESKTOP_UI_BROWSER_MANAGER_H_
6 #define MANDOLINE_UI_DESKTOP_UI_BROWSER_MANAGER_H_
8 #include <set>
10 #include "mandoline/ui/desktop_ui/public/interfaces/launch_handler.mojom.h"
11 #include "mojo/application/public/cpp/application_delegate.h"
12 #include "mojo/application/public/cpp/application_impl.h"
13 #include "mojo/application/public/cpp/connect.h"
14 #include "mojo/common/weak_binding_set.h"
15 #include "url/gurl.h"
17 namespace mojo {
18 class View;
21 namespace mandoline {
23 class BrowserWindow;
25 // BrowserManager creates and manages the lifetime of Browsers.
26 class BrowserManager : public mojo::ApplicationDelegate,
27 public LaunchHandler,
28 public mojo::InterfaceFactory<LaunchHandler> {
29 public:
30 BrowserManager();
31 ~BrowserManager() override;
33 // BrowserManager owns the returned BrowserWindow.
34 BrowserWindow* CreateBrowser(const GURL& default_url);
36 void BrowserWindowClosed(BrowserWindow* browser);
38 private:
39 // Overridden from LaunchHandler:
40 void LaunchURL(const mojo::String& url) override;
42 // Overridden from mojo::ApplicationDelegate:
43 void Initialize(mojo::ApplicationImpl* app) override;
44 bool ConfigureIncomingConnection(
45 mojo::ApplicationConnection* connection) override;
47 // Overridden from mojo::InterfaceFactory<LaunchHandler>:
48 void Create(mojo::ApplicationConnection* connection,
49 mojo::InterfaceRequest<LaunchHandler> request) override;
51 mojo::ApplicationImpl* app_;
52 mojo::WeakBindingSet<LaunchHandler> launch_handler_bindings_;
53 std::set<BrowserWindow*> browsers_;
55 DISALLOW_COPY_AND_ASSIGN(BrowserManager);
58 } // namespace mandoline
60 #endif // MANDOLINE_UI_DESKTOP_UI_BROWSER_MANAGER_H_