forked from Pissandshittium/pissandshittium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowser_list_proxy.h
34 lines (25 loc) · 1 KB
/
browser_list_proxy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBLAYER_BROWSER_BROWSER_LIST_PROXY_H_
#define WEBLAYER_BROWSER_BROWSER_LIST_PROXY_H_
#include <jni.h>
#include "base/android/scoped_java_ref.h"
#include "weblayer/browser/browser_list_observer.h"
namespace weblayer {
// Owns the Java BrowserList implementation and funnels all BrowserListObserver
// calls to the java side.
class BrowserListProxy : public BrowserListObserver {
public:
BrowserListProxy();
BrowserListProxy(const BrowserListProxy&) = delete;
BrowserListProxy& operator=(const BrowserListProxy&) = delete;
~BrowserListProxy() override;
// BrowserListObserver:
void OnBrowserCreated(Browser* browser) override;
void OnBrowserDestroyed(Browser* browser) override;
private:
base::android::ScopedJavaGlobalRef<jobject> java_browser_list_;
};
} // namespace weblayer
#endif // WEBLAYER_BROWSER_BROWSER_LIST_PROXY_H_