Handle IPC messages in webContents instead of BrowserWindow.
This commit is contained in:
parent
1815f8b40d
commit
c0875864dc
21 changed files with 138 additions and 421 deletions
|
@ -11,6 +11,14 @@ namespace base {
|
|||
class ListValue;
|
||||
}
|
||||
|
||||
namespace content {
|
||||
class WebContents;
|
||||
}
|
||||
|
||||
namespace IPC {
|
||||
class Message;
|
||||
}
|
||||
|
||||
namespace mate {
|
||||
|
||||
// Provide helperers to emit event in JavaScript.
|
||||
|
@ -18,12 +26,16 @@ class EventEmitter : public Wrappable {
|
|||
protected:
|
||||
EventEmitter();
|
||||
|
||||
// this.emit(name);
|
||||
// this.emit(name, new Event());
|
||||
bool Emit(const base::StringPiece& name);
|
||||
|
||||
// this.emit(name, args...);
|
||||
// this.emit(name, new Event(), args...);
|
||||
bool Emit(const base::StringPiece& name, const base::ListValue& args);
|
||||
|
||||
// this.emit(name, new Event(sender, message), args...);
|
||||
bool Emit(const base::StringPiece& name, const base::ListValue& args,
|
||||
content::WebContents* sender, IPC::Message* message);
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(EventEmitter);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue