Fix API changes
This commit is contained in:
parent
32f0ae5b50
commit
b37c73436b
13 changed files with 33 additions and 37 deletions
|
@ -32,23 +32,23 @@ struct Converter<std::set<T> > {
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct Converter<base::debug::CategoryFilter> {
|
struct Converter<base::trace_event::CategoryFilter> {
|
||||||
static bool FromV8(v8::Isolate* isolate,
|
static bool FromV8(v8::Isolate* isolate,
|
||||||
v8::Handle<v8::Value> val,
|
v8::Handle<v8::Value> val,
|
||||||
base::debug::CategoryFilter* out) {
|
base::trace_event::CategoryFilter* out) {
|
||||||
std::string filter;
|
std::string filter;
|
||||||
if (!ConvertFromV8(isolate, val, &filter))
|
if (!ConvertFromV8(isolate, val, &filter))
|
||||||
return false;
|
return false;
|
||||||
*out = base::debug::CategoryFilter(filter);
|
*out = base::trace_event::CategoryFilter(filter);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct Converter<base::debug::TraceOptions> {
|
struct Converter<base::trace_event::TraceOptions> {
|
||||||
static bool FromV8(v8::Isolate* isolate,
|
static bool FromV8(v8::Isolate* isolate,
|
||||||
v8::Handle<v8::Value> val,
|
v8::Handle<v8::Value> val,
|
||||||
base::debug::TraceOptions* out) {
|
base::trace_event::TraceOptions* out) {
|
||||||
std::string options;
|
std::string options;
|
||||||
if (!ConvertFromV8(isolate, val, &options))
|
if (!ConvertFromV8(isolate, val, &options))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -315,12 +315,11 @@ content::WebContents* WebContents::GetOwnerWebContents() const {
|
||||||
return embedder_web_contents_;
|
return embedder_web_contents_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::GuestSizeChanged(const gfx::Size& old_size,
|
void WebContents::GuestSizeChanged(const gfx::Size& new_size) {
|
||||||
const gfx::Size& new_size) {
|
|
||||||
if (!auto_size_enabled_)
|
if (!auto_size_enabled_)
|
||||||
return;
|
return;
|
||||||
|
GuestSizeChangedDueToAutoSize(guest_size_, new_size);
|
||||||
guest_size_ = new_size;
|
guest_size_ = new_size;
|
||||||
GuestSizeChangedDueToAutoSize(old_size, new_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::RegisterDestructionCallback(
|
void WebContents::RegisterDestructionCallback(
|
||||||
|
|
|
@ -180,8 +180,7 @@ class WebContents : public mate::EventEmitter,
|
||||||
void DidAttach(int guest_proxy_routing_id) final;
|
void DidAttach(int guest_proxy_routing_id) final;
|
||||||
void ElementSizeChanged(const gfx::Size& size) final;
|
void ElementSizeChanged(const gfx::Size& size) final;
|
||||||
content::WebContents* GetOwnerWebContents() const final;
|
content::WebContents* GetOwnerWebContents() const final;
|
||||||
void GuestSizeChanged(const gfx::Size& old_size,
|
void GuestSizeChanged(const gfx::Size& new_size) final;
|
||||||
const gfx::Size& new_size) final;
|
|
||||||
void RegisterDestructionCallback(const DestructionCallback& callback) final;
|
void RegisterDestructionCallback(const DestructionCallback& callback) final;
|
||||||
void SetGuestSizer(content::GuestSizer* guest_sizer) final;
|
void SetGuestSizer(content::GuestSizer* guest_sizer) final;
|
||||||
void WillAttach(content::WebContents* embedder_web_contents,
|
void WillAttach(content::WebContents* embedder_web_contents,
|
||||||
|
|
|
@ -79,7 +79,6 @@ void AtomBrowserClient::ResourceDispatcherHostCreated() {
|
||||||
|
|
||||||
void AtomBrowserClient::OverrideWebkitPrefs(
|
void AtomBrowserClient::OverrideWebkitPrefs(
|
||||||
content::RenderViewHost* render_view_host,
|
content::RenderViewHost* render_view_host,
|
||||||
const GURL& url,
|
|
||||||
content::WebPreferences* prefs) {
|
content::WebPreferences* prefs) {
|
||||||
prefs->javascript_enabled = true;
|
prefs->javascript_enabled = true;
|
||||||
prefs->web_security_enabled = true;
|
prefs->web_security_enabled = true;
|
||||||
|
@ -99,7 +98,9 @@ void AtomBrowserClient::OverrideWebkitPrefs(
|
||||||
prefs->allow_running_insecure_content = false;
|
prefs->allow_running_insecure_content = false;
|
||||||
|
|
||||||
// Turn off web security for devtools.
|
// Turn off web security for devtools.
|
||||||
if (url.SchemeIs("chrome-devtools")) {
|
auto web_contents = content::WebContents::FromRenderViewHost(
|
||||||
|
render_view_host);
|
||||||
|
if (web_contents && web_contents->GetURL().SchemeIs("chrome-devtools")) {
|
||||||
prefs->web_security_enabled = false;
|
prefs->web_security_enabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +116,7 @@ void AtomBrowserClient::OverrideWebkitPrefs(
|
||||||
NativeWindow* window = NativeWindow::FromRenderView(
|
NativeWindow* window = NativeWindow::FromRenderView(
|
||||||
process->GetID(), render_view_host->GetRoutingID());
|
process->GetID(), render_view_host->GetRoutingID());
|
||||||
if (window)
|
if (window)
|
||||||
window->OverrideWebkitPrefs(url, prefs);
|
window->OverrideWebkitPrefs(prefs);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AtomBrowserClient::ShouldSwapBrowsingInstancesForNavigation(
|
bool AtomBrowserClient::ShouldSwapBrowsingInstancesForNavigation(
|
||||||
|
|
|
@ -26,7 +26,6 @@ class AtomBrowserClient : public brightray::BrowserClient {
|
||||||
content::AccessTokenStore* CreateAccessTokenStore() override;
|
content::AccessTokenStore* CreateAccessTokenStore() override;
|
||||||
void ResourceDispatcherHostCreated() override;
|
void ResourceDispatcherHostCreated() override;
|
||||||
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
|
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
|
||||||
const GURL& url,
|
|
||||||
content::WebPreferences* prefs) override;
|
content::WebPreferences* prefs) override;
|
||||||
bool ShouldSwapBrowsingInstancesForNavigation(
|
bool ShouldSwapBrowsingInstancesForNavigation(
|
||||||
content::SiteInstance* site_instance,
|
content::SiteInstance* site_instance,
|
||||||
|
|
|
@ -435,8 +435,7 @@ void NativeWindow::AppendExtraCommandLineSwitches(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NativeWindow::OverrideWebkitPrefs(const GURL& url,
|
void NativeWindow::OverrideWebkitPrefs(content::WebPreferences* prefs) {
|
||||||
content::WebPreferences* prefs) {
|
|
||||||
if (web_preferences_.IsEmpty())
|
if (web_preferences_.IsEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
|
||||||
// Called when renderer process is going to be started.
|
// Called when renderer process is going to be started.
|
||||||
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
|
void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
|
||||||
int child_process_id);
|
int child_process_id);
|
||||||
void OverrideWebkitPrefs(const GURL& url, content::WebPreferences* prefs);
|
void OverrideWebkitPrefs(content::WebPreferences* prefs);
|
||||||
|
|
||||||
// Public API used by platform-dependent delegates and observers to send UI
|
// Public API used by platform-dependent delegates and observers to send UI
|
||||||
// related notifications.
|
// related notifications.
|
||||||
|
|
|
@ -42,7 +42,8 @@ void WebViewManager::AddGuest(int guest_instance_id,
|
||||||
webview_info_map_[guest_process_id] = info;
|
webview_info_map_[guest_process_id] = info;
|
||||||
|
|
||||||
// Map the element in embedder to guest.
|
// Map the element in embedder to guest.
|
||||||
ElementInstanceKey key(embedder, element_instance_id);
|
int owner_process_id = embedder->GetRenderProcessHost()->GetID();
|
||||||
|
ElementInstanceKey key(owner_process_id, element_instance_id);
|
||||||
element_instance_id_to_guest_map_[key] = guest_instance_id;
|
element_instance_id_to_guest_map_[key] = guest_instance_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,9 +77,9 @@ bool WebViewManager::GetInfo(int guest_process_id, WebViewInfo* webview_info) {
|
||||||
}
|
}
|
||||||
|
|
||||||
content::WebContents* WebViewManager::GetGuestByInstanceID(
|
content::WebContents* WebViewManager::GetGuestByInstanceID(
|
||||||
content::WebContents* embedder,
|
int owner_process_id,
|
||||||
int element_instance_id) {
|
int element_instance_id) {
|
||||||
ElementInstanceKey key(embedder, element_instance_id);
|
ElementInstanceKey key(owner_process_id, element_instance_id);
|
||||||
if (!ContainsKey(element_instance_id_to_guest_map_, key))
|
if (!ContainsKey(element_instance_id_to_guest_map_, key))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
|
|
@ -50,9 +50,8 @@ class WebViewManager : public content::BrowserPluginGuestManager {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// content::BrowserPluginGuestManager:
|
// content::BrowserPluginGuestManager:
|
||||||
content::WebContents* GetGuestByInstanceID(
|
content::WebContents* GetGuestByInstanceID(int owner_process_id,
|
||||||
content::WebContents* embedder_web_contents,
|
int element_instance_id) override;
|
||||||
int element_instance_id) override;
|
|
||||||
bool ForEachGuest(content::WebContents* embedder,
|
bool ForEachGuest(content::WebContents* embedder,
|
||||||
const GuestCallback& callback) override;
|
const GuestCallback& callback) override;
|
||||||
|
|
||||||
|
@ -65,26 +64,25 @@ class WebViewManager : public content::BrowserPluginGuestManager {
|
||||||
std::map<int, WebContentsWithEmbedder> web_contents_embdder_map_;
|
std::map<int, WebContentsWithEmbedder> web_contents_embdder_map_;
|
||||||
|
|
||||||
struct ElementInstanceKey {
|
struct ElementInstanceKey {
|
||||||
content::WebContents* owner_web_contents;
|
int embedder_process_id;
|
||||||
int element_instance_id;
|
int element_instance_id;
|
||||||
|
|
||||||
ElementInstanceKey(content::WebContents* owner_web_contents,
|
ElementInstanceKey(int embedder_process_id, int element_instance_id)
|
||||||
int element_instance_id)
|
: embedder_process_id(embedder_process_id),
|
||||||
: owner_web_contents(owner_web_contents),
|
|
||||||
element_instance_id(element_instance_id) {}
|
element_instance_id(element_instance_id) {}
|
||||||
|
|
||||||
bool operator<(const ElementInstanceKey& other) const {
|
bool operator<(const ElementInstanceKey& other) const {
|
||||||
if (owner_web_contents != other.owner_web_contents)
|
if (embedder_process_id != other.embedder_process_id)
|
||||||
return owner_web_contents < other.owner_web_contents;
|
return embedder_process_id < other.embedder_process_id;
|
||||||
return element_instance_id < other.element_instance_id;
|
return element_instance_id < other.element_instance_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const ElementInstanceKey& other) const {
|
bool operator==(const ElementInstanceKey& other) const {
|
||||||
return (owner_web_contents == other.owner_web_contents) &&
|
return (embedder_process_id == other.embedder_process_id) &&
|
||||||
(element_instance_id == other.element_instance_id);
|
(element_instance_id == other.element_instance_id);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// (web_contents, element_instance_id) => guest_instance_id
|
// (embedder_process_id, element_instance_id) => guest_instance_id
|
||||||
std::map<ElementInstanceKey, int> element_instance_id_to_guest_map_;
|
std::map<ElementInstanceKey, int> element_instance_id_to_guest_map_;
|
||||||
|
|
||||||
typedef std::map<int, WebViewInfo> WebViewInfoMap;
|
typedef std::map<int, WebViewInfo> WebViewInfoMap;
|
||||||
|
|
|
@ -425,8 +425,10 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient,
|
||||||
virtual void didStopLoading();
|
virtual void didStopLoading();
|
||||||
|
|
||||||
// blink::WebFrameClient override:
|
// blink::WebFrameClient override:
|
||||||
virtual blink::WebFrame* createChildFrame(blink::WebLocalFrame* parent,
|
virtual blink::WebFrame* createChildFrame(
|
||||||
const blink::WebString& name);
|
blink::WebLocalFrame* parent,
|
||||||
|
const blink::WebString& name,
|
||||||
|
blink::WebSandboxFlags sandboxFlags);
|
||||||
virtual void frameDetached(blink::WebFrame* frame);
|
virtual void frameDetached(blink::WebFrame* frame);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -571,7 +573,8 @@ void PrepareFrameAndViewForPrint::didStopLoading() {
|
||||||
|
|
||||||
blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
|
blink::WebFrame* PrepareFrameAndViewForPrint::createChildFrame(
|
||||||
blink::WebLocalFrame* parent,
|
blink::WebLocalFrame* parent,
|
||||||
const blink::WebString& name) {
|
const blink::WebString& name,
|
||||||
|
blink::WebSandboxFlags sandboxFlags) {
|
||||||
blink::WebFrame* frame = blink::WebLocalFrame::create(this);
|
blink::WebFrame* frame = blink::WebLocalFrame::create(this);
|
||||||
parent->appendChild(frame);
|
parent->appendChild(frame);
|
||||||
return frame;
|
return frame;
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include "printing/page_size_margins.h"
|
#include "printing/page_size_margins.h"
|
||||||
#include "printing/pdf_metafile_skia.h"
|
#include "printing/pdf_metafile_skia.h"
|
||||||
#include "skia/ext/platform_device.h"
|
#include "skia/ext/platform_device.h"
|
||||||
#include "skia/ext/vector_canvas.h"
|
|
||||||
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
||||||
|
|
||||||
#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
|
#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
#include "printing/metafile_skia_wrapper.h"
|
#include "printing/metafile_skia_wrapper.h"
|
||||||
#include "printing/page_size_margins.h"
|
#include "printing/page_size_margins.h"
|
||||||
#include "skia/ext/platform_device.h"
|
#include "skia/ext/platform_device.h"
|
||||||
#include "skia/ext/vector_canvas.h"
|
|
||||||
#include "third_party/WebKit/public/platform/WebCanvas.h"
|
#include "third_party/WebKit/public/platform/WebCanvas.h"
|
||||||
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#include "printing/pdf_metafile_skia.h"
|
#include "printing/pdf_metafile_skia.h"
|
||||||
#include "printing/units.h"
|
#include "printing/units.h"
|
||||||
#include "skia/ext/platform_device.h"
|
#include "skia/ext/platform_device.h"
|
||||||
#include "skia/ext/vector_canvas.h"
|
|
||||||
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
#include "third_party/WebKit/public/web/WebLocalFrame.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue