使用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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef _BROWSER_MAIN_CONTEXT_IMPL_H_
#define _BROWSER_MAIN_CONTEXT_IMPL_H_
#pragma once
 
#include "include/base/cef_scoped_ptr.h"
#include "include/base/cef_thread_checker.h"
#include "include/cef_app.h"
#include "include/cef_command_line.h"
#include "Cef3MainContext.h" 
 
namespace browser
{
 
// Used to store global context in the browser process.
class CCef3MainContextImpl : public CCef3MainContext {
 public:
     CCef3MainContextImpl(bool terminate_when_all_windows_closed);
 
  // MainContext members.
    
  IBrowserClient *GetDevToolsClient();
  void SetDevToolsClient(IBrowserClient *pBrowserClient);
  std::string GetConsoleLogPath();
  std::string GetDownloadPath(const std::string& file_name);
  std::string GetAppWorkingDirectory();
  std::string GetMainURL();   
 
 
  //return the opened browser count
  int GetOpenedBrowserCount(); 
 
  int  AddOpenedBrowserCount();
 
  int  DelOpenedBrowserCount();
 
 
 
  // Initialize CEF and associated main context state. This method must be
  // called on the same thread that created this object.
  bool Initialize(const CefMainArgs& main_args, CefRefPtr<CefApp> app, void* windows_sandbox_info);
  // Shut down CEF and associated context state. This method must be called on
  // the same thread that created this object.
  void Shutdown();
 
 private:
  // Allow deletion via scoped_ptr only.
  friend struct base::DefaultDeleter<CCef3MainContextImpl>;
 
  ~CCef3MainContextImpl();
 
  // Returns true if the context is in a valid state (initialized and not yet
  // shut down).
  bool InValidState() const {
    return initialized_ && !shutdown_;
  }
 
  const bool terminate_when_all_windows_closed_;
 
  // Track context state. Accessing these variables from multiple threads is
  // safe because only a single thread will exist at the time that they're set
  // (during context initialization and shutdown).
  bool initialized_;
  bool shutdown_;
 
  std::string main_url_;  
 
  // Used to verify that methods are called on the correct thread.
  base::ThreadChecker thread_checker_;
 
  int browser_opened_;
 
  HWND dev_tools_hwnd_;
  IBrowserClient *dev_tools_client_;
 
  DISALLOW_COPY_AND_ASSIGN(CCef3MainContextImpl);
};
 
}  // namespace browser
 
#endif  // _BROWSER_MAIN_CONTEXT_IMPL_H_