use zoom factor webpreference option when required.

* When setzoomlevel is not called for the host.
* When there is no zoom preference for the host.
This commit is contained in:
deepak1556 2017-01-30 00:38:28 +05:30
parent b27c94368d
commit 07794a58aa
4 changed files with 41 additions and 21 deletions

View file

@ -349,11 +349,16 @@ class WebContents : public mate::TrackableObject<WebContents>,
const base::ListValue& args,
IPC::Message* message);
// Called after committing a navigation, to set the zoom
// factor.
void SetZoomFactorIfNeeded(const GURL& url);
v8::Global<v8::Value> session_;
v8::Global<v8::Value> devtools_web_contents_;
v8::Global<v8::Value> debugger_;
std::unique_ptr<WebViewGuestDelegate> guest_delegate_;
std::map<std::string, double> host_zoom_factor_;
// The host webcontents that may contain this webcontents.
WebContents* embedder_;
@ -370,6 +375,9 @@ class WebContents : public mate::TrackableObject<WebContents>,
// Whether to enable devtools.
bool enable_devtools_;
// Initial zoom factor.
double zoom_factor_;
DISALLOW_COPY_AND_ASSIGN(WebContents);
};