2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// Copyright (c) 2018 GitHub, Inc.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// Use of this source code is governed by the MIT license that can be
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// found in the LICENSE file.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-29 16:06:20 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#ifndef SHELL_BROWSER_API_ELECTRON_API_BASE_WINDOW_H_
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#define SHELL_BROWSER_API_ELECTRON_API_BASE_WINDOW_H_
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <map>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <memory>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <string>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include <vector>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-01-12 06:30:43 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "base/task/post_task.h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "content/public/browser/browser_task_traits.h"
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-07 11:21:58 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "content/public/browser/browser_thread.h"
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-25 22:03:28 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "gin/handle.h"
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-19 13:46:59 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "shell/browser/native_window.h"
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#include "shell/browser/native_window_observer.h"
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-04 12:19:40 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "shell/common/api/electron_api_native_image.h"
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-04 12:58:31 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "shell/common/gin_helper/error_thrower.h"
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-25 22:03:28 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#include "shell/common/gin_helper/trackable_object.h"
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-19 14:23:04 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								namespace electron {
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								namespace api {
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-08 14:47:26 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class View;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-29 16:06:20 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                   public NativeWindowObserver {
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 public:
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-05 18:46:34 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  static gin_helper::WrappableBase* New(gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  static void BuildPrototype(v8::Isolate* isolate,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                             v8::Local<v8::FunctionTemplate> prototype);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-29 16:06:20 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  base::WeakPtr<BaseWindow> GetWeakPtr() { return weak_factory_.GetWeakPtr(); }
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  NativeWindow* window() const { return window_.get(); }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								 protected:
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-17 16:29:16 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  // Common constructor.
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-29 16:06:20 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  BaseWindow(v8::Isolate* isolate, const gin_helper::Dictionary& options);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  // Creating independent BaseWindow instance.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  BaseWindow(gin_helper::Arguments* args,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								             const gin_helper::Dictionary& options);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  ~BaseWindow() override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-17 16:18:55 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  // TrackableObject:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void InitWith(v8::Isolate* isolate, v8::Local<v8::Object> wrapper) override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  // NativeWindowObserver:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void WillCloseWindow(bool* prevent_default) override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowClosed() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowEndSession() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowBlur() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowFocus() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowShow() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowHide() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowMaximize() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowUnmaximize() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowMinimize() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowRestore() override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-27 11:53:01 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void OnWindowWillResize(const gfx::Rect& new_bounds,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                          bool* prevent_default) override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowResize() override;
							 | 
						
					
						
							
								
									
										
										
										
											2020-11-11 19:27:24 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void OnWindowResized() override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-08-28 09:44:10 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void OnWindowWillMove(const gfx::Rect& new_bounds,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                        bool* prevent_default) override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowMove() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowMoved() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowScrollTouchBegin() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowScrollTouchEnd() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowSwipe(const std::string& direction) override;
							 | 
						
					
						
							
								
									
										
										
										
											2019-07-23 12:42:26 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void OnWindowRotateGesture(float rotation) override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowSheetBegin() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowSheetEnd() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowEnterFullScreen() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowLeaveFullScreen() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowEnterHtmlFullScreen() override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowLeaveHtmlFullScreen() override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-10-04 11:02:16 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void OnWindowAlwaysOnTopChanged() override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-05 09:35:59 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void OnExecuteAppCommand(const std::string& command_name) override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnTouchBarItemResult(const std::string& item_id,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                            const base::DictionaryValue& details) override;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnNewWindowForTab() override;
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-08 15:45:05 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void OnSystemContextMenu(int x, int y, bool* prevent_default) override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#if defined(OS_WIN)
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void OnWindowMessage(UINT message, WPARAM w_param, LPARAM l_param) override;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#endif
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  // Public APIs of NativeWindow.
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-25 22:03:28 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetContentView(gin::Handle<View> view);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void Close();
							 | 
						
					
						
							
								
									
										
										
										
											2021-03-15 18:43:25 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  virtual void CloseImmediately();
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  virtual void Focus();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  virtual void Blur();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsFocused();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void Show();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void ShowInactive();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void Hide();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsVisible();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsEnabled();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetEnabled(bool enable);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void Maximize();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void Unmaximize();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsMaximized();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void Minimize();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void Restore();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsMinimized();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetFullScreen(bool fullscreen);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsFullscreen();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetBounds(const gfx::Rect& bounds, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  gfx::Rect GetBounds();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetSize(int width, int height, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::vector<int> GetSize();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetContentSize(int width, int height, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::vector<int> GetContentSize();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetContentBounds(const gfx::Rect& bounds, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  gfx::Rect GetContentBounds();
							 | 
						
					
						
							
								
									
										
										
										
											2018-08-24 23:33:27 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  bool IsNormal();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  gfx::Rect GetNormalBounds();
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetMinimumSize(int width, int height);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::vector<int> GetMinimumSize();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetMaximumSize(int width, int height);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::vector<int> GetMaximumSize();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetSheetOffset(double offsetY, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetResizable(bool resizable);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsResizable();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetMovable(bool movable);
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void MoveAbove(const std::string& sourceId, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void MoveTop();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsMovable();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetMinimizable(bool minimizable);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsMinimizable();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetMaximizable(bool maximizable);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsMaximizable();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetFullScreenable(bool fullscreenable);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsFullScreenable();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetClosable(bool closable);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsClosable();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetAlwaysOnTop(bool top, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsAlwaysOnTop();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void Center();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetPosition(int x, int y, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::vector<int> GetPosition();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetTitle(const std::string& title);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::string GetTitle();
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-28 00:35:34 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetAccessibleTitle(const std::string& title);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::string GetAccessibleTitle();
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void FlashFrame(bool flash);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetSkipTaskbar(bool skip);
							 | 
						
					
						
							
								
									
										
										
										
											2019-03-27 08:10:23 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetExcludedFromShownWindowsMenu(bool excluded);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsExcludedFromShownWindowsMenu();
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetSimpleFullScreen(bool simple_fullscreen);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsSimpleFullScreen();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetKiosk(bool kiosk);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsKiosk();
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-22 14:40:42 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  bool IsTabletMode() const;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  virtual void SetBackgroundColor(const std::string& color_name);
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-13 17:08:30 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  std::string GetBackgroundColor();
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetHasShadow(bool has_shadow);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool HasShadow();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetOpacity(const double opacity);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  double GetOpacity();
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-30 13:37:40 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetShape(const std::vector<gfx::Rect>& rects);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetRepresentedFilename(const std::string& filename);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::string GetRepresentedFilename();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetDocumentEdited(bool edited);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsDocumentEdited();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetIgnoreMouseEvents(bool ignore, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetContentProtection(bool enable);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetFocusable(bool focusable);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetMenu(v8::Isolate* isolate, v8::Local<v8::Value> menu);
							 | 
						
					
						
							
								
									
										
										
										
											2019-01-31 10:58:23 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void RemoveMenu();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetParentWindow(v8::Local<v8::Value> value, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  virtual void SetBrowserView(v8::Local<v8::Value> value);
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-22 04:49:26 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  virtual void AddBrowserView(v8::Local<v8::Value> value);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  virtual void RemoveBrowserView(v8::Local<v8::Value> value);
							 | 
						
					
						
							
								
									
										
										
										
											2021-02-09 23:23:35 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  virtual void SetTopBrowserView(v8::Local<v8::Value> value,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                 gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-22 04:49:26 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  virtual std::vector<v8::Local<v8::Value>> GetBrowserViews() const;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  virtual void ResetBrowserViews();
							 | 
						
					
						
							
								
									
										
										
										
											2019-08-14 23:51:15 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  std::string GetMediaSourceId() const;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  v8::Local<v8::Value> GetNativeWindowHandle();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetProgressBar(double progress, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetOverlayIcon(const gfx::Image& overlay,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                      const std::string& description);
							 | 
						
					
						
							
								
									
										
										
										
											2020-08-19 13:31:25 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetVisibleOnAllWorkspaces(bool visible, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsVisibleOnAllWorkspaces();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetAutoHideCursor(bool auto_hide);
							 | 
						
					
						
							
								
									
										
										
										
											2018-07-30 03:29:18 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  virtual void SetVibrancy(v8::Isolate* isolate, v8::Local<v8::Value> value);
							 | 
						
					
						
							
								
									
										
										
										
											2020-03-05 14:22:12 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-08-12 11:33:58 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#if defined(OS_MAC)
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-19 19:12:09 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetWindowButtonVisibility(bool visible);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool GetWindowButtonVisibility() const;
							 | 
						
					
						
							
								
									
										
										
										
											2020-03-05 14:22:12 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetTrafficLightPosition(const gfx::Point& position);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  gfx::Point GetTrafficLightPosition() const;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-31 16:56:00 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetTouchBar(std::vector<gin_helper::PersistentDictionary> items);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void RefreshTouchBarItem(const std::string& item_id);
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-31 16:56:00 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetEscapeTouchBarItem(gin_helper::PersistentDictionary item);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SelectPreviousTab();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SelectNextTab();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void MergeAllWindows();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void MoveTabToNewWindow();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void ToggleTabBar();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void AddTabbedWindow(NativeWindow* window, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetAutoHideMenuBar(bool auto_hide);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsMenuBarAutoHide();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void SetMenuBarVisibility(bool visible);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsMenuBarVisible();
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetAspectRatio(double aspect_ratio, gin_helper::Arguments* args);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void PreviewFile(const std::string& path, gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void CloseFilePreview();
							 | 
						
					
						
							
								
									
										
										
										
											2020-08-20 15:53:06 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetGTKDarkThemeEnabled(bool use_dark_theme);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  // Public getters of NativeWindow.
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-08 14:47:26 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  v8::Local<v8::Value> GetContentView() const;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  v8::Local<v8::Value> GetParentWindow() const;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::vector<v8::Local<v8::Object>> GetChildWindows() const;
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  v8::Local<v8::Value> GetBrowserView(gin_helper::Arguments* args) const;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsModal() const;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  // Extra APIs added in JS.
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  bool SetThumbarButtons(gin_helper::Arguments* args);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#if defined(TOOLKIT_VIEWS)
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-04 12:58:31 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetIcon(v8::Isolate* isolate, v8::Local<v8::Value> icon);
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-24 19:24:10 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetIconImpl(v8::Isolate* isolate,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                   v8::Local<v8::Value> icon,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                   NativeImage::OnConvertError on_error);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#if defined(OS_WIN)
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-29 13:02:15 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  typedef base::RepeatingCallback<void(v8::Local<v8::Value>,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                       v8::Local<v8::Value>)>
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-17 21:44:10 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								      MessageCallback;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool HookWindowMessage(UINT message, const MessageCallback& callback);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool IsWindowMessageHooked(UINT message);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void UnhookWindowMessage(UINT message);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void UnhookAllWindowMessages();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool SetThumbnailClip(const gfx::Rect& region);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  bool SetThumbnailToolTip(const std::string& tooltip);
							 | 
						
					
						
							
								
									
										
										
										
											2019-10-21 16:05:40 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void SetAppDetails(const gin_helper::Dictionary& options);
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  int32_t GetID() const;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  // Helpers.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  // Remove BrowserView.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void ResetBrowserView();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  // Remove this window from parent window's |child_windows_|.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  void RemoveFromParentChildWindows();
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-19 13:10:26 +02:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  template <typename... Args>
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-07 11:21:58 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  void EmitEventSoon(base::StringPiece eventName) {
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-18 15:58:00 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    base::PostTask(
							 | 
						
					
						
							
								
									
										
										
										
											2019-01-12 06:30:43 +05:30
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        FROM_HERE, {content::BrowserThread::UI},
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-29 16:06:20 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								        base::BindOnce(base::IgnoreResult(&BaseWindow::Emit<Args...>),
							 | 
						
					
						
							
								
									
										
										
										
											2018-09-07 11:21:58 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								                       weak_factory_.GetWeakPtr(), eventName));
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  }
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#if defined(OS_WIN)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  typedef std::map<UINT, MessageCallback> MessageCallbackMap;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  MessageCallbackMap messages_callback_map_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-05-08 14:47:26 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  v8::Global<v8::Value> content_view_;
							 | 
						
					
						
							
								
									
										
										
										
											2018-12-22 04:49:26 +03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  std::map<int32_t, v8::Global<v8::Value>> browser_views_;
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  v8::Global<v8::Value> menu_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  v8::Global<v8::Value> parent_window_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  KeyWeakMap<int> child_windows_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  std::unique_ptr<NativeWindow> window_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-11 09:37:46 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  // Reference to JS wrapper to prevent garbage collection.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  v8::Global<v8::Value> self_ref_;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-26 19:16:21 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								  base::WeakPtrFactory<BaseWindow> weak_factory_{this};
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								};
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								}  // namespace api
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-19 14:23:04 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								}  // namespace electron
							 | 
						
					
						
							
								
									
										
										
										
											2018-04-14 11:04:23 +09:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-06-29 16:06:20 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#endif  // SHELL_BROWSER_API_ELECTRON_API_BASE_WINDOW_H_
							 |