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