使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 479b1995ef435713c2cf4f0da8de3a6af6c30922
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef _BROWSER_MAIN_CONTEXT_H_
#define _BROWSER_MAIN_CONTEXT_H_
 
 
#include <string>
#include "include/cef_app.h"
#include "include/cef_client.h"
#include "include/base/cef_ref_counted.h"
#include "include/internal/cef_types_wrappers.h"
 
namespace browser {
 
struct IBrowserClient {
    virtual CefClient *getClient() = 0;
    virtual HWND getWindowHandle() = 0;
};
 
// Used to store global context in the browser process. The methods of this
// class are thread-safe unless otherwise indicated.
class CCef3MainContext {
public:
    // Returns the singleton instance of this object.
    static CCef3MainContext* Get();
 
    static void DoMessageLoopWork();
    static CefRefPtr<CefApp> InitCef3(const CefMainArgs& args, void* windows_sandbox_info);
 
    // set dev tools client
    virtual void SetDevToolsClient(IBrowserClient *pBrowserClient) = 0;
 
    // Returns dev tools client
    virtual IBrowserClient *GetDevToolsClient() = 0;
 
    // Returns the full path to the console log file.
    virtual std::string GetConsoleLogPath() = 0;
 
    // Returns the full path to |file_name|.
    virtual std::string GetDownloadPath(const std::string& file_name) = 0;
 
    // Returns the app working directory including trailing path separator.
    virtual std::string GetAppWorkingDirectory() = 0;
 
    // Returns the main application URL.
    virtual std::string GetMainURL() = 0;
 
    //return the opened browser count
    virtual int GetOpenedBrowserCount() = 0;
 
    virtual int  AddOpenedBrowserCount() = 0;
 
    virtual int  DelOpenedBrowserCount() = 0;
 
protected:
    CCef3MainContext();
    virtual ~CCef3MainContext();
 
private:
    DISALLOW_COPY_AND_ASSIGN(CCef3MainContext);
};
 
}  // namespace browser
 
#endif  // _BROWSER_MAIN_CONTEXT_H_