Update to new Chromium APIs.

This commit is contained in:
Cheng Zhao 2014-07-28 15:29:51 +08:00
parent 5ad203ad99
commit 7a89a08534
18 changed files with 28 additions and 37 deletions

View file

@ -8,7 +8,6 @@
#include "base/message_loop/message_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "atom/common/node_includes.h"
@ -44,7 +43,7 @@ void MenuMac::Popup(Window* window) {
// Show the menu.
[NSMenu popUpContextMenu:[menu_controller menu]
withEvent:clickEvent
forView:web_contents->GetView()->GetContentNativeView()];
forView:web_contents->GetContentNativeView()];
}
// static

View file

@ -9,6 +9,7 @@
#include "atom/common/native_mate_converters/string16_converter.h"
#include "atom/common/native_mate_converters/value_converter.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@ -66,7 +67,7 @@ bool WebContents::OnMessageReceived(const IPC::Message& message) {
return handled;
}
void WebContents::WebContentsDestroyed(content::WebContents*) {
void WebContents::WebContentsDestroyed() {
// The RenderViewDeleted was not called when the WebContents is destroyed.
RenderViewDeleted(web_contents_->GetRenderViewHost());
Emit("destroyed");
@ -155,8 +156,7 @@ bool WebContents::IsCrashed() const {
}
void WebContents::ExecuteJavaScript(const base::string16& code) {
web_contents()->GetRenderViewHost()->ExecuteJavascriptInWebFrame(
base::string16(), code);
web_contents()->GetMainFrame()->ExecuteJavaScript(code);
}
bool WebContents::SendIPCMessage(const base::string16& channel,

View file

@ -62,7 +62,7 @@ class WebContents : public mate::EventEmitter,
virtual void DidStopLoading(
content::RenderViewHost* render_view_host) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void WebContentsDestroyed(content::WebContents*) OVERRIDE;
virtual void WebContentsDestroyed() OVERRIDE;
private:
// Called when received a message from renderer.

View file

@ -36,7 +36,7 @@ void Event::SetSenderAndMessage(content::WebContents* sender,
Observe(sender);
}
void Event::WebContentsDestroyed(content::WebContents* web_contents) {
void Event::WebContentsDestroyed() {
sender_ = NULL;
message_ = NULL;
}

View file

@ -40,7 +40,7 @@ class Event : public Wrappable,
virtual ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate* isolate);
// content::WebContentsObserver implementations:
virtual void WebContentsDestroyed(content::WebContents*) OVERRIDE;
virtual void WebContentsDestroyed() OVERRIDE;
private:
// Replyer for the synchronous messages.