Refactoring: use C++11 class member variable initialization
This commit is contained in:
parent
ee57c95aa6
commit
2337237d58
94 changed files with 218 additions and 377 deletions
|
@ -51,8 +51,7 @@ namespace api {
|
||||||
|
|
||||||
BrowserView::BrowserView(v8::Isolate* isolate,
|
BrowserView::BrowserView(v8::Isolate* isolate,
|
||||||
v8::Local<v8::Object> wrapper,
|
v8::Local<v8::Object> wrapper,
|
||||||
const mate::Dictionary& options)
|
const mate::Dictionary& options) {
|
||||||
: api_web_contents_(nullptr) {
|
|
||||||
Init(isolate, wrapper, options);
|
Init(isolate, wrapper, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ class BrowserView : public mate::TrackableObject<BrowserView> {
|
||||||
v8::Local<v8::Value> GetWebContents();
|
v8::Local<v8::Value> GetWebContents();
|
||||||
|
|
||||||
v8::Global<v8::Value> web_contents_;
|
v8::Global<v8::Value> web_contents_;
|
||||||
class WebContents* api_web_contents_;
|
class WebContents* api_web_contents_ = nullptr;
|
||||||
|
|
||||||
std::unique_ptr<NativeBrowserView> view_;
|
std::unique_ptr<NativeBrowserView> view_;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace atom {
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
Debugger::Debugger(v8::Isolate* isolate, content::WebContents* web_contents)
|
Debugger::Debugger(v8::Isolate* isolate, content::WebContents* web_contents)
|
||||||
: web_contents_(web_contents), previous_request_id_(0) {
|
: web_contents_(web_contents) {
|
||||||
Init(isolate);
|
Init(isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ class Debugger : public mate::TrackableObject<Debugger>,
|
||||||
scoped_refptr<content::DevToolsAgentHost> agent_host_;
|
scoped_refptr<content::DevToolsAgentHost> agent_host_;
|
||||||
|
|
||||||
PendingRequestMap pending_requests_;
|
PendingRequestMap pending_requests_;
|
||||||
int previous_request_id_;
|
int previous_request_id_ = 0;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Debugger);
|
DISALLOW_COPY_AND_ASSIGN(Debugger);
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,7 +20,7 @@ namespace atom {
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
||||||
Menu::Menu(v8::Isolate* isolate, v8::Local<v8::Object> wrapper)
|
Menu::Menu(v8::Isolate* isolate, v8::Local<v8::Object> wrapper)
|
||||||
: model_(new AtomMenuModel(this)), parent_(nullptr) {
|
: model_(new AtomMenuModel(this)) {
|
||||||
InitWith(isolate, wrapper);
|
InitWith(isolate, wrapper);
|
||||||
model_->AddObserver(this);
|
model_->AddObserver(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ class Menu : public mate::TrackableObject<Menu>,
|
||||||
virtual void ClosePopupAt(int32_t window_id) = 0;
|
virtual void ClosePopupAt(int32_t window_id) = 0;
|
||||||
|
|
||||||
std::unique_ptr<AtomMenuModel> model_;
|
std::unique_ptr<AtomMenuModel> model_;
|
||||||
Menu* parent_;
|
Menu* parent_ = nullptr;
|
||||||
|
|
||||||
// Observable:
|
// Observable:
|
||||||
void OnMenuWillClose() override;
|
void OnMenuWillClose() override;
|
||||||
|
|
|
@ -336,13 +336,7 @@ struct WebContents::FrameDispatchHelper {
|
||||||
WebContents::WebContents(v8::Isolate* isolate,
|
WebContents::WebContents(v8::Isolate* isolate,
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
Type type)
|
Type type)
|
||||||
: content::WebContentsObserver(web_contents),
|
: content::WebContentsObserver(web_contents), type_(type) {
|
||||||
embedder_(nullptr),
|
|
||||||
zoom_controller_(nullptr),
|
|
||||||
type_(type),
|
|
||||||
request_id_(0),
|
|
||||||
background_throttling_(true),
|
|
||||||
enable_devtools_(true) {
|
|
||||||
const mate::Dictionary options = mate::Dictionary::CreateEmpty(isolate);
|
const mate::Dictionary options = mate::Dictionary::CreateEmpty(isolate);
|
||||||
if (type == REMOTE) {
|
if (type == REMOTE) {
|
||||||
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
|
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
|
||||||
|
@ -356,13 +350,8 @@ WebContents::WebContents(v8::Isolate* isolate,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
|
WebContents::WebContents(v8::Isolate* isolate,
|
||||||
: embedder_(nullptr),
|
const mate::Dictionary& options) {
|
||||||
zoom_controller_(nullptr),
|
|
||||||
type_(BROWSER_WINDOW),
|
|
||||||
request_id_(0),
|
|
||||||
background_throttling_(true),
|
|
||||||
enable_devtools_(true) {
|
|
||||||
// Read options.
|
// Read options.
|
||||||
options.Get("backgroundThrottling", &background_throttling_);
|
options.Get("backgroundThrottling", &background_throttling_);
|
||||||
|
|
||||||
|
|
|
@ -437,22 +437,22 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
||||||
std::unique_ptr<WebViewGuestDelegate> guest_delegate_;
|
std::unique_ptr<WebViewGuestDelegate> guest_delegate_;
|
||||||
|
|
||||||
// The host webcontents that may contain this webcontents.
|
// The host webcontents that may contain this webcontents.
|
||||||
WebContents* embedder_;
|
WebContents* embedder_ = nullptr;
|
||||||
|
|
||||||
// The zoom controller for this webContents.
|
// The zoom controller for this webContents.
|
||||||
WebContentsZoomController* zoom_controller_;
|
WebContentsZoomController* zoom_controller_ = nullptr;
|
||||||
|
|
||||||
// The type of current WebContents.
|
// The type of current WebContents.
|
||||||
Type type_;
|
Type type_ = BROWSER_WINDOW;
|
||||||
|
|
||||||
// Request id used for findInPage request.
|
// Request id used for findInPage request.
|
||||||
uint32_t request_id_;
|
uint32_t request_id_ = 0;
|
||||||
|
|
||||||
// Whether background throttling is disabled.
|
// Whether background throttling is disabled.
|
||||||
bool background_throttling_;
|
bool background_throttling_ = true;
|
||||||
|
|
||||||
// Whether to enable devtools.
|
// Whether to enable devtools.
|
||||||
bool enable_devtools_;
|
bool enable_devtools_ = true;
|
||||||
|
|
||||||
// Observers of this WebContents.
|
// Observers of this WebContents.
|
||||||
base::ObserverList<ExtendedWebContentsObserver> observers_;
|
base::ObserverList<ExtendedWebContentsObserver> observers_;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
namespace mate {
|
namespace mate {
|
||||||
|
|
||||||
Event::Event(v8::Isolate* isolate) : sender_(nullptr), message_(nullptr) {
|
Event::Event(v8::Isolate* isolate) {
|
||||||
Init(isolate);
|
Init(isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,8 +44,8 @@ class Event : public Wrappable<Event>, public content::WebContentsObserver {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Replyer for the synchronous messages.
|
// Replyer for the synchronous messages.
|
||||||
content::RenderFrameHost* sender_;
|
content::RenderFrameHost* sender_ = nullptr;
|
||||||
IPC::Message* message_;
|
IPC::Message* message_ = nullptr;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Event);
|
DISALLOW_COPY_AND_ASSIGN(Event);
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,8 +28,7 @@ class IDUserData : public base::SupportsUserData::Data {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TrackableObjectBase::TrackableObjectBase()
|
TrackableObjectBase::TrackableObjectBase() : weak_factory_(this) {
|
||||||
: weak_map_id_(0), weak_factory_(this) {
|
|
||||||
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
|
atom::AtomBrowserMainParts::Get()->RegisterDestructionCallback(
|
||||||
GetDestroyClosure());
|
GetDestroyClosure());
|
||||||
}
|
}
|
||||||
|
@ -54,8 +53,8 @@ void TrackableObjectBase::AttachAsUserData(base::SupportsUserData* wrapped) {
|
||||||
int32_t TrackableObjectBase::GetIDFromWrappedClass(
|
int32_t TrackableObjectBase::GetIDFromWrappedClass(
|
||||||
base::SupportsUserData* wrapped) {
|
base::SupportsUserData* wrapped) {
|
||||||
if (wrapped) {
|
if (wrapped) {
|
||||||
auto* id = static_cast<IDUserData*>(
|
auto* id =
|
||||||
wrapped->GetUserData(kTrackedObjectKey));
|
static_cast<IDUserData*>(wrapped->GetUserData(kTrackedObjectKey));
|
||||||
if (id)
|
if (id)
|
||||||
return *id;
|
return *id;
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ class TrackableObjectBase {
|
||||||
// Returns a closure that can destroy the native class.
|
// Returns a closure that can destroy the native class.
|
||||||
base::OnceClosure GetDestroyClosure();
|
base::OnceClosure GetDestroyClosure();
|
||||||
|
|
||||||
int32_t weak_map_id_;
|
int32_t weak_map_id_ = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void Destroy();
|
void Destroy();
|
||||||
|
|
|
@ -88,7 +88,7 @@ void AtomBrowserClient::SetCustomServiceWorkerSchemes(
|
||||||
g_custom_service_worker_schemes = base::JoinString(schemes, ",");
|
g_custom_service_worker_schemes = base::JoinString(schemes, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
AtomBrowserClient::AtomBrowserClient() : delegate_(nullptr) {}
|
AtomBrowserClient::AtomBrowserClient() {}
|
||||||
|
|
||||||
AtomBrowserClient::~AtomBrowserClient() {}
|
AtomBrowserClient::~AtomBrowserClient() {}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ class AtomBrowserClient : public brightray::BrowserClient,
|
||||||
std::unique_ptr<AtomResourceDispatcherHostDelegate>
|
std::unique_ptr<AtomResourceDispatcherHostDelegate>
|
||||||
resource_dispatcher_host_delegate_;
|
resource_dispatcher_host_delegate_;
|
||||||
|
|
||||||
Delegate* delegate_;
|
Delegate* delegate_ = nullptr;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AtomBrowserClient);
|
DISALLOW_COPY_AND_ASSIGN(AtomBrowserClient);
|
||||||
};
|
};
|
||||||
|
|
|
@ -76,7 +76,6 @@ AtomBrowserMainParts* AtomBrowserMainParts::self_ = nullptr;
|
||||||
|
|
||||||
AtomBrowserMainParts::AtomBrowserMainParts()
|
AtomBrowserMainParts::AtomBrowserMainParts()
|
||||||
: fake_browser_process_(new BrowserProcess),
|
: fake_browser_process_(new BrowserProcess),
|
||||||
exit_code_(nullptr),
|
|
||||||
browser_(new Browser),
|
browser_(new Browser),
|
||||||
node_bindings_(NodeBindings::Create(NodeBindings::BROWSER)),
|
node_bindings_(NodeBindings::Create(NodeBindings::BROWSER)),
|
||||||
atom_bindings_(new AtomBindings(uv_default_loop())),
|
atom_bindings_(new AtomBindings(uv_default_loop())),
|
||||||
|
|
|
@ -94,7 +94,7 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
|
||||||
scoped_refptr<BridgeTaskRunner> bridge_task_runner_;
|
scoped_refptr<BridgeTaskRunner> bridge_task_runner_;
|
||||||
|
|
||||||
// Pointer to exit code.
|
// Pointer to exit code.
|
||||||
int* exit_code_;
|
int* exit_code_ = nullptr;
|
||||||
|
|
||||||
std::unique_ptr<Browser> browser_;
|
std::unique_ptr<Browser> browser_;
|
||||||
std::unique_ptr<JavascriptEnvironment> js_env_;
|
std::unique_ptr<JavascriptEnvironment> js_env_;
|
||||||
|
|
|
@ -23,14 +23,10 @@ namespace atom {
|
||||||
|
|
||||||
Browser::LoginItemSettings::LoginItemSettings() = default;
|
Browser::LoginItemSettings::LoginItemSettings() = default;
|
||||||
Browser::LoginItemSettings::~LoginItemSettings() = default;
|
Browser::LoginItemSettings::~LoginItemSettings() = default;
|
||||||
Browser::LoginItemSettings::LoginItemSettings(
|
Browser::LoginItemSettings::LoginItemSettings(const LoginItemSettings& other) =
|
||||||
const LoginItemSettings& other) = default;
|
default;
|
||||||
|
|
||||||
Browser::Browser()
|
Browser::Browser() {
|
||||||
: is_quiting_(false),
|
|
||||||
is_exiting_(false),
|
|
||||||
is_ready_(false),
|
|
||||||
is_shutdown_(false) {
|
|
||||||
WindowList::AddObserver(this);
|
WindowList::AddObserver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -254,7 +254,7 @@ class Browser : public WindowListObserver {
|
||||||
// Send the before-quit message and start closing windows.
|
// Send the before-quit message and start closing windows.
|
||||||
bool HandleBeforeQuit();
|
bool HandleBeforeQuit();
|
||||||
|
|
||||||
bool is_quiting_;
|
bool is_quiting_ = false;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// WindowListObserver implementations:
|
// WindowListObserver implementations:
|
||||||
|
@ -265,13 +265,13 @@ class Browser : public WindowListObserver {
|
||||||
base::ObserverList<BrowserObserver> observers_;
|
base::ObserverList<BrowserObserver> observers_;
|
||||||
|
|
||||||
// Whether `app.exit()` has been called
|
// Whether `app.exit()` has been called
|
||||||
bool is_exiting_;
|
bool is_exiting_ = false;
|
||||||
|
|
||||||
// Whether "ready" event has been emitted.
|
// Whether "ready" event has been emitted.
|
||||||
bool is_ready_;
|
bool is_ready_ = false;
|
||||||
|
|
||||||
// The browser is being shutdown.
|
// The browser is being shutdown.
|
||||||
bool is_shutdown_;
|
bool is_shutdown_ = false;
|
||||||
|
|
||||||
int badge_count_ = 0;
|
int badge_count_ = 0;
|
||||||
|
|
||||||
|
|
|
@ -141,11 +141,7 @@ bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
CommonWebContentsDelegate::CommonWebContentsDelegate()
|
CommonWebContentsDelegate::CommonWebContentsDelegate()
|
||||||
: offscreen_(false),
|
: devtools_file_system_indexer_(new DevToolsFileSystemIndexer) {}
|
||||||
ignore_menu_shortcuts_(false),
|
|
||||||
html_fullscreen_(false),
|
|
||||||
native_fullscreen_(false),
|
|
||||||
devtools_file_system_indexer_(new DevToolsFileSystemIndexer) {}
|
|
||||||
|
|
||||||
CommonWebContentsDelegate::~CommonWebContentsDelegate() {}
|
CommonWebContentsDelegate::~CommonWebContentsDelegate() {}
|
||||||
|
|
||||||
|
|
|
@ -155,14 +155,14 @@ class CommonWebContentsDelegate
|
||||||
// The window that this WebContents belongs to.
|
// The window that this WebContents belongs to.
|
||||||
base::WeakPtr<NativeWindow> owner_window_;
|
base::WeakPtr<NativeWindow> owner_window_;
|
||||||
|
|
||||||
bool offscreen_;
|
bool offscreen_ = false;
|
||||||
bool ignore_menu_shortcuts_;
|
bool ignore_menu_shortcuts_ = false;
|
||||||
|
|
||||||
// Whether window is fullscreened by HTML5 api.
|
// Whether window is fullscreened by HTML5 api.
|
||||||
bool html_fullscreen_;
|
bool html_fullscreen_ = false;
|
||||||
|
|
||||||
// Whether window is fullscreened by window api.
|
// Whether window is fullscreened by window api.
|
||||||
bool native_fullscreen_;
|
bool native_fullscreen_ = false;
|
||||||
|
|
||||||
// UI related helper classes.
|
// UI related helper classes.
|
||||||
#if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
|
#if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
|
||||||
|
|
|
@ -42,9 +42,7 @@ void OnDeviceChosen(const content::BluetoothChooser::EventHandler& handler,
|
||||||
|
|
||||||
BluetoothChooser::BluetoothChooser(api::WebContents* contents,
|
BluetoothChooser::BluetoothChooser(api::WebContents* contents,
|
||||||
const EventHandler& event_handler)
|
const EventHandler& event_handler)
|
||||||
: api_web_contents_(contents),
|
: api_web_contents_(contents), event_handler_(event_handler) {}
|
||||||
event_handler_(event_handler),
|
|
||||||
num_retries_(0) {}
|
|
||||||
|
|
||||||
BluetoothChooser::~BluetoothChooser() {}
|
BluetoothChooser::~BluetoothChooser() {}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ class BluetoothChooser : public content::BluetoothChooser {
|
||||||
std::vector<DeviceInfo> device_list_;
|
std::vector<DeviceInfo> device_list_;
|
||||||
api::WebContents* api_web_contents_;
|
api::WebContents* api_web_contents_;
|
||||||
EventHandler event_handler_;
|
EventHandler event_handler_;
|
||||||
int num_retries_;
|
int num_retries_ = 0;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(BluetoothChooser);
|
DISALLOW_COPY_AND_ASSIGN(BluetoothChooser);
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,11 +32,7 @@ void ResetLoginHandlerForRequest(net::URLRequest* request) {
|
||||||
|
|
||||||
LoginHandler::LoginHandler(net::AuthChallengeInfo* auth_info,
|
LoginHandler::LoginHandler(net::AuthChallengeInfo* auth_info,
|
||||||
net::URLRequest* request)
|
net::URLRequest* request)
|
||||||
: handled_auth_(false),
|
: auth_info_(auth_info), request_(request) {
|
||||||
auth_info_(auth_info),
|
|
||||||
request_(request),
|
|
||||||
render_process_host_id_(0),
|
|
||||||
render_frame_id_(0) {
|
|
||||||
content::ResourceRequestInfo::ForRequest(request_)->GetAssociatedRenderFrame(
|
content::ResourceRequestInfo::ForRequest(request_)->GetAssociatedRenderFrame(
|
||||||
&render_process_host_id_, &render_frame_id_);
|
&render_process_host_id_, &render_frame_id_);
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate {
|
||||||
bool TestAndSetAuthHandled();
|
bool TestAndSetAuthHandled();
|
||||||
|
|
||||||
// True if we've handled auth (Login or CancelAuth has been called).
|
// True if we've handled auth (Login or CancelAuth has been called).
|
||||||
bool handled_auth_;
|
bool handled_auth_ = false;
|
||||||
mutable base::Lock handled_auth_lock_;
|
mutable base::Lock handled_auth_lock_;
|
||||||
|
|
||||||
// Who/where/what asked for the authentication.
|
// Who/where/what asked for the authentication.
|
||||||
|
@ -61,11 +61,11 @@ class LoginHandler : public content::ResourceDispatcherHostLoginDelegate {
|
||||||
|
|
||||||
// The request that wants login data.
|
// The request that wants login data.
|
||||||
// This should only be accessed on the IO loop.
|
// This should only be accessed on the IO loop.
|
||||||
net::URLRequest* request_;
|
net::URLRequest* request_ = nullptr;
|
||||||
|
|
||||||
// Cached from the net::URLRequest, in case it goes NULL on us.
|
// Cached from the net::URLRequest, in case it goes NULL on us.
|
||||||
int render_process_host_id_;
|
int render_process_host_id_ = 0;
|
||||||
int render_frame_id_;
|
int render_frame_id_ = 0;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(LoginHandler);
|
DISALLOW_COPY_AND_ASSIGN(LoginHandler);
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,19 +47,7 @@ gfx::Size GetExpandedWindowSize(const NativeWindow* window, gfx::Size size) {
|
||||||
|
|
||||||
NativeWindow::NativeWindow(const mate::Dictionary& options,
|
NativeWindow::NativeWindow(const mate::Dictionary& options,
|
||||||
NativeWindow* parent)
|
NativeWindow* parent)
|
||||||
: widget_(new views::Widget),
|
: widget_(new views::Widget), parent_(parent), weak_factory_(this) {
|
||||||
content_view_(nullptr),
|
|
||||||
has_frame_(true),
|
|
||||||
transparent_(false),
|
|
||||||
enable_larger_than_screen_(false),
|
|
||||||
is_closed_(false),
|
|
||||||
sheet_offset_x_(0.0),
|
|
||||||
sheet_offset_y_(0.0),
|
|
||||||
aspect_ratio_(0.0),
|
|
||||||
parent_(parent),
|
|
||||||
is_modal_(false),
|
|
||||||
browser_view_(nullptr),
|
|
||||||
weak_factory_(this) {
|
|
||||||
options.Get(options::kFrame, &has_frame_);
|
options.Get(options::kFrame, &has_frame_);
|
||||||
options.Get(options::kTransparent, &transparent_);
|
options.Get(options::kTransparent, &transparent_);
|
||||||
options.Get(options::kEnableLargerThanScreen, &enable_larger_than_screen_);
|
options.Get(options::kEnableLargerThanScreen, &enable_larger_than_screen_);
|
||||||
|
|
|
@ -287,41 +287,41 @@ class NativeWindow : public base::SupportsUserData,
|
||||||
std::unique_ptr<views::Widget> widget_;
|
std::unique_ptr<views::Widget> widget_;
|
||||||
|
|
||||||
// The content view, weak ref.
|
// The content view, weak ref.
|
||||||
views::View* content_view_;
|
views::View* content_view_ = nullptr;
|
||||||
|
|
||||||
// Whether window has standard frame.
|
// Whether window has standard frame.
|
||||||
bool has_frame_;
|
bool has_frame_ = true;
|
||||||
|
|
||||||
// Whether window is transparent.
|
// Whether window is transparent.
|
||||||
bool transparent_;
|
bool transparent_ = false;
|
||||||
|
|
||||||
// Minimum and maximum size, stored as content size.
|
// Minimum and maximum size, stored as content size.
|
||||||
extensions::SizeConstraints size_constraints_;
|
extensions::SizeConstraints size_constraints_;
|
||||||
|
|
||||||
// Whether window can be resized larger than screen.
|
// Whether window can be resized larger than screen.
|
||||||
bool enable_larger_than_screen_;
|
bool enable_larger_than_screen_ = false;
|
||||||
|
|
||||||
// The windows has been closed.
|
// The windows has been closed.
|
||||||
bool is_closed_;
|
bool is_closed_ = false;
|
||||||
|
|
||||||
// Used to display sheets at the appropriate horizontal and vertical offsets
|
// Used to display sheets at the appropriate horizontal and vertical offsets
|
||||||
// on macOS.
|
// on macOS.
|
||||||
double sheet_offset_x_;
|
double sheet_offset_x_ = 0.0;
|
||||||
double sheet_offset_y_;
|
double sheet_offset_y_ = 0.0;
|
||||||
|
|
||||||
// Used to maintain the aspect ratio of a view which is inside of the
|
// Used to maintain the aspect ratio of a view which is inside of the
|
||||||
// content view.
|
// content view.
|
||||||
double aspect_ratio_;
|
double aspect_ratio_ = 0.0;
|
||||||
gfx::Size aspect_ratio_extraSize_;
|
gfx::Size aspect_ratio_extraSize_;
|
||||||
|
|
||||||
// The parent window, it is guaranteed to be valid during this window's life.
|
// The parent window, it is guaranteed to be valid during this window's life.
|
||||||
NativeWindow* parent_;
|
NativeWindow* parent_ = nullptr;
|
||||||
|
|
||||||
// Is this a modal window.
|
// Is this a modal window.
|
||||||
bool is_modal_;
|
bool is_modal_ = false;
|
||||||
|
|
||||||
// The browser view layer.
|
// The browser view layer.
|
||||||
NativeBrowserView* browser_view_;
|
NativeBrowserView* browser_view_ = nullptr;
|
||||||
|
|
||||||
// Observers of this window.
|
// Observers of this window.
|
||||||
base::ObserverList<NativeWindowObserver> observers_;
|
base::ObserverList<NativeWindowObserver> observers_;
|
||||||
|
|
|
@ -173,30 +173,30 @@ class NativeWindowMac : public NativeWindow {
|
||||||
// The view that fills the client area.
|
// The view that fills the client area.
|
||||||
std::unique_ptr<RootViewMac> root_view_;
|
std::unique_ptr<RootViewMac> root_view_;
|
||||||
|
|
||||||
bool is_kiosk_;
|
bool is_kiosk_ = false;
|
||||||
bool was_fullscreen_;
|
bool was_fullscreen_ = false;
|
||||||
bool zoom_to_page_width_;
|
bool zoom_to_page_width_ = false;
|
||||||
bool fullscreen_window_title_;
|
bool fullscreen_window_title_ = false;
|
||||||
bool resizable_;
|
bool resizable_ = true;
|
||||||
|
|
||||||
NSInteger attention_request_id_; // identifier from requestUserAttention
|
NSInteger attention_request_id_ = 0; // identifier from requestUserAttention
|
||||||
|
|
||||||
// The presentation options before entering kiosk mode.
|
// The presentation options before entering kiosk mode.
|
||||||
NSApplicationPresentationOptions kiosk_options_;
|
NSApplicationPresentationOptions kiosk_options_;
|
||||||
|
|
||||||
// The "titleBarStyle" option.
|
// The "titleBarStyle" option.
|
||||||
TitleBarStyle title_bar_style_;
|
TitleBarStyle title_bar_style_ = NORMAL;
|
||||||
|
|
||||||
// Simple (pre-Lion) Fullscreen Settings
|
// Simple (pre-Lion) Fullscreen Settings
|
||||||
bool always_simple_fullscreen_;
|
bool always_simple_fullscreen_ = false;
|
||||||
bool is_simple_fullscreen_;
|
bool is_simple_fullscreen_ = false;
|
||||||
bool was_maximizable_;
|
bool was_maximizable_ = false;
|
||||||
bool was_movable_;
|
bool was_movable_ = false;
|
||||||
NSRect original_frame_;
|
NSRect original_frame_;
|
||||||
NSUInteger simple_fullscreen_mask_;
|
NSUInteger simple_fullscreen_mask_;
|
||||||
|
|
||||||
base::scoped_nsobject<NSColor> background_color_before_vibrancy_;
|
base::scoped_nsobject<NSColor> background_color_before_vibrancy_;
|
||||||
bool transparency_before_vibrancy_;
|
bool transparency_before_vibrancy_ = false;
|
||||||
|
|
||||||
// The presentation options before entering simple fullscreen mode.
|
// The presentation options before entering simple fullscreen mode.
|
||||||
NSApplicationPresentationOptions simple_fullscreen_options_;
|
NSApplicationPresentationOptions simple_fullscreen_options_;
|
||||||
|
|
|
@ -255,17 +255,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) {
|
||||||
|
|
||||||
NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
|
NativeWindowMac::NativeWindowMac(const mate::Dictionary& options,
|
||||||
NativeWindow* parent)
|
NativeWindow* parent)
|
||||||
: NativeWindow(options, parent),
|
: NativeWindow(options, parent), root_view_(new RootViewMac(this)) {
|
||||||
root_view_(new RootViewMac(this)),
|
|
||||||
is_kiosk_(false),
|
|
||||||
was_fullscreen_(false),
|
|
||||||
zoom_to_page_width_(false),
|
|
||||||
fullscreen_window_title_(false),
|
|
||||||
resizable_(true),
|
|
||||||
attention_request_id_(0),
|
|
||||||
title_bar_style_(NORMAL),
|
|
||||||
always_simple_fullscreen_(false),
|
|
||||||
is_simple_fullscreen_(false) {
|
|
||||||
int width = 800, height = 600;
|
int width = 800, height = 600;
|
||||||
options.Get(options::kWidth, &width);
|
options.Get(options::kWidth, &width);
|
||||||
options.Get(options::kHeight, &height);
|
options.Get(options::kHeight, &height);
|
||||||
|
|
|
@ -102,19 +102,7 @@ NativeWindowViews::NativeWindowViews(const mate::Dictionary& options,
|
||||||
NativeWindow* parent)
|
NativeWindow* parent)
|
||||||
: NativeWindow(options, parent),
|
: NativeWindow(options, parent),
|
||||||
root_view_(new RootView(this)),
|
root_view_(new RootView(this)),
|
||||||
focused_view_(nullptr),
|
keyboard_event_handler_(new views::UnhandledKeyboardEventHandler) {
|
||||||
#if defined(OS_WIN)
|
|
||||||
checked_for_a11y_support_(false),
|
|
||||||
thick_frame_(true),
|
|
||||||
#endif
|
|
||||||
keyboard_event_handler_(new views::UnhandledKeyboardEventHandler),
|
|
||||||
disable_count_(0),
|
|
||||||
use_content_size_(false),
|
|
||||||
movable_(true),
|
|
||||||
resizable_(true),
|
|
||||||
maximizable_(true),
|
|
||||||
minimizable_(true),
|
|
||||||
fullscreenable_(true) {
|
|
||||||
options.Get(options::kTitle, &title_);
|
options.Get(options::kTitle, &title_);
|
||||||
|
|
||||||
bool menu_bar_autohide;
|
bool menu_bar_autohide;
|
||||||
|
|
|
@ -196,7 +196,8 @@ class NativeWindowViews : public NativeWindow,
|
||||||
|
|
||||||
std::unique_ptr<RootView> root_view_;
|
std::unique_ptr<RootView> root_view_;
|
||||||
|
|
||||||
views::View* focused_view_; // The view should be focused by default.
|
// The view should be focused by default.
|
||||||
|
views::View* focused_view_ = nullptr;
|
||||||
|
|
||||||
// The "resizable" flag on Linux is implemented by setting size constraints,
|
// The "resizable" flag on Linux is implemented by setting size constraints,
|
||||||
// we need to make sure size constraints are restored when window becomes
|
// we need to make sure size constraints are restored when window becomes
|
||||||
|
@ -241,10 +242,10 @@ class NativeWindowViews : public NativeWindow,
|
||||||
TaskbarHost taskbar_host_;
|
TaskbarHost taskbar_host_;
|
||||||
|
|
||||||
// Memoized version of a11y check
|
// Memoized version of a11y check
|
||||||
bool checked_for_a11y_support_;
|
bool checked_for_a11y_support_ = false;
|
||||||
|
|
||||||
// Whether to show the WS_THICKFRAME style.
|
// Whether to show the WS_THICKFRAME style.
|
||||||
bool thick_frame_;
|
bool thick_frame_ = true;
|
||||||
|
|
||||||
// The bounds of window before maximize/fullscreen.
|
// The bounds of window before maximize/fullscreen.
|
||||||
gfx::Rect restore_bounds_;
|
gfx::Rect restore_bounds_;
|
||||||
|
@ -269,14 +270,14 @@ class NativeWindowViews : public NativeWindow,
|
||||||
std::unique_ptr<SkRegion> draggable_region_; // used in custom drag.
|
std::unique_ptr<SkRegion> draggable_region_; // used in custom drag.
|
||||||
|
|
||||||
// How many times the Disable has been called.
|
// How many times the Disable has been called.
|
||||||
int disable_count_;
|
int disable_count_ = 0;
|
||||||
|
|
||||||
bool use_content_size_;
|
bool use_content_size_ = false;
|
||||||
bool movable_;
|
bool movable_ = true;
|
||||||
bool resizable_;
|
bool resizable_ = true;
|
||||||
bool maximizable_;
|
bool maximizable_ = true;
|
||||||
bool minimizable_;
|
bool minimizable_ = true;
|
||||||
bool fullscreenable_;
|
bool fullscreenable_ = true;
|
||||||
std::string title_;
|
std::string title_;
|
||||||
gfx::Size widget_size_;
|
gfx::Size widget_size_;
|
||||||
double opacity_ = 1.0;
|
double opacity_ = 1.0;
|
||||||
|
|
|
@ -32,20 +32,9 @@
|
||||||
|
|
||||||
namespace asar {
|
namespace asar {
|
||||||
|
|
||||||
URLRequestAsarJob::FileMetaInfo::FileMetaInfo()
|
|
||||||
: file_size(0),
|
|
||||||
mime_type_result(false),
|
|
||||||
file_exists(false),
|
|
||||||
is_directory(false) {}
|
|
||||||
|
|
||||||
URLRequestAsarJob::URLRequestAsarJob(net::URLRequest* request,
|
URLRequestAsarJob::URLRequestAsarJob(net::URLRequest* request,
|
||||||
net::NetworkDelegate* network_delegate)
|
net::NetworkDelegate* network_delegate)
|
||||||
: net::URLRequestJob(request, network_delegate),
|
: net::URLRequestJob(request, network_delegate), weak_ptr_factory_(this) {}
|
||||||
type_(TYPE_ERROR),
|
|
||||||
remaining_bytes_(0),
|
|
||||||
seek_offset_(0),
|
|
||||||
range_parse_result_(net::OK),
|
|
||||||
weak_ptr_factory_(this) {}
|
|
||||||
|
|
||||||
URLRequestAsarJob::~URLRequestAsarJob() {}
|
URLRequestAsarJob::~URLRequestAsarJob() {}
|
||||||
|
|
||||||
|
|
|
@ -74,19 +74,17 @@ class URLRequestAsarJob : public net::URLRequestJob {
|
||||||
// URLRequestFileJob and also passed between threads because disk access is
|
// URLRequestFileJob and also passed between threads because disk access is
|
||||||
// necessary to obtain it.
|
// necessary to obtain it.
|
||||||
struct FileMetaInfo {
|
struct FileMetaInfo {
|
||||||
FileMetaInfo();
|
|
||||||
|
|
||||||
// Size of the file.
|
// Size of the file.
|
||||||
int64_t file_size;
|
int64_t file_size = 0;
|
||||||
// Mime type associated with the file.
|
// Mime type associated with the file.
|
||||||
std::string mime_type;
|
std::string mime_type;
|
||||||
// Result returned from GetMimeTypeFromFile(), i.e. flag showing whether
|
// Result returned from GetMimeTypeFromFile(), i.e. flag showing whether
|
||||||
// obtaining of the mime type was successful.
|
// obtaining of the mime type was successful.
|
||||||
bool mime_type_result;
|
bool mime_type_result = false;
|
||||||
// Flag showing whether the file exists.
|
// Flag showing whether the file exists.
|
||||||
bool file_exists;
|
bool file_exists = false;
|
||||||
// Flag showing whether the file name actually refers to a directory.
|
// Flag showing whether the file name actually refers to a directory.
|
||||||
bool is_directory;
|
bool is_directory = false;
|
||||||
// Path to the file.
|
// Path to the file.
|
||||||
base::FilePath file_path;
|
base::FilePath file_path;
|
||||||
};
|
};
|
||||||
|
@ -109,7 +107,7 @@ class URLRequestAsarJob : public net::URLRequestJob {
|
||||||
// Callback after data is asynchronously read from the file into |buf|.
|
// Callback after data is asynchronously read from the file into |buf|.
|
||||||
void DidRead(scoped_refptr<net::IOBuffer> buf, int result);
|
void DidRead(scoped_refptr<net::IOBuffer> buf, int result);
|
||||||
|
|
||||||
JobType type_;
|
JobType type_ = TYPE_ERROR;
|
||||||
|
|
||||||
std::shared_ptr<Archive> archive_;
|
std::shared_ptr<Archive> archive_;
|
||||||
base::FilePath file_path_;
|
base::FilePath file_path_;
|
||||||
|
@ -120,10 +118,10 @@ class URLRequestAsarJob : public net::URLRequestJob {
|
||||||
scoped_refptr<base::TaskRunner> file_task_runner_;
|
scoped_refptr<base::TaskRunner> file_task_runner_;
|
||||||
|
|
||||||
net::HttpByteRange byte_range_;
|
net::HttpByteRange byte_range_;
|
||||||
int64_t remaining_bytes_;
|
int64_t remaining_bytes_ = 0;
|
||||||
int64_t seek_offset_;
|
int64_t seek_offset_ = 0;
|
||||||
|
|
||||||
net::Error range_parse_result_;
|
net::Error range_parse_result_ = net::OK;
|
||||||
|
|
||||||
base::WeakPtrFactory<URLRequestAsarJob> weak_ptr_factory_;
|
base::WeakPtrFactory<URLRequestAsarJob> weak_ptr_factory_;
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,6 @@ class CertVerifierRequest : public AtomCertVerifier::Request {
|
||||||
AtomCertVerifier* cert_verifier)
|
AtomCertVerifier* cert_verifier)
|
||||||
: params_(params),
|
: params_(params),
|
||||||
cert_verifier_(cert_verifier),
|
cert_verifier_(cert_verifier),
|
||||||
error_(net::ERR_IO_PENDING),
|
|
||||||
custom_response_(net::ERR_IO_PENDING),
|
|
||||||
first_response_(true),
|
|
||||||
weak_ptr_factory_(this) {}
|
weak_ptr_factory_(this) {}
|
||||||
|
|
||||||
~CertVerifierRequest() override {
|
~CertVerifierRequest() override {
|
||||||
|
@ -142,9 +139,9 @@ class CertVerifierRequest : public AtomCertVerifier::Request {
|
||||||
|
|
||||||
const AtomCertVerifier::RequestParams params_;
|
const AtomCertVerifier::RequestParams params_;
|
||||||
AtomCertVerifier* cert_verifier_;
|
AtomCertVerifier* cert_verifier_;
|
||||||
int error_;
|
int error_ = net::ERR_IO_PENDING;
|
||||||
int custom_response_;
|
int custom_response_ = net::ERR_IO_PENDING;
|
||||||
bool first_response_;
|
bool first_response_ = true;
|
||||||
ResponseList response_list_;
|
ResponseList response_list_;
|
||||||
net::CertVerifyResult result_;
|
net::CertVerifyResult result_;
|
||||||
std::unique_ptr<AtomCertVerifier::Request> default_verifier_request_;
|
std::unique_ptr<AtomCertVerifier::Request> default_verifier_request_;
|
||||||
|
|
|
@ -48,7 +48,6 @@ class UploadOwnedIOBufferElementReader : public net::UploadBytesElementReader {
|
||||||
|
|
||||||
AtomURLRequest::AtomURLRequest(api::URLRequest* delegate)
|
AtomURLRequest::AtomURLRequest(api::URLRequest* delegate)
|
||||||
: delegate_(delegate),
|
: delegate_(delegate),
|
||||||
is_chunked_upload_(false),
|
|
||||||
response_read_buffer_(new net::IOBuffer(kBufferSize)) {}
|
response_read_buffer_(new net::IOBuffer(kBufferSize)) {}
|
||||||
|
|
||||||
AtomURLRequest::~AtomURLRequest() {
|
AtomURLRequest::~AtomURLRequest() {
|
||||||
|
|
|
@ -103,7 +103,7 @@ class AtomURLRequest : public base::RefCountedThreadSafe<AtomURLRequest>,
|
||||||
std::unique_ptr<net::URLRequest> request_;
|
std::unique_ptr<net::URLRequest> request_;
|
||||||
scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
|
scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
|
||||||
|
|
||||||
bool is_chunked_upload_;
|
bool is_chunked_upload_ = false;
|
||||||
std::string redirect_policy_;
|
std::string redirect_policy_;
|
||||||
std::unique_ptr<net::ChunkedUploadDataStream> chunked_stream_;
|
std::unique_ptr<net::ChunkedUploadDataStream> chunked_stream_;
|
||||||
std::unique_ptr<net::ChunkedUploadDataStream::Writer> chunked_stream_writer_;
|
std::unique_ptr<net::ChunkedUploadDataStream::Writer> chunked_stream_writer_;
|
||||||
|
|
|
@ -46,8 +46,7 @@ net::URLFetcher::RequestType GetRequestType(const std::string& raw) {
|
||||||
// Pipe the response writer back to URLRequestFetchJob.
|
// Pipe the response writer back to URLRequestFetchJob.
|
||||||
class ResponsePiper : public net::URLFetcherResponseWriter {
|
class ResponsePiper : public net::URLFetcherResponseWriter {
|
||||||
public:
|
public:
|
||||||
explicit ResponsePiper(URLRequestFetchJob* job)
|
explicit ResponsePiper(URLRequestFetchJob* job) : job_(job) {}
|
||||||
: first_write_(true), job_(job) {}
|
|
||||||
|
|
||||||
// net::URLFetcherResponseWriter:
|
// net::URLFetcherResponseWriter:
|
||||||
int Initialize(const net::CompletionCallback& callback) override {
|
int Initialize(const net::CompletionCallback& callback) override {
|
||||||
|
@ -69,7 +68,7 @@ class ResponsePiper : public net::URLFetcherResponseWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool first_write_;
|
bool first_write_ = true;
|
||||||
URLRequestFetchJob* job_;
|
URLRequestFetchJob* job_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ResponsePiper);
|
DISALLOW_COPY_AND_ASSIGN(ResponsePiper);
|
||||||
|
@ -79,9 +78,7 @@ class ResponsePiper : public net::URLFetcherResponseWriter {
|
||||||
|
|
||||||
URLRequestFetchJob::URLRequestFetchJob(net::URLRequest* request,
|
URLRequestFetchJob::URLRequestFetchJob(net::URLRequest* request,
|
||||||
net::NetworkDelegate* network_delegate)
|
net::NetworkDelegate* network_delegate)
|
||||||
: JsAsker<net::URLRequestJob>(request, network_delegate),
|
: JsAsker<net::URLRequestJob>(request, network_delegate) {}
|
||||||
pending_buffer_size_(0),
|
|
||||||
write_num_bytes_(0) {}
|
|
||||||
|
|
||||||
URLRequestFetchJob::~URLRequestFetchJob() = default;
|
URLRequestFetchJob::~URLRequestFetchJob() = default;
|
||||||
|
|
||||||
|
|
|
@ -57,11 +57,11 @@ class URLRequestFetchJob : public JsAsker<net::URLRequestJob>,
|
||||||
|
|
||||||
// Saved arguments passed to ReadRawData.
|
// Saved arguments passed to ReadRawData.
|
||||||
scoped_refptr<net::IOBuffer> pending_buffer_;
|
scoped_refptr<net::IOBuffer> pending_buffer_;
|
||||||
int pending_buffer_size_;
|
int pending_buffer_size_ = 0;
|
||||||
|
|
||||||
// Saved arguments passed to DataAvailable.
|
// Saved arguments passed to DataAvailable.
|
||||||
scoped_refptr<net::IOBuffer> write_buffer_;
|
scoped_refptr<net::IOBuffer> write_buffer_;
|
||||||
int write_num_bytes_;
|
int write_num_bytes_ = 0;
|
||||||
net::CompletionCallback write_callback_;
|
net::CompletionCallback write_callback_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(URLRequestFetchJob);
|
DISALLOW_COPY_AND_ASSIGN(URLRequestFetchJob);
|
||||||
|
|
|
@ -21,11 +21,6 @@ namespace atom {
|
||||||
URLRequestStreamJob::URLRequestStreamJob(net::URLRequest* request,
|
URLRequestStreamJob::URLRequestStreamJob(net::URLRequest* request,
|
||||||
net::NetworkDelegate* network_delegate)
|
net::NetworkDelegate* network_delegate)
|
||||||
: JsAsker<net::URLRequestJob>(request, network_delegate),
|
: JsAsker<net::URLRequestJob>(request, network_delegate),
|
||||||
ended_(false),
|
|
||||||
errored_(false),
|
|
||||||
pending_io_buf_(nullptr),
|
|
||||||
pending_io_buf_size_(0),
|
|
||||||
response_headers_(nullptr),
|
|
||||||
weak_factory_(this) {}
|
weak_factory_(this) {}
|
||||||
|
|
||||||
URLRequestStreamJob::~URLRequestStreamJob() = default;
|
URLRequestStreamJob::~URLRequestStreamJob() = default;
|
||||||
|
|
|
@ -52,10 +52,10 @@ class URLRequestStreamJob : public JsAsker<net::URLRequestJob> {
|
||||||
void CopyMoreDataDone(scoped_refptr<net::IOBuffer> io_buf, int read_count);
|
void CopyMoreDataDone(scoped_refptr<net::IOBuffer> io_buf, int read_count);
|
||||||
|
|
||||||
std::deque<char> buffer_;
|
std::deque<char> buffer_;
|
||||||
bool ended_;
|
bool ended_ = false;
|
||||||
bool errored_;
|
bool errored_ = false;
|
||||||
scoped_refptr<net::IOBuffer> pending_io_buf_;
|
scoped_refptr<net::IOBuffer> pending_io_buf_;
|
||||||
int pending_io_buf_size_;
|
int pending_io_buf_size_ = 0;
|
||||||
scoped_refptr<net::HttpResponseHeaders> response_headers_;
|
scoped_refptr<net::HttpResponseHeaders> response_headers_;
|
||||||
mate::EventSubscriber<URLRequestStreamJob>::SafePtr subscriber_;
|
mate::EventSubscriber<URLRequestStreamJob>::SafePtr subscriber_;
|
||||||
base::WeakPtrFactory<URLRequestStreamJob> weak_factory_;
|
base::WeakPtrFactory<URLRequestStreamJob> weak_factory_;
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace atom {
|
||||||
|
|
||||||
OffScreenOutputDevice::OffScreenOutputDevice(bool transparent,
|
OffScreenOutputDevice::OffScreenOutputDevice(bool transparent,
|
||||||
const OnPaintCallback& callback)
|
const OnPaintCallback& callback)
|
||||||
: transparent_(transparent), callback_(callback), active_(false) {
|
: transparent_(transparent), callback_(callback) {
|
||||||
DCHECK(!callback_.is_null());
|
DCHECK(!callback_.is_null());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ class OffScreenOutputDevice : public viz::SoftwareOutputDevice {
|
||||||
const bool transparent_;
|
const bool transparent_;
|
||||||
OnPaintCallback callback_;
|
OnPaintCallback callback_;
|
||||||
|
|
||||||
bool active_;
|
bool active_ = false;
|
||||||
|
|
||||||
std::unique_ptr<SkCanvas> canvas_;
|
std::unique_ptr<SkCanvas> canvas_;
|
||||||
std::unique_ptr<SkBitmap> bitmap_;
|
std::unique_ptr<SkBitmap> bitmap_;
|
||||||
|
|
|
@ -117,8 +117,6 @@ class AtomCopyFrameGenerator {
|
||||||
AtomCopyFrameGenerator(OffScreenRenderWidgetHostView* view,
|
AtomCopyFrameGenerator(OffScreenRenderWidgetHostView* view,
|
||||||
int frame_rate_threshold_us)
|
int frame_rate_threshold_us)
|
||||||
: view_(view),
|
: view_(view),
|
||||||
frame_retry_count_(0),
|
|
||||||
next_frame_time_(base::TimeTicks::Now()),
|
|
||||||
frame_duration_(
|
frame_duration_(
|
||||||
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us)),
|
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us)),
|
||||||
weak_ptr_factory_(this) {
|
weak_ptr_factory_(this) {
|
||||||
|
@ -204,8 +202,8 @@ class AtomCopyFrameGenerator {
|
||||||
|
|
||||||
base::Time last_time_;
|
base::Time last_time_;
|
||||||
|
|
||||||
int frame_retry_count_;
|
int frame_retry_count_ = 0;
|
||||||
base::TimeTicks next_frame_time_;
|
base::TimeTicks next_frame_time_ = base::TimeTicks::Now();
|
||||||
base::TimeDelta frame_duration_;
|
base::TimeDelta frame_duration_;
|
||||||
|
|
||||||
base::WeakPtrFactory<AtomCopyFrameGenerator> weak_ptr_factory_;
|
base::WeakPtrFactory<AtomCopyFrameGenerator> weak_ptr_factory_;
|
||||||
|
@ -257,27 +255,14 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
|
||||||
NativeWindow* native_window)
|
NativeWindow* native_window)
|
||||||
: render_widget_host_(content::RenderWidgetHostImpl::From(host)),
|
: render_widget_host_(content::RenderWidgetHostImpl::From(host)),
|
||||||
parent_host_view_(parent_host_view),
|
parent_host_view_(parent_host_view),
|
||||||
popup_host_view_(nullptr),
|
|
||||||
child_host_view_(nullptr),
|
|
||||||
native_window_(native_window),
|
native_window_(native_window),
|
||||||
software_output_device_(nullptr),
|
|
||||||
transparent_(transparent),
|
transparent_(transparent),
|
||||||
callback_(callback),
|
callback_(callback),
|
||||||
parent_callback_(nullptr),
|
|
||||||
frame_rate_(frame_rate),
|
frame_rate_(frame_rate),
|
||||||
frame_rate_threshold_us_(0),
|
|
||||||
last_time_(base::Time::Now()),
|
|
||||||
scale_factor_(kDefaultScaleFactor),
|
scale_factor_(kDefaultScaleFactor),
|
||||||
size_(native_window->GetSize()),
|
size_(native_window->GetSize()),
|
||||||
painting_(painting),
|
painting_(painting),
|
||||||
is_showing_(!render_widget_host_->is_hidden()),
|
is_showing_(!render_widget_host_->is_hidden()),
|
||||||
is_destroyed_(false),
|
|
||||||
popup_position_(gfx::Rect()),
|
|
||||||
hold_resize_(false),
|
|
||||||
pending_resize_(false),
|
|
||||||
paint_callback_running_(false),
|
|
||||||
renderer_compositor_frame_sink_(nullptr),
|
|
||||||
background_color_(SkColor()),
|
|
||||||
weak_ptr_factory_(this) {
|
weak_ptr_factory_(this) {
|
||||||
DCHECK(render_widget_host_);
|
DCHECK(render_widget_host_);
|
||||||
bool is_guest_view_hack = parent_host_view_ != nullptr;
|
bool is_guest_view_hack = parent_host_view_ != nullptr;
|
||||||
|
|
|
@ -285,38 +285,38 @@ class OffScreenRenderWidgetHostView
|
||||||
// Weak ptrs.
|
// Weak ptrs.
|
||||||
content::RenderWidgetHostImpl* render_widget_host_;
|
content::RenderWidgetHostImpl* render_widget_host_;
|
||||||
|
|
||||||
OffScreenRenderWidgetHostView* parent_host_view_;
|
OffScreenRenderWidgetHostView* parent_host_view_ = nullptr;
|
||||||
OffScreenRenderWidgetHostView* popup_host_view_;
|
OffScreenRenderWidgetHostView* popup_host_view_ = nullptr;
|
||||||
std::unique_ptr<SkBitmap> popup_bitmap_;
|
std::unique_ptr<SkBitmap> popup_bitmap_;
|
||||||
OffScreenRenderWidgetHostView* child_host_view_;
|
OffScreenRenderWidgetHostView* child_host_view_ = nullptr;
|
||||||
std::set<OffScreenRenderWidgetHostView*> guest_host_views_;
|
std::set<OffScreenRenderWidgetHostView*> guest_host_views_;
|
||||||
std::set<OffscreenViewProxy*> proxy_views_;
|
std::set<OffscreenViewProxy*> proxy_views_;
|
||||||
|
|
||||||
NativeWindow* native_window_;
|
NativeWindow* native_window_;
|
||||||
OffScreenOutputDevice* software_output_device_;
|
OffScreenOutputDevice* software_output_device_ = nullptr;
|
||||||
|
|
||||||
const bool transparent_;
|
const bool transparent_;
|
||||||
OnPaintCallback callback_;
|
OnPaintCallback callback_;
|
||||||
OnPaintCallback parent_callback_;
|
OnPaintCallback parent_callback_;
|
||||||
|
|
||||||
int frame_rate_;
|
int frame_rate_ = 0;
|
||||||
int frame_rate_threshold_us_;
|
int frame_rate_threshold_us_ = 0;
|
||||||
|
|
||||||
base::Time last_time_;
|
base::Time last_time_ = base::Time::Now();
|
||||||
|
|
||||||
float scale_factor_;
|
float scale_factor_;
|
||||||
gfx::Vector2dF last_scroll_offset_;
|
gfx::Vector2dF last_scroll_offset_;
|
||||||
gfx::Size size_;
|
gfx::Size size_;
|
||||||
bool painting_;
|
bool painting_;
|
||||||
|
|
||||||
bool is_showing_;
|
bool is_showing_ = false;
|
||||||
bool is_destroyed_;
|
bool is_destroyed_ = false;
|
||||||
gfx::Rect popup_position_;
|
gfx::Rect popup_position_;
|
||||||
|
|
||||||
bool hold_resize_;
|
bool hold_resize_ = false;
|
||||||
bool pending_resize_;
|
bool pending_resize_ = false;
|
||||||
|
|
||||||
bool paint_callback_running_;
|
bool paint_callback_running_ = false;
|
||||||
|
|
||||||
viz::LocalSurfaceId local_surface_id_;
|
viz::LocalSurfaceId local_surface_id_;
|
||||||
viz::LocalSurfaceIdAllocator local_surface_id_allocator_;
|
viz::LocalSurfaceIdAllocator local_surface_id_allocator_;
|
||||||
|
@ -344,9 +344,10 @@ class OffScreenRenderWidgetHostView
|
||||||
std::string selected_text_;
|
std::string selected_text_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_;
|
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink_ =
|
||||||
|
nullptr;
|
||||||
|
|
||||||
SkColor background_color_;
|
SkColor background_color_ = SkColor();
|
||||||
|
|
||||||
base::WeakPtrFactory<OffScreenRenderWidgetHostView> weak_ptr_factory_;
|
base::WeakPtrFactory<OffScreenRenderWidgetHostView> weak_ptr_factory_;
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
OffscreenViewProxy::OffscreenViewProxy(views::View* view)
|
OffscreenViewProxy::OffscreenViewProxy(views::View* view) : view_(view) {
|
||||||
: view_(view), observer_(nullptr) {
|
|
||||||
view_bitmap_.reset(new SkBitmap);
|
view_bitmap_.reset(new SkBitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ class OffscreenViewProxy {
|
||||||
gfx::Rect view_bounds_;
|
gfx::Rect view_bounds_;
|
||||||
std::unique_ptr<SkBitmap> view_bitmap_;
|
std::unique_ptr<SkBitmap> view_bitmap_;
|
||||||
|
|
||||||
OffscreenViewProxyObserver* observer_;
|
OffscreenViewProxyObserver* observer_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace atom
|
} // namespace atom
|
||||||
|
|
|
@ -15,11 +15,7 @@ namespace atom {
|
||||||
OffScreenWebContentsView::OffScreenWebContentsView(
|
OffScreenWebContentsView::OffScreenWebContentsView(
|
||||||
bool transparent,
|
bool transparent,
|
||||||
const OnPaintCallback& callback)
|
const OnPaintCallback& callback)
|
||||||
: transparent_(transparent),
|
: transparent_(transparent), callback_(callback) {
|
||||||
painting_(true),
|
|
||||||
frame_rate_(60),
|
|
||||||
callback_(callback),
|
|
||||||
web_contents_(nullptr) {
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
PlatformCreate();
|
PlatformCreate();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -83,12 +83,12 @@ class OffScreenWebContentsView : public content::WebContentsView,
|
||||||
OffScreenRenderWidgetHostView* GetView() const;
|
OffScreenRenderWidgetHostView* GetView() const;
|
||||||
|
|
||||||
const bool transparent_;
|
const bool transparent_;
|
||||||
bool painting_;
|
bool painting_ = true;
|
||||||
int frame_rate_;
|
int frame_rate_ = 60;
|
||||||
OnPaintCallback callback_;
|
OnPaintCallback callback_;
|
||||||
|
|
||||||
// Weak refs.
|
// Weak refs.
|
||||||
content::WebContents* web_contents_;
|
content::WebContents* web_contents_ = nullptr;
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
OffScreenView* offScreenView_;
|
OffScreenView* offScreenView_;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
RenderProcessPreferences::RenderProcessPreferences(const Predicate& predicate)
|
RenderProcessPreferences::RenderProcessPreferences(const Predicate& predicate)
|
||||||
: predicate_(predicate), next_id_(0), cache_needs_update_(true) {
|
: predicate_(predicate) {
|
||||||
registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED,
|
registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED,
|
||||||
content::NotificationService::AllBrowserContextsAndSources());
|
content::NotificationService::AllBrowserContextsAndSources());
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,12 +45,12 @@ class RenderProcessPreferences : public content::NotificationObserver {
|
||||||
|
|
||||||
Predicate predicate_;
|
Predicate predicate_;
|
||||||
|
|
||||||
int next_id_;
|
int next_id_ = 0;
|
||||||
std::unordered_map<int, std::unique_ptr<base::DictionaryValue>> entries_;
|
std::unordered_map<int, std::unique_ptr<base::DictionaryValue>> entries_;
|
||||||
|
|
||||||
// We need to convert the |entries_| to ListValue for multiple times, this
|
// We need to convert the |entries_| to ListValue for multiple times, this
|
||||||
// caches is only updated when we are sending messages.
|
// caches is only updated when we are sending messages.
|
||||||
bool cache_needs_update_;
|
bool cache_needs_update_ = true;
|
||||||
base::ListValue cached_entries_;
|
base::ListValue cached_entries_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(RenderProcessPreferences);
|
DISALLOW_COPY_AND_ASSIGN(RenderProcessPreferences);
|
||||||
|
|
|
@ -42,7 +42,6 @@ class GtkMessageBox : public NativeWindowObserver {
|
||||||
const std::string& checkbox_label,
|
const std::string& checkbox_label,
|
||||||
bool checkbox_checked)
|
bool checkbox_checked)
|
||||||
: cancel_id_(cancel_id),
|
: cancel_id_(cancel_id),
|
||||||
checkbox_checked_(false),
|
|
||||||
parent_(static_cast<NativeWindow*>(parent_window)) {
|
parent_(static_cast<NativeWindow*>(parent_window)) {
|
||||||
// Create dialog.
|
// Create dialog.
|
||||||
dialog_ =
|
dialog_ =
|
||||||
|
@ -160,9 +159,9 @@ class GtkMessageBox : public NativeWindowObserver {
|
||||||
atom::UnresponsiveSuppressor unresponsive_suppressor_;
|
atom::UnresponsiveSuppressor unresponsive_suppressor_;
|
||||||
|
|
||||||
// The id to return when the dialog is closed without pressing buttons.
|
// The id to return when the dialog is closed without pressing buttons.
|
||||||
int cancel_id_;
|
int cancel_id_ = 0;
|
||||||
|
|
||||||
bool checkbox_checked_;
|
bool checkbox_checked_ = false;
|
||||||
|
|
||||||
NativeWindow* parent_;
|
NativeWindow* parent_;
|
||||||
GtkWidget* dialog_;
|
GtkWidget* dialog_;
|
||||||
|
|
|
@ -46,7 +46,7 @@ class TrayIconCocoa : public TrayIcon, public AtomMenuModel::Observer {
|
||||||
base::scoped_nsobject<AtomMenuController> menu_;
|
base::scoped_nsobject<AtomMenuController> menu_;
|
||||||
|
|
||||||
// Used for unregistering observer.
|
// Used for unregistering observer.
|
||||||
AtomMenuModel* menu_model_; // weak ref.
|
AtomMenuModel* menu_model_ = nullptr; // weak ref.
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TrayIconCocoa);
|
DISALLOW_COPY_AND_ASSIGN(TrayIconCocoa);
|
||||||
};
|
};
|
||||||
|
|
|
@ -291,7 +291,8 @@ const CGFloat kVerticalTitleMargin = 2;
|
||||||
|
|
||||||
// If we are ignoring double click events, we should ignore the `clickCount`
|
// If we are ignoring double click events, we should ignore the `clickCount`
|
||||||
// value and immediately emit a click event.
|
// value and immediately emit a click event.
|
||||||
BOOL shouldBeHandledAsASingleClick = (event.clickCount == 1) || ignoreDoubleClickEvents_;
|
BOOL shouldBeHandledAsASingleClick =
|
||||||
|
(event.clickCount == 1) || ignoreDoubleClickEvents_;
|
||||||
if (shouldBeHandledAsASingleClick)
|
if (shouldBeHandledAsASingleClick)
|
||||||
trayIcon_->NotifyClicked(
|
trayIcon_->NotifyClicked(
|
||||||
gfx::ScreenRectFromNSRect(event.window.frame),
|
gfx::ScreenRectFromNSRect(event.window.frame),
|
||||||
|
@ -299,7 +300,8 @@ const CGFloat kVerticalTitleMargin = 2;
|
||||||
ui::EventFlagsFromModifiers([event modifierFlags]));
|
ui::EventFlagsFromModifiers([event modifierFlags]));
|
||||||
|
|
||||||
// Double click event.
|
// Double click event.
|
||||||
BOOL shouldBeHandledAsADoubleClick = (event.clickCount == 2) && !ignoreDoubleClickEvents_;
|
BOOL shouldBeHandledAsADoubleClick =
|
||||||
|
(event.clickCount == 2) && !ignoreDoubleClickEvents_;
|
||||||
if (shouldBeHandledAsADoubleClick)
|
if (shouldBeHandledAsADoubleClick)
|
||||||
trayIcon_->NotifyDoubleClicked(
|
trayIcon_->NotifyDoubleClicked(
|
||||||
gfx::ScreenRectFromNSRect(event.window.frame),
|
gfx::ScreenRectFromNSRect(event.window.frame),
|
||||||
|
@ -417,7 +419,7 @@ const CGFloat kVerticalTitleMargin = 2;
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
TrayIconCocoa::TrayIconCocoa() : menu_model_(nullptr) {}
|
TrayIconCocoa::TrayIconCocoa() {}
|
||||||
|
|
||||||
TrayIconCocoa::~TrayIconCocoa() {
|
TrayIconCocoa::~TrayIconCocoa() {
|
||||||
[status_item_view_ removeItem];
|
[status_item_view_ removeItem];
|
||||||
|
|
|
@ -25,12 +25,7 @@ void AutofillPopupChildView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||||
|
|
||||||
AutofillPopupView::AutofillPopupView(AutofillPopup* popup,
|
AutofillPopupView::AutofillPopupView(AutofillPopup* popup,
|
||||||
views::Widget* parent_widget)
|
views::Widget* parent_widget)
|
||||||
: popup_(popup),
|
: popup_(popup), parent_widget_(parent_widget), weak_ptr_factory_(this) {
|
||||||
parent_widget_(parent_widget),
|
|
||||||
#if defined(ENABLE_OSR)
|
|
||||||
view_proxy_(nullptr),
|
|
||||||
#endif
|
|
||||||
weak_ptr_factory_(this) {
|
|
||||||
CreateChildViews();
|
CreateChildViews();
|
||||||
SetFocusBehavior(FocusBehavior::ALWAYS);
|
SetFocusBehavior(FocusBehavior::ALWAYS);
|
||||||
set_drag_controller(this);
|
set_drag_controller(this);
|
||||||
|
|
|
@ -22,7 +22,7 @@ const int kResizeAreaCornerSize = 16;
|
||||||
// static
|
// static
|
||||||
const char FramelessView::kViewClassName[] = "FramelessView";
|
const char FramelessView::kViewClassName[] = "FramelessView";
|
||||||
|
|
||||||
FramelessView::FramelessView() : window_(NULL), frame_(NULL) {}
|
FramelessView::FramelessView() {}
|
||||||
|
|
||||||
FramelessView::~FramelessView() {}
|
FramelessView::~FramelessView() {}
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ class FramelessView : public views::NonClientFrameView {
|
||||||
const char* GetClassName() const override;
|
const char* GetClassName() const override;
|
||||||
|
|
||||||
// Not owned.
|
// Not owned.
|
||||||
NativeWindowViews* window_;
|
NativeWindowViews* window_ = nullptr;
|
||||||
views::Widget* frame_;
|
views::Widget* frame_ = nullptr;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(FramelessView);
|
DISALLOW_COPY_AND_ASSIGN(FramelessView);
|
||||||
|
|
|
@ -181,8 +181,7 @@ std::string GetMenuModelStatus(AtomMenuModel* model) {
|
||||||
|
|
||||||
GlobalMenuBarX11::GlobalMenuBarX11(NativeWindowViews* window)
|
GlobalMenuBarX11::GlobalMenuBarX11(NativeWindowViews* window)
|
||||||
: window_(window),
|
: window_(window),
|
||||||
xid_(window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget()),
|
xid_(window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget()) {
|
||||||
server_(NULL) {
|
|
||||||
EnsureMethodsLoaded();
|
EnsureMethodsLoaded();
|
||||||
if (server_new)
|
if (server_new)
|
||||||
InitServer(xid_);
|
InitServer(xid_);
|
||||||
|
|
|
@ -71,7 +71,7 @@ class GlobalMenuBarX11 {
|
||||||
NativeWindowViews* window_;
|
NativeWindowViews* window_;
|
||||||
gfx::AcceleratedWidget xid_;
|
gfx::AcceleratedWidget xid_;
|
||||||
|
|
||||||
DbusmenuServer* server_;
|
DbusmenuServer* server_ = nullptr;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarX11);
|
DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarX11);
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,7 +26,7 @@ const SkColor kDefaultColor = SkColorSetARGB(255, 233, 233, 233);
|
||||||
const char MenuBar::kViewClassName[] = "ElectronMenuBar";
|
const char MenuBar::kViewClassName[] = "ElectronMenuBar";
|
||||||
|
|
||||||
MenuBar::MenuBar(views::View* window)
|
MenuBar::MenuBar(views::View* window)
|
||||||
: background_color_(kDefaultColor), window_(window), menu_model_(NULL) {
|
: background_color_(kDefaultColor), window_(window) {
|
||||||
RefreshColorCache();
|
RefreshColorCache();
|
||||||
UpdateViewColors();
|
UpdateViewColors();
|
||||||
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal));
|
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal));
|
||||||
|
|
|
@ -72,8 +72,8 @@ class MenuBar : public views::View,
|
||||||
SkColor disabled_color_;
|
SkColor disabled_color_;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
views::View* window_;
|
views::View* window_ = nullptr;
|
||||||
AtomMenuModel* menu_model_;
|
AtomMenuModel* menu_model_ = nullptr;
|
||||||
|
|
||||||
View* FindAccelChild(base::char16 key);
|
View* FindAccelChild(base::char16 key);
|
||||||
|
|
||||||
|
|
|
@ -22,13 +22,6 @@ SubmenuButton::SubmenuButton(const base::string16& title,
|
||||||
: views::MenuButton(gfx::RemoveAcceleratorChar(title, '&', NULL, NULL),
|
: views::MenuButton(gfx::RemoveAcceleratorChar(title, '&', NULL, NULL),
|
||||||
menu_button_listener,
|
menu_button_listener,
|
||||||
false),
|
false),
|
||||||
accelerator_(0),
|
|
||||||
show_underline_(false),
|
|
||||||
underline_start_(0),
|
|
||||||
underline_end_(0),
|
|
||||||
text_width_(0),
|
|
||||||
text_height_(0),
|
|
||||||
underline_color_(SK_ColorBLACK),
|
|
||||||
background_color_(background_color) {
|
background_color_(background_color) {
|
||||||
#if defined(OS_LINUX)
|
#if defined(OS_LINUX)
|
||||||
// Dont' use native style border.
|
// Dont' use native style border.
|
||||||
|
|
|
@ -39,15 +39,15 @@ class SubmenuButton : public views::MenuButton {
|
||||||
int index,
|
int index,
|
||||||
int* pos) const;
|
int* pos) const;
|
||||||
|
|
||||||
base::char16 accelerator_;
|
base::char16 accelerator_ = 0;
|
||||||
|
|
||||||
bool show_underline_;
|
bool show_underline_ = false;
|
||||||
|
|
||||||
int underline_start_;
|
int underline_start_ = 0;
|
||||||
int underline_end_;
|
int underline_end_ = 0;
|
||||||
int text_width_;
|
int text_width_ = 0;
|
||||||
int text_height_;
|
int text_height_ = 0;
|
||||||
SkColor underline_color_;
|
SkColor underline_color_ = SK_ColorBLACK;
|
||||||
SkColor background_color_;
|
SkColor background_color_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(SubmenuButton);
|
DISALLOW_COPY_AND_ASSIGN(SubmenuButton);
|
||||||
|
|
|
@ -56,7 +56,7 @@ void PopulateStreamInfo(base::DictionaryValue* stream_info,
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
PdfViewerHandler::PdfViewerHandler(const std::string& src)
|
PdfViewerHandler::PdfViewerHandler(const std::string& src)
|
||||||
: stream_(nullptr), original_url_(src) {}
|
: original_url_(src) {}
|
||||||
|
|
||||||
PdfViewerHandler::~PdfViewerHandler() {
|
PdfViewerHandler::~PdfViewerHandler() {
|
||||||
RemoveObserver();
|
RemoveObserver();
|
||||||
|
|
|
@ -53,7 +53,7 @@ class PdfViewerHandler : public content::WebUIMessageHandler,
|
||||||
void AddObserver();
|
void AddObserver();
|
||||||
void RemoveObserver();
|
void RemoveObserver();
|
||||||
std::unique_ptr<base::Value> initialize_callback_id_;
|
std::unique_ptr<base::Value> initialize_callback_id_;
|
||||||
content::StreamInfo* stream_;
|
content::StreamInfo* stream_ = nullptr;
|
||||||
std::string original_url_;
|
std::string original_url_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(PdfViewerHandler);
|
DISALLOW_COPY_AND_ASSIGN(PdfViewerHandler);
|
||||||
|
|
|
@ -19,11 +19,7 @@
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
NotifyIcon::NotifyIcon(NotifyIconHost* host, UINT id, HWND window, UINT message)
|
NotifyIcon::NotifyIcon(NotifyIconHost* host, UINT id, HWND window, UINT message)
|
||||||
: host_(host),
|
: host_(host), icon_id_(id), window_(window), message_id_(message) {
|
||||||
icon_id_(id),
|
|
||||||
window_(window),
|
|
||||||
message_id_(message),
|
|
||||||
menu_model_(NULL) {
|
|
||||||
NOTIFYICONDATA icon_data;
|
NOTIFYICONDATA icon_data;
|
||||||
InitIconData(&icon_data);
|
InitIconData(&icon_data);
|
||||||
icon_data.uFlags |= NIF_MESSAGE;
|
icon_data.uFlags |= NIF_MESSAGE;
|
||||||
|
|
|
@ -79,7 +79,7 @@ class NotifyIcon : public TrayIcon {
|
||||||
base::win::ScopedHICON icon_;
|
base::win::ScopedHICON icon_;
|
||||||
|
|
||||||
// The context menu.
|
// The context menu.
|
||||||
AtomMenuModel* menu_model_;
|
AtomMenuModel* menu_model_ = nullptr;
|
||||||
|
|
||||||
// Context menu associated with this icon (if any).
|
// Context menu associated with this icon (if any).
|
||||||
std::unique_ptr<views::MenuRunner> menu_runner_;
|
std::unique_ptr<views::MenuRunner> menu_runner_;
|
||||||
|
|
|
@ -47,8 +47,7 @@ int GetKeyboardModifers() {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NotifyIconHost::NotifyIconHost()
|
NotifyIconHost::NotifyIconHost() {
|
||||||
: next_icon_id_(1), atom_(0), instance_(NULL), window_(NULL) {
|
|
||||||
// Register our window class
|
// Register our window class
|
||||||
WNDCLASSEX window_class;
|
WNDCLASSEX window_class;
|
||||||
base::win::InitializeWindowClass(
|
base::win::InitializeWindowClass(
|
||||||
|
|
|
@ -40,23 +40,23 @@ class NotifyIconHost {
|
||||||
UINT NextIconId();
|
UINT NextIconId();
|
||||||
|
|
||||||
// The unique icon ID we will assign to the next icon.
|
// The unique icon ID we will assign to the next icon.
|
||||||
UINT next_icon_id_;
|
UINT next_icon_id_ = 1;
|
||||||
|
|
||||||
// List containing all active NotifyIcons.
|
// List containing all active NotifyIcons.
|
||||||
NotifyIcons notify_icons_;
|
NotifyIcons notify_icons_;
|
||||||
|
|
||||||
// The window class of |window_|.
|
// The window class of |window_|.
|
||||||
ATOM atom_;
|
ATOM atom_ = 0;
|
||||||
|
|
||||||
// The handle of the module that contains the window procedure of |window_|.
|
// The handle of the module that contains the window procedure of |window_|.
|
||||||
HMODULE instance_;
|
HMODULE instance_ = nullptr;
|
||||||
|
|
||||||
// The window used for processing events.
|
// The window used for processing events.
|
||||||
HWND window_;
|
HWND window_ = nullptr;
|
||||||
|
|
||||||
// The message ID of the "TaskbarCreated" message, sent to us when we need to
|
// The message ID of the "TaskbarCreated" message, sent to us when we need to
|
||||||
// reset our status icons.
|
// reset our status icons.
|
||||||
UINT taskbar_created_message_;
|
UINT taskbar_created_message_ = 0;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(NotifyIconHost);
|
DISALLOW_COPY_AND_ASSIGN(NotifyIconHost);
|
||||||
};
|
};
|
||||||
|
|
|
@ -50,7 +50,7 @@ bool GetThumbarButtonFlags(const std::vector<std::string>& flags,
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TaskbarHost::TaskbarHost() : thumbar_buttons_added_(false) {}
|
TaskbarHost::TaskbarHost() {}
|
||||||
|
|
||||||
TaskbarHost::~TaskbarHost() {}
|
TaskbarHost::~TaskbarHost() {}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ class TaskbarHost {
|
||||||
base::win::ScopedComPtr<ITaskbarList3> taskbar_;
|
base::win::ScopedComPtr<ITaskbarList3> taskbar_;
|
||||||
|
|
||||||
// Whether we have already added the buttons to thumbar.
|
// Whether we have already added the buttons to thumbar.
|
||||||
bool thumbar_buttons_added_;
|
bool thumbar_buttons_added_ = false;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TaskbarHost);
|
DISALLOW_COPY_AND_ASSIGN(TaskbarHost);
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,10 +12,7 @@
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
WindowStateWatcher::WindowStateWatcher(NativeWindowViews* window)
|
WindowStateWatcher::WindowStateWatcher(NativeWindowViews* window)
|
||||||
: window_(window),
|
: window_(window), widget_(window->GetAcceleratedWidget()) {
|
||||||
widget_(window->GetAcceleratedWidget()),
|
|
||||||
was_minimized_(false),
|
|
||||||
was_maximized_(false) {
|
|
||||||
ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this);
|
ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ class WindowStateWatcher : public ui::PlatformEventObserver {
|
||||||
NativeWindowViews* window_;
|
NativeWindowViews* window_;
|
||||||
gfx::AcceleratedWidget widget_;
|
gfx::AcceleratedWidget widget_;
|
||||||
|
|
||||||
bool was_minimized_;
|
bool was_minimized_ = false;
|
||||||
bool was_maximized_;
|
bool was_maximized_ = false;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WindowStateWatcher);
|
DISALLOW_COPY_AND_ASSIGN(WindowStateWatcher);
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,12 +21,7 @@ namespace atom {
|
||||||
|
|
||||||
WebContentsZoomController::WebContentsZoomController(
|
WebContentsZoomController::WebContentsZoomController(
|
||||||
content::WebContents* web_contents)
|
content::WebContents* web_contents)
|
||||||
: content::WebContentsObserver(web_contents),
|
: content::WebContentsObserver(web_contents) {
|
||||||
zoom_mode_(ZOOM_MODE_DEFAULT),
|
|
||||||
zoom_level_(1.0),
|
|
||||||
old_process_id_(-1),
|
|
||||||
old_view_id_(-1),
|
|
||||||
embedder_zoom_controller_(nullptr) {
|
|
||||||
default_zoom_factor_ = content::kEpsilon;
|
default_zoom_factor_ = content::kEpsilon;
|
||||||
host_zoom_map_ = content::HostZoomMap::GetForWebContents(web_contents);
|
host_zoom_map_ = content::HostZoomMap::GetForWebContents(web_contents);
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,19 +93,18 @@ class WebContentsZoomController
|
||||||
void SetZoomFactorOnNavigationIfNeeded(const GURL& url);
|
void SetZoomFactorOnNavigationIfNeeded(const GURL& url);
|
||||||
|
|
||||||
// The current zoom mode.
|
// The current zoom mode.
|
||||||
ZoomMode zoom_mode_;
|
ZoomMode zoom_mode_ = ZOOM_MODE_DEFAULT;
|
||||||
|
|
||||||
// Current zoom level.
|
// Current zoom level.
|
||||||
double zoom_level_;
|
double zoom_level_ = 1.0;
|
||||||
|
|
||||||
// kZoomFactor.
|
// kZoomFactor.
|
||||||
double default_zoom_factor_;
|
double default_zoom_factor_ = 0;
|
||||||
double temporary_zoom_level_;
|
|
||||||
|
|
||||||
int old_process_id_;
|
int old_process_id_ = -1;
|
||||||
int old_view_id_;
|
int old_view_id_ = -1;
|
||||||
|
|
||||||
WebContentsZoomController* embedder_zoom_controller_;
|
WebContentsZoomController* embedder_zoom_controller_ = nullptr;
|
||||||
|
|
||||||
base::ObserverList<Observer> observers_;
|
base::ObserverList<Observer> observers_;
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,7 @@ const int kDefaultHeight = 300;
|
||||||
SetSizeParams::SetSizeParams() = default;
|
SetSizeParams::SetSizeParams() = default;
|
||||||
SetSizeParams::~SetSizeParams() = default;
|
SetSizeParams::~SetSizeParams() = default;
|
||||||
|
|
||||||
WebViewGuestDelegate::WebViewGuestDelegate()
|
WebViewGuestDelegate::WebViewGuestDelegate() {}
|
||||||
: embedder_zoom_controller_(nullptr),
|
|
||||||
guest_host_(nullptr),
|
|
||||||
auto_size_enabled_(false),
|
|
||||||
is_full_page_plugin_(false),
|
|
||||||
attached_(false),
|
|
||||||
api_web_contents_(nullptr) {}
|
|
||||||
|
|
||||||
WebViewGuestDelegate::~WebViewGuestDelegate() {}
|
WebViewGuestDelegate::~WebViewGuestDelegate() {}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
|
||||||
|
|
||||||
// The zoom controller of the embedder that is used
|
// The zoom controller of the embedder that is used
|
||||||
// to subscribe for zoom changes.
|
// to subscribe for zoom changes.
|
||||||
WebContentsZoomController* embedder_zoom_controller_;
|
WebContentsZoomController* embedder_zoom_controller_ = nullptr;
|
||||||
|
|
||||||
// The size of the container element.
|
// The size of the container element.
|
||||||
gfx::Size element_size_;
|
gfx::Size element_size_;
|
||||||
|
@ -105,10 +105,10 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
|
||||||
gfx::Size guest_size_;
|
gfx::Size guest_size_;
|
||||||
|
|
||||||
// A pointer to the guest_host.
|
// A pointer to the guest_host.
|
||||||
content::GuestHost* guest_host_;
|
content::GuestHost* guest_host_ = nullptr;
|
||||||
|
|
||||||
// Indicates whether autosize mode is enabled or not.
|
// Indicates whether autosize mode is enabled or not.
|
||||||
bool auto_size_enabled_;
|
bool auto_size_enabled_ = false;
|
||||||
|
|
||||||
// The maximum size constraints of the container element in autosize mode.
|
// The maximum size constraints of the container element in autosize mode.
|
||||||
gfx::Size max_auto_size_;
|
gfx::Size max_auto_size_;
|
||||||
|
@ -120,12 +120,12 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
|
||||||
gfx::Size normal_size_;
|
gfx::Size normal_size_;
|
||||||
|
|
||||||
// Whether the guest view is inside a plugin document.
|
// Whether the guest view is inside a plugin document.
|
||||||
bool is_full_page_plugin_;
|
bool is_full_page_plugin_ = false;
|
||||||
|
|
||||||
// Whether attached.
|
// Whether attached.
|
||||||
bool attached_;
|
bool attached_ = false;
|
||||||
|
|
||||||
api::WebContents* api_web_contents_;
|
api::WebContents* api_web_contents_ = nullptr;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WebViewGuestDelegate);
|
DISALLOW_COPY_AND_ASSIGN(WebViewGuestDelegate);
|
||||||
};
|
};
|
||||||
|
|
|
@ -117,15 +117,13 @@ bool FillFileInfoWithNode(Archive::FileInfo* info,
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
Archive::Archive(const base::FilePath& path)
|
Archive::Archive(const base::FilePath& path)
|
||||||
: path_(path), file_(base::File::FILE_OK), header_size_(0) {
|
: path_(path), file_(base::File::FILE_OK) {
|
||||||
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
||||||
file_.Initialize(path_, base::File::FLAG_OPEN | base::File::FLAG_READ);
|
file_.Initialize(path_, base::File::FLAG_OPEN | base::File::FLAG_READ);
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
fd_ = _open_osfhandle(reinterpret_cast<intptr_t>(file_.GetPlatformFile()), 0);
|
fd_ = _open_osfhandle(reinterpret_cast<intptr_t>(file_.GetPlatformFile()), 0);
|
||||||
#elif defined(OS_POSIX)
|
#elif defined(OS_POSIX)
|
||||||
fd_ = file_.GetPlatformFile();
|
fd_ = file_.GetPlatformFile();
|
||||||
#else
|
|
||||||
fd_ = -1;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,8 +70,8 @@ class Archive {
|
||||||
private:
|
private:
|
||||||
base::FilePath path_;
|
base::FilePath path_;
|
||||||
base::File file_;
|
base::File file_;
|
||||||
int fd_;
|
int fd_ = -1;
|
||||||
uint32_t header_size_;
|
uint32_t header_size_ = 0;
|
||||||
std::unique_ptr<base::DictionaryValue> header_;
|
std::unique_ptr<base::DictionaryValue> header_;
|
||||||
|
|
||||||
// Cached external temporary files.
|
// Cached external temporary files.
|
||||||
|
|
|
@ -35,8 +35,7 @@ static const off_t kMaxMinidumpFileSize = 1258291;
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
CrashReporterLinux::CrashReporterLinux()
|
CrashReporterLinux::CrashReporterLinux() : pid_(getpid()) {
|
||||||
: process_start_time_(0), pid_(getpid()), upload_to_server_(true) {
|
|
||||||
// Set the base process start time value.
|
// Set the base process start time value.
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
if (!gettimeofday(&tv, NULL)) {
|
if (!gettimeofday(&tv, NULL)) {
|
||||||
|
|
|
@ -54,10 +54,10 @@ class CrashReporterLinux : public CrashReporter {
|
||||||
std::unique_ptr<google_breakpad::ExceptionHandler> breakpad_;
|
std::unique_ptr<google_breakpad::ExceptionHandler> breakpad_;
|
||||||
std::unique_ptr<CrashKeyStorage> crash_keys_;
|
std::unique_ptr<CrashKeyStorage> crash_keys_;
|
||||||
|
|
||||||
uint64_t process_start_time_;
|
uint64_t process_start_time_ = 0;
|
||||||
pid_t pid_;
|
pid_t pid_ = 0;
|
||||||
std::string upload_url_;
|
std::string upload_url_;
|
||||||
bool upload_to_server_;
|
bool upload_to_server_ = true;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReporterLinux);
|
DISALLOW_COPY_AND_ASSIGN(CrashReporterLinux);
|
||||||
};
|
};
|
||||||
|
|
|
@ -137,8 +137,7 @@ void UnregisterNonABICompliantCodeRange(void* start) {
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
CrashReporterWin::CrashReporterWin()
|
CrashReporterWin::CrashReporterWin() {}
|
||||||
: skip_system_crash_handler_(false), code_range_registered_(false) {}
|
|
||||||
|
|
||||||
CrashReporterWin::~CrashReporterWin() {}
|
CrashReporterWin::~CrashReporterWin() {}
|
||||||
|
|
||||||
|
|
|
@ -64,8 +64,8 @@ class CrashReporterWin : public CrashReporter {
|
||||||
std::vector<google_breakpad::CustomInfoEntry> custom_info_entries_;
|
std::vector<google_breakpad::CustomInfoEntry> custom_info_entries_;
|
||||||
google_breakpad::CustomClientInfo custom_info_;
|
google_breakpad::CustomClientInfo custom_info_;
|
||||||
|
|
||||||
bool skip_system_crash_handler_;
|
bool skip_system_crash_handler_ = false;
|
||||||
bool code_range_registered_;
|
bool code_range_registered_ = false;
|
||||||
std::unique_ptr<google_breakpad::ExceptionHandler> breakpad_;
|
std::unique_ptr<google_breakpad::ExceptionHandler> breakpad_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashReporterWin);
|
DISALLOW_COPY_AND_ASSIGN(CrashReporterWin);
|
||||||
|
|
|
@ -152,10 +152,10 @@ class MimeWriter {
|
||||||
void AddItemWithoutTrailingSpaces(const void* base, size_t size);
|
void AddItemWithoutTrailingSpaces(const void* base, size_t size);
|
||||||
|
|
||||||
struct kernel_iovec iov_[kIovCapacity];
|
struct kernel_iovec iov_[kIovCapacity];
|
||||||
int iov_index_;
|
int iov_index_ = 0;
|
||||||
|
|
||||||
// Output file descriptor.
|
// Output file descriptor.
|
||||||
int fd_;
|
int fd_ = -1;
|
||||||
|
|
||||||
const char* const mime_boundary_;
|
const char* const mime_boundary_;
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ class MimeWriter {
|
||||||
};
|
};
|
||||||
|
|
||||||
MimeWriter::MimeWriter(int fd, const char* const mime_boundary)
|
MimeWriter::MimeWriter(int fd, const char* const mime_boundary)
|
||||||
: iov_index_(0), fd_(fd), mime_boundary_(mime_boundary) {}
|
: fd_(fd), mime_boundary_(mime_boundary) {}
|
||||||
|
|
||||||
MimeWriter::~MimeWriter() {}
|
MimeWriter::~MimeWriter() {}
|
||||||
|
|
||||||
|
|
|
@ -188,13 +188,7 @@ const char CrashService::kDumpsDir[] = "dumps-dir";
|
||||||
const char CrashService::kPipeName[] = "pipe-name";
|
const char CrashService::kPipeName[] = "pipe-name";
|
||||||
const char CrashService::kReporterURL[] = "reporter-url";
|
const char CrashService::kReporterURL[] = "reporter-url";
|
||||||
|
|
||||||
CrashService::CrashService()
|
CrashService::CrashService() {}
|
||||||
: sender_(NULL),
|
|
||||||
dumper_(NULL),
|
|
||||||
requests_handled_(0),
|
|
||||||
requests_sent_(0),
|
|
||||||
clients_connected_(0),
|
|
||||||
clients_terminated_(0) {}
|
|
||||||
|
|
||||||
CrashService::~CrashService() {
|
CrashService::~CrashService() {
|
||||||
base::AutoLock lock(sending_);
|
base::AutoLock lock(sending_);
|
||||||
|
|
|
@ -102,8 +102,8 @@ class CrashService {
|
||||||
// LocalFree.
|
// LocalFree.
|
||||||
PSECURITY_DESCRIPTOR GetSecurityDescriptorForLowIntegrity();
|
PSECURITY_DESCRIPTOR GetSecurityDescriptorForLowIntegrity();
|
||||||
|
|
||||||
google_breakpad::CrashGenerationServer* dumper_;
|
google_breakpad::CrashGenerationServer* dumper_ = nullptr;
|
||||||
google_breakpad::CrashReportSender* sender_;
|
google_breakpad::CrashReportSender* sender_ = nullptr;
|
||||||
|
|
||||||
// the extra tag sent to the server with each dump.
|
// the extra tag sent to the server with each dump.
|
||||||
std::wstring reporter_tag_;
|
std::wstring reporter_tag_;
|
||||||
|
@ -112,10 +112,10 @@ class CrashService {
|
||||||
std::wstring reporter_url_;
|
std::wstring reporter_url_;
|
||||||
|
|
||||||
// clients serviced statistics:
|
// clients serviced statistics:
|
||||||
int requests_handled_;
|
int requests_handled_ = 0;
|
||||||
int requests_sent_;
|
int requests_sent_ = 0;
|
||||||
volatile LONG clients_connected_;
|
volatile LONG clients_connected_ = 0;
|
||||||
volatile LONG clients_terminated_;
|
volatile LONG clients_terminated_ = 0;
|
||||||
base::Lock sending_;
|
base::Lock sending_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CrashService);
|
DISALLOW_COPY_AND_ASSIGN(CrashService);
|
||||||
|
|
|
@ -122,11 +122,7 @@ class V8ValueConverter::ScopedUniquenessGuard {
|
||||||
DISALLOW_COPY_AND_ASSIGN(ScopedUniquenessGuard);
|
DISALLOW_COPY_AND_ASSIGN(ScopedUniquenessGuard);
|
||||||
};
|
};
|
||||||
|
|
||||||
V8ValueConverter::V8ValueConverter()
|
V8ValueConverter::V8ValueConverter() {}
|
||||||
: reg_exp_allowed_(false),
|
|
||||||
function_allowed_(false),
|
|
||||||
disable_node_(false),
|
|
||||||
strip_null_from_objects_(false) {}
|
|
||||||
|
|
||||||
void V8ValueConverter::SetRegExpAllowed(bool val) {
|
void V8ValueConverter::SetRegExpAllowed(bool val) {
|
||||||
reg_exp_allowed_ = val;
|
reg_exp_allowed_ = val;
|
||||||
|
|
|
@ -58,21 +58,21 @@ class V8ValueConverter {
|
||||||
v8::Isolate* isolate) const;
|
v8::Isolate* isolate) const;
|
||||||
|
|
||||||
// If true, we will convert RegExp JavaScript objects to string.
|
// If true, we will convert RegExp JavaScript objects to string.
|
||||||
bool reg_exp_allowed_;
|
bool reg_exp_allowed_ = false;
|
||||||
|
|
||||||
// If true, we will convert Function JavaScript objects to dictionaries.
|
// If true, we will convert Function JavaScript objects to dictionaries.
|
||||||
bool function_allowed_;
|
bool function_allowed_ = false;
|
||||||
|
|
||||||
// If true, will not use node::Buffer::Copy to deserialize byte arrays.
|
// If true, will not use node::Buffer::Copy to deserialize byte arrays.
|
||||||
// node::Buffer::Copy depends on a working node.js environment, and this is
|
// node::Buffer::Copy depends on a working node.js environment, and this is
|
||||||
// not desirable in sandboxed renderers. That means Buffer instances sent from
|
// not desirable in sandboxed renderers. That means Buffer instances sent from
|
||||||
// browser process will be deserialized as browserify-based Buffer(which are
|
// browser process will be deserialized as browserify-based Buffer(which are
|
||||||
// wrappers around Uint8Array).
|
// wrappers around Uint8Array).
|
||||||
bool disable_node_;
|
bool disable_node_ = false;
|
||||||
|
|
||||||
// If true, undefined and null values are ignored when converting v8 objects
|
// If true, undefined and null values are ignored when converting v8 objects
|
||||||
// into Values.
|
// into Values.
|
||||||
bool strip_null_from_objects_;
|
bool strip_null_from_objects_ = false;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(V8ValueConverter);
|
DISALLOW_COPY_AND_ASSIGN(V8ValueConverter);
|
||||||
};
|
};
|
||||||
|
|
|
@ -135,10 +135,7 @@ base::FilePath GetResourcesPath(bool is_browser) {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
NodeBindings::NodeBindings(BrowserEnvironment browser_env)
|
NodeBindings::NodeBindings(BrowserEnvironment browser_env)
|
||||||
: browser_env_(browser_env),
|
: browser_env_(browser_env), weak_factory_(this) {
|
||||||
embed_closed_(false),
|
|
||||||
uv_env_(nullptr),
|
|
||||||
weak_factory_(this) {
|
|
||||||
if (browser_env == WORKER) {
|
if (browser_env == WORKER) {
|
||||||
uv_loop_init(&worker_loop_);
|
uv_loop_init(&worker_loop_);
|
||||||
uv_loop_ = &worker_loop_;
|
uv_loop_ = &worker_loop_;
|
||||||
|
|
|
@ -87,7 +87,7 @@ class NodeBindings {
|
||||||
static void EmbedThreadRunner(void* arg);
|
static void EmbedThreadRunner(void* arg);
|
||||||
|
|
||||||
// Whether the libuv loop has ended.
|
// Whether the libuv loop has ended.
|
||||||
bool embed_closed_;
|
bool embed_closed_ = false;
|
||||||
|
|
||||||
// Loop used when constructed in WORKER mode
|
// Loop used when constructed in WORKER mode
|
||||||
uv_loop_t worker_loop_;
|
uv_loop_t worker_loop_;
|
||||||
|
@ -102,7 +102,7 @@ class NodeBindings {
|
||||||
uv_sem_t embed_sem_;
|
uv_sem_t embed_sem_;
|
||||||
|
|
||||||
// Environment that to wrap the uv loop.
|
// Environment that to wrap the uv loop.
|
||||||
node::Environment* uv_env_;
|
node::Environment* uv_env_ = nullptr;
|
||||||
|
|
||||||
base::WeakPtrFactory<NodeBindings> weak_factory_;
|
base::WeakPtrFactory<NodeBindings> weak_factory_;
|
||||||
|
|
||||||
|
|
|
@ -50,10 +50,7 @@ void TrimStringVectorForIPC(std::vector<base::string16>* strings) {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
AutofillAgent::AutofillAgent(content::RenderFrame* frame)
|
AutofillAgent::AutofillAgent(content::RenderFrame* frame)
|
||||||
: content::RenderFrameObserver(frame),
|
: content::RenderFrameObserver(frame), weak_ptr_factory_(this) {
|
||||||
focused_node_was_last_clicked_(false),
|
|
||||||
was_focused_before_now_(false),
|
|
||||||
weak_ptr_factory_(this) {
|
|
||||||
render_frame()->GetWebFrame()->SetAutofillClient(this);
|
render_frame()->GetWebFrame()->SetAutofillClient(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,12 +62,12 @@ class AutofillAgent : public content::RenderFrameObserver,
|
||||||
void DoFocusChangeComplete();
|
void DoFocusChangeComplete();
|
||||||
|
|
||||||
// True when the last click was on the focused node.
|
// True when the last click was on the focused node.
|
||||||
bool focused_node_was_last_clicked_;
|
bool focused_node_was_last_clicked_ = false;
|
||||||
|
|
||||||
// This is set to false when the focus changes, then set back to true soon
|
// This is set to false when the focus changes, then set back to true soon
|
||||||
// afterwards. This helps track whether an event happened after a node was
|
// afterwards. This helps track whether an event happened after a node was
|
||||||
// already focused, or if it caused the focus to change.
|
// already focused, or if it caused the focus to change.
|
||||||
bool was_focused_before_now_;
|
bool was_focused_before_now_ = false;
|
||||||
|
|
||||||
base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_;
|
base::WeakPtrFactory<AutofillAgent> weak_ptr_factory_;
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,7 @@ AtomRenderFrameObserver::AtomRenderFrameObserver(
|
||||||
RendererClientBase* renderer_client)
|
RendererClientBase* renderer_client)
|
||||||
: content::RenderFrameObserver(frame),
|
: content::RenderFrameObserver(frame),
|
||||||
render_frame_(frame),
|
render_frame_(frame),
|
||||||
renderer_client_(renderer_client),
|
renderer_client_(renderer_client) {
|
||||||
document_created_(false) {
|
|
||||||
// Initialise resource for directory listing.
|
// Initialise resource for directory listing.
|
||||||
net::NetModule::SetResourceProvider(NetResourceProvider);
|
net::NetModule::SetResourceProvider(NetResourceProvider);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ class AtomRenderFrameObserver : public content::RenderFrameObserver {
|
||||||
|
|
||||||
content::RenderFrame* render_frame_;
|
content::RenderFrame* render_frame_;
|
||||||
RendererClientBase* renderer_client_;
|
RendererClientBase* renderer_client_;
|
||||||
bool document_created_;
|
bool document_created_ = false;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(AtomRenderFrameObserver);
|
DISALLOW_COPY_AND_ASSIGN(AtomRenderFrameObserver);
|
||||||
};
|
};
|
||||||
|
|
|
@ -37,8 +37,7 @@ bool IsDevToolsExtension(content::RenderFrame* render_frame) {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
AtomRendererClient::AtomRendererClient()
|
AtomRendererClient::AtomRendererClient()
|
||||||
: node_integration_initialized_(false),
|
: node_bindings_(NodeBindings::Create(NodeBindings::RENDERER)),
|
||||||
node_bindings_(NodeBindings::Create(NodeBindings::RENDERER)),
|
|
||||||
atom_bindings_(new AtomBindings(uv_default_loop())) {}
|
atom_bindings_(new AtomBindings(uv_default_loop())) {}
|
||||||
|
|
||||||
AtomRendererClient::~AtomRendererClient() {
|
AtomRendererClient::~AtomRendererClient() {
|
||||||
|
|
|
@ -60,7 +60,7 @@ class AtomRendererClient : public RendererClientBase {
|
||||||
node::Environment* GetEnvironment(content::RenderFrame* frame) const;
|
node::Environment* GetEnvironment(content::RenderFrame* frame) const;
|
||||||
|
|
||||||
// Whether the node integration has been initialized.
|
// Whether the node integration has been initialized.
|
||||||
bool node_integration_initialized_;
|
bool node_integration_initialized_ = false;
|
||||||
|
|
||||||
std::unique_ptr<NodeBindings> node_bindings_;
|
std::unique_ptr<NodeBindings> node_bindings_;
|
||||||
std::unique_ptr<AtomBindings> atom_bindings_;
|
std::unique_ptr<AtomBindings> atom_bindings_;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue