forked from nwjs/nw.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnw_content.h
118 lines (106 loc) · 4.31 KB
/
nw_content.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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#ifndef NWJS_CONTENT_HOOKS_H
#define NWJS_CONTENT_HOOKS_H
#if defined(WIN32)
#include <windows.h>
#endif
#include "content/common/content_export.h"
#include "nw_package.h"
#include "base/memory/ptr_util.h"
#include "third_party/WebKit/public/web/WebNavigationPolicy.h"
#include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
namespace base {
class DictionaryValue;
class CommandLine;
}
namespace blink {
class WebFrame;
class WebLocalFrame;
class WebURLRequest;
class WebString;
}
namespace gfx {
class ImageSkia;
}
namespace content {
class RenderWidget;
class RenderFrame;
class RenderFrameHost;
class RenderProcessHost;
class RenderViewHost;
class NotificationDetails;
class RenderView;
class WebContents;
struct WebPreferences;
}
namespace extensions {
class Dispatcher;
class Extension;
class ScriptContext;
class Dispatcher;
class AppWindow;
}
namespace nw {
base::FilePath GetRootPathRenderer();
int MainPartsPreCreateThreadsHook();
void MainPartsPostDestroyThreadsHook();
void MainPartsPreMainMessageLoopRunHook();
void ContextCreationHook(blink::WebLocalFrame* frame, extensions::ScriptContext* context);
void LoadNWAppAsExtensionHook(base::DictionaryValue* manifest, std::string* error);
void DocumentElementHook(blink::WebLocalFrame* frame,
const extensions::Extension* extension,
const GURL& effective_document_url);
void DocumentFinishHook(blink::WebLocalFrame* frame,
const extensions::Extension* extension,
const GURL& effective_document_url);
void DocumentHook2(bool start, content::RenderFrame* frame, extensions::Dispatcher* dispatcher);
void RendererProcessTerminatedHook(content::RenderProcessHost* process,
const content::NotificationDetails& details);
void OnRenderProcessShutdownHook(extensions::ScriptContext* context);
void willHandleNavigationPolicy(content::RenderView* rv,
blink::WebFrame* frame,
const blink::WebURLRequest& request,
blink::WebNavigationPolicy* policy,
blink::WebString* manifest,
bool new_win);
void ExtensionDispatcherCreated(extensions::Dispatcher* dispatcher);
void CalcNewWinParams(content::WebContents* new_contents, void* params,
std::string* nw_inject_js_doc_start,
std::string* nw_inject_js_doc_end);
bool GetImage(Package* package, const FilePath& icon_path, gfx::Image* image);
std::unique_ptr<base::DictionaryValue> MergeManifest();
bool ExecuteAppCommandHook(int command_id, extensions::AppWindow* app_window);
bool ProcessSingletonNotificationCallbackHook(const base::CommandLine& command_line,
const base::FilePath& current_directory);
bool GetUserAgentFromManifest(std::string* agent);
void SetUserAgentOverride(const std::string& agent,
const std::string& name,
const std::string& version);
bool GetPackageImage(nw::Package* package,
const base::FilePath& icon_path,
gfx::Image* image);
#if defined(OS_MACOSX)
bool ApplicationShouldHandleReopenHook(bool hasVisibleWindows);
void OSXOpenURLsHook(const std::vector<GURL>& startup_urls);
#endif
void CreateAppWindowHook(extensions::AppWindow*);
void ReloadExtensionHook(const extensions::Extension*);
bool IsReloadingApp();
void KickNextTick();
void OverrideWebkitPrefsHook(content::RenderViewHost* rvh, content::WebPreferences* web_prefs);
bool PinningRenderer();
void SetPinningRenderer(bool pin);
void ShowDevtools(bool show, content::WebContents* web_contents, content::WebContents* container = nullptr);
bool CheckStoragePartitionMatches(int render_process_id, const GURL& url);
bool RphGuestFilterURLHook(content::RenderProcessHost* rph, const GURL* url);
bool ShouldServiceRequestHook(int child_id, const GURL& url);
bool RenderWidgetWasHiddenHook(content::RenderWidget* rw);
void LoadNodeSymbols();
gfx::ImageSkia* GetAppIcon();
#if defined(OS_WIN)
HICON GetAppHIcon();
HICON GetWindowHIcon();
#endif
void SetMainExtensionId(const std::string& id);
const std::string& GetMainExtensionId();
}
#endif