code cleanup
This commit is contained in:
parent
cbeaa6be87
commit
7a0aff2bae
7 changed files with 21 additions and 22 deletions
|
@ -248,8 +248,8 @@ WebContents::WebContents(v8::Isolate* isolate,
|
|||
content::WebContents* web_contents,
|
||||
Type type)
|
||||
: content::WebContentsObserver(web_contents),
|
||||
zoom_controller_(nullptr),
|
||||
embedder_(nullptr),
|
||||
zoom_controller_(nullptr),
|
||||
type_(type),
|
||||
request_id_(0),
|
||||
background_throttling_(true),
|
||||
|
@ -267,8 +267,8 @@ WebContents::WebContents(v8::Isolate* isolate,
|
|||
}
|
||||
|
||||
WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
|
||||
: zoom_controller_(nullptr),
|
||||
embedder_(nullptr),
|
||||
: embedder_(nullptr),
|
||||
zoom_controller_(nullptr),
|
||||
type_(BROWSER_WINDOW),
|
||||
request_id_(0),
|
||||
background_throttling_(true),
|
||||
|
@ -354,7 +354,7 @@ void WebContents::InitWithSessionAndOptions(v8::Isolate* isolate,
|
|||
WebContentsZoomController::CreateForWebContents(web_contents);
|
||||
zoom_controller_ = WebContentsZoomController::FromWebContents(web_contents);
|
||||
double zoom_factor;
|
||||
if (options.Get("zoomFactor", &zoom_factor))
|
||||
if (options.Get(options::kZoomFactor, &zoom_factor))
|
||||
zoom_controller_->SetDefaultZoomFactor(zoom_factor);
|
||||
|
||||
web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent());
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "atom/common/native_mate_converters/content_converter.h"
|
||||
#include "atom/common/native_mate_converters/value_converter.h"
|
||||
#include "atom/common/node_includes.h"
|
||||
#include "atom/common/options_switches.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "native_mate/dictionary.h"
|
||||
|
||||
|
@ -26,7 +27,7 @@ void AddGuest(int guest_instance_id,
|
|||
guest_web_contents);
|
||||
|
||||
double zoom_factor;
|
||||
if (options.GetDouble("zoomFactor", &zoom_factor)) {
|
||||
if (options.GetDouble(atom::options::kZoomFactor, &zoom_factor)) {
|
||||
atom::WebContentsZoomController::FromWebContents(guest_web_contents)
|
||||
->SetDefaultZoomFactor(zoom_factor);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue