]> khamidou — GitHub mirrors - electron.git/commitdiff
Update to new Chromium APIs.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 28 Jul 2014 07:29:51 +0000 (15:29 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 28 Jul 2014 12:28:49 +0000 (20:28 +0800)
18 files changed:
atom/browser/api/atom_api_menu_mac.mm
atom/browser/api/atom_api_web_contents.cc
atom/browser/api/atom_api_web_contents.h
atom/browser/api/event.cc
atom/browser/api/event.h
atom/browser/atom_browser_main_parts.cc
atom/browser/native_window.cc
atom/browser/native_window_mac.mm
atom/browser/native_window_views.cc
atom/browser/ui/accelerator_util.cc
atom/common/chrome_version.h
atom/renderer/api/atom_api_renderer_ipc.cc
atom/renderer/api/atom_api_web_view.cc
atom/renderer/atom_render_view_observer.cc
atom/renderer/atom_render_view_observer.h
docs/api/browser-window.md
vendor/brightray
vendor/node

index 4b54a7e2f76e62053aa03f226824b4d404affe20..f5428ec487cb275bd4db88bb8cf054b6ab5f3905 100644 (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
index 14fc69c31753dab374b9949df9ff6b12a1f6106c..33abbcd75e932a606c137f1500d22ce6bdf24a0b 100644 (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,
index 36c91434d5ee7c3d9df1f8a9aec7f5a1c6b3a699..4a83153bca2b2d4d1d3b250f120841a52d28c428 100644 (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.
index 579fa3a41dcf46e357c0be29333ff3db773f223b..c97e968d1e6ea86cbad6691e43d33056d9a36af5 100644 (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;
 }
index b1713a4e68c94968bac39530328824cd9d6a3e47..c32eb8a36aaeef9125254f8fcf06fc65df1744ed 100644 (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.
index c141b265fd753bc747f16b29e72f90219e83da5a..86d8d6b1e7459ee1d958fd1edee17025d38433f4 100644 (file)
@@ -54,11 +54,7 @@ brightray::BrowserContext* AtomBrowserMainParts::CreateBrowserContext() {
 }
 
 void AtomBrowserMainParts::InitProxyResolverV8() {
-  // Since we are integrating node in browser, we can just be sure that an
-  // V8 instance would be prepared, while the ProxyResolverV8::CreateIsolate()
-  // would try to create a V8 isolate, which messed everything on Windows, so
-  // we have to override and call RememberDefaultIsolate on Windows instead.
-  net::ProxyResolverV8::RememberDefaultIsolate();
+  brightray::BrowserMainParts::InitProxyResolverV8();
 }
 
 void AtomBrowserMainParts::PostEarlyInitialization() {
index bf055570bdbddce9b2c6f556747a0ff50fbb39fe..4be4ac694124c07321b215c91a8a6f9d2d1d049f 100644 (file)
@@ -38,7 +38,6 @@
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/render_widget_host_view.h"
-#include "content/public/browser/web_contents_view.h"
 #include "content/public/common/renderer_preferences.h"
 #include "content/public/common/user_agent.h"
 #include "ipc/ipc_message_macros.h"
@@ -305,7 +304,7 @@ void NativeWindow::CloseWebContents() {
     ScheduleUnresponsiveEvent(5000);
 
   if (web_contents->NeedToFireBeforeUnload())
-    web_contents->GetMainFrame()->DispatchBeforeUnload(false);
+    web_contents->DispatchBeforeUnload(false);
   else
     web_contents->Close();
 }
@@ -356,8 +355,6 @@ void NativeWindow::OverrideWebkitPrefs(const GURL& url, WebPreferences* prefs) {
     prefs->experimental_webgl_enabled = b;
   if (web_preferences.Get("webaudio", &b))
     prefs->webaudio_enabled = b;
-  if (web_preferences.Get("accelerated-compositing", &b))
-    prefs->accelerated_compositing_enabled = b;
   if (web_preferences.Get("plugins", &b))
     prefs->plugins_enabled = b;
   if (web_preferences.Get("extra-plugin-dirs", &list))
index 77bea46655bf98449a64478b3cd7c95490a09cb3..e16aabdc93a5a4b1121a8f51915d40a57520b028 100644 (file)
@@ -13,7 +13,6 @@
 #include "base/strings/sys_string_conversions.h"
 #include "content/public/browser/native_web_keyboard_event.h"
 #include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_contents_view.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/render_widget_host_view.h"
 #include "native_mate/dictionary.h"
@@ -56,7 +55,7 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
   if (!web_contents)
     return;
 
-  web_contents->GetView()->RestoreFocus();
+  web_contents->RestoreFocus();
 
   content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
   if (rwhv)
@@ -70,7 +69,7 @@ static const CGFloat kAtomWindowCornerRadius = 4.0;
   if (!web_contents)
     return;
 
-  web_contents->GetView()->StoreFocus();
+  web_contents->StoreFocus();
 
   content::RenderWidgetHostView* rwhv = web_contents->GetRenderWidgetHostView();
   if (rwhv)
@@ -492,7 +491,7 @@ gfx::NativeWindow NativeWindowMac::GetNativeWindow() {
 bool NativeWindowMac::IsWithinDraggableRegion(NSPoint point) const {
   if (!draggable_region_)
     return false;
-  NSView* webView = GetWebContents()->GetView()->GetNativeView();
+  NSView* webView = GetWebContents()->GetNativeView();
   NSInteger webViewHeight = NSHeight([webView bounds]);
   // |draggable_region_| is stored in local platform-indepdent coordiate system
   // while |point| is in local Cocoa coordinate system. Do the conversion
@@ -581,7 +580,7 @@ void NativeWindowMac::UninstallView() {
 }
 
 void NativeWindowMac::ClipWebView() {
-  NSView* view = GetWebContents()->GetView()->GetNativeView();
+  NSView* view = GetWebContents()->GetNativeView();
 
   view.wantsLayer = YES;
   view.layer.masksToBounds = YES;
@@ -594,7 +593,7 @@ void NativeWindowMac::InstallDraggableRegionViews() {
   // All ControlRegionViews should be added as children of the WebContentsView,
   // because WebContentsView will be removed and re-added when entering and
   // leaving fullscreen mode.
-  NSView* webView = GetWebContents()->GetView()->GetNativeView();
+  NSView* webView = GetWebContents()->GetNativeView();
   NSInteger webViewHeight = NSHeight([webView bounds]);
 
   // Remove all ControlRegionViews that are added last time.
@@ -626,7 +625,7 @@ void NativeWindowMac::UpdateDraggableRegionsForCustomDrag(
     const std::vector<DraggableRegion>& regions) {
   // We still need one ControlRegionView to cover the whole window such that
   // mouse events could be captured.
-  NSView* web_view = GetWebContents()->GetView()->GetNativeView();
+  NSView* web_view = GetWebContents()->GetNativeView();
   gfx::Rect window_bounds(
       0, 0, NSWidth([web_view bounds]), NSHeight([web_view bounds]));
   system_drag_exclude_areas_.clear();
index b63b8ae463336b7f740bb8d9795d56061c511c76..4c99a56389fcdbaaa8cdb0fefa9214bc4db0c6dd 100644 (file)
@@ -24,7 +24,6 @@
 #include "base/strings/utf_string_conversions.h"
 #include "browser/inspectable_web_contents_view.h"
 #include "content/public/browser/native_web_keyboard_event.h"
-#include "content/public/browser/web_contents_view.h"
 #include "native_mate/dictionary.h"
 #include "ui/aura/window.h"
 #include "ui/aura/window_tree_host.h"
index 09e98cf02a858a8e7441ef28618671dec11da48b..16251e822c6fd89add12675984b412e33bda8b74 100644 (file)
@@ -87,7 +87,7 @@ ui::KeyboardCode KeyboardCodeFromCharCode(char c, bool* shifted) {
 
 bool StringToAccelerator(const std::string& description,
                          ui::Accelerator* accelerator) {
-  if (!IsStringASCII(description)) {
+  if (!base::IsStringASCII(description)) {
     LOG(ERROR) << "The accelerator string can only contain ASCII characters";
     return false;
   }
index f6b1b8febed31777797505208ff9217aac2df594..a8f70f3ce00999e5225485c1c817af21ce49ba62 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef ATOM_COMMON_CHROME_VERSION_H_
 #define ATOM_COMMON_CHROME_VERSION_H_
 
-#define CHROME_VERSION_STRING "35.0.1916.153"
+#define CHROME_VERSION_STRING "36.0.1985.125"
 #define CHROME_VERSION "v" CHROME_VERSION_STRING
 
 #endif  // ATOM_COMMON_CHROME_VERSION_H_
index 678a0c7e1fc63c7f042c0123b6a381bd8b5f70af..a0fd27f4dedfef355f77727f0d473ab64bcfb076 100644 (file)
@@ -7,19 +7,19 @@
 #include "atom/common/native_mate_converters/value_converter.h"
 #include "content/public/renderer/render_view.h"
 #include "native_mate/dictionary.h"
-#include "third_party/WebKit/public/web/WebFrame.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
 #include "third_party/WebKit/public/web/WebView.h"
 
 #include "atom/common/node_includes.h"
 
 using content::RenderView;
-using blink::WebFrame;
+using blink::WebLocalFrame;
 using blink::WebView;
 
 namespace {
 
 RenderView* GetCurrentRenderView() {
-  WebFrame* frame = WebFrame::frameForCurrentContext();
+  WebLocalFrame* frame = WebLocalFrame::frameForCurrentContext();
   if (!frame)
     return NULL;
 
index 1f983cdf96a8dbb16b1424d05a116d95409e0775..defa8237ec1f822026f6b66eb57acfe8b03aefe0 100644 (file)
@@ -6,7 +6,7 @@
 
 #include "native_mate/dictionary.h"
 #include "native_mate/object_template_builder.h"
-#include "third_party/WebKit/public/web/WebFrame.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
 #include "third_party/WebKit/public/web/WebView.h"
 
 #include "atom/common/node_includes.h"
@@ -18,7 +18,7 @@ namespace api {
 namespace {
 
 blink::WebView* GetCurrentWebView() {
-  blink::WebFrame* frame = blink::WebFrame::frameForCurrentContext();
+  blink::WebLocalFrame* frame = blink::WebLocalFrame::frameForCurrentContext();
   if (!frame)
     return NULL;
   return frame->view();
index 05d17e1d96feb29856617a69f584b729373de952..1ec21ef1f6a8e1ccbbbd7fda359b70dfd47e713a 100644 (file)
@@ -18,6 +18,7 @@
 #include "third_party/WebKit/public/web/WebDraggableRegion.h"
 #include "third_party/WebKit/public/web/WebDocument.h"
 #include "third_party/WebKit/public/web/WebFrame.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
 #include "third_party/WebKit/public/web/WebView.h"
 
 #include "atom/common/node_includes.h"
@@ -36,7 +37,8 @@ AtomRenderViewObserver::AtomRenderViewObserver(
 AtomRenderViewObserver::~AtomRenderViewObserver() {
 }
 
-void AtomRenderViewObserver::DidCreateDocumentElement(blink::WebFrame* frame) {
+void AtomRenderViewObserver::DidCreateDocumentElement(
+    blink::WebLocalFrame* frame) {
   // Read --zoom-factor from command line.
   std::string zoom_factor_str = CommandLine::ForCurrentProcess()->
       GetSwitchValueASCII(switches::kZoomFactor);;
index 8941c04b0172bee73eba572efa0dc46ad4884a60..1e1f356f02f67e43c2554b33e82f2c91c6a36e25 100644 (file)
@@ -25,7 +25,7 @@ class AtomRenderViewObserver : public content::RenderViewObserver {
 
  private:
   // content::RenderViewObserver implementation.
-  virtual void DidCreateDocumentElement(blink::WebFrame* frame) OVERRIDE;
+  virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) OVERRIDE;
   virtual void DraggableRegionsChanged(blink::WebFrame* frame) OVERRIDE;
   virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
 
index 8e89e68481501ab533fdacf72c31361b24b33916..3a9a2815297a91e97bc8e2487edba7556efe3a7c 100644 (file)
@@ -63,7 +63,6 @@ You can also create a window without chrome by using
     * `text-areas-are-resizable` Boolean
     * `webgl` Boolean
     * `webaudio` Boolean
-    * `accelerated-compositing` Boolean
     * `plugins` Boolean - Whether plugins should be enabled, currently only
       `NPAPI` plugins are supported.
     * `extra-plugin-dirs` Array - Array of paths that would be searched for
index 04ecc57b5bb2f6d015b673d5b17affdce1039ff1..6c2709003cb0d06ca105c5cb86ea9f6d666261c3 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 04ecc57b5bb2f6d015b673d5b17affdce1039ff1
+Subproject commit 6c2709003cb0d06ca105c5cb86ea9f6d666261c3
index 4d2db275a386b68e3c22ce87ca0c19fddae139e8..6d772c3cda0bb8270857397e128ea1e36c361125 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 4d2db275a386b68e3c22ce87ca0c19fddae139e8
+Subproject commit 6d772c3cda0bb8270857397e128ea1e36c361125