Merge pull request #700 from atom/chrome38

Upgrade to Chrome 38
This commit is contained in:
Cheng Zhao 2014-10-14 18:42:21 +08:00
commit a194d45dfa
22 changed files with 57 additions and 47 deletions

View file

@ -19,6 +19,7 @@
#include "native_mate/callback.h" #include "native_mate/callback.h"
#include "native_mate/dictionary.h" #include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h" #include "native_mate/object_template_builder.h"
#include "net/base/load_flags.h"
#include "net/proxy/proxy_service.h" #include "net/proxy/proxy_service.h"
#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_context_getter.h"
@ -46,10 +47,10 @@ class ResolveProxyHelper {
// Start the request. // Start the request.
int result = proxy_service->ResolveProxy( int result = proxy_service->ResolveProxy(
url, &proxy_info_, url, net::LOAD_NORMAL, &proxy_info_,
base::Bind(&ResolveProxyHelper::OnResolveProxyCompleted, base::Bind(&ResolveProxyHelper::OnResolveProxyCompleted,
base::Unretained(this)), base::Unretained(this)),
&pac_req_, net::BoundNetLog()); &pac_req_, nullptr, net::BoundNetLog());
// Completed synchronously. // Completed synchronously.
if (result != net::ERR_IO_PENDING) if (result != net::ERR_IO_PENDING)

View file

@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
#include <set> #include <set>
#include <string>
#include "atom/common/native_mate_converters/file_path_converter.h" #include "atom/common/native_mate_converters/file_path_converter.h"
#include "base/bind.h" #include "base/bind.h"
@ -31,17 +32,30 @@ struct Converter<std::set<T> > {
}; };
template<> template<>
struct Converter<TracingController::Options> { struct Converter<base::debug::CategoryFilter> {
static bool FromV8(v8::Isolate* isolate, static bool FromV8(v8::Isolate* isolate,
v8::Handle<v8::Value> val, v8::Handle<v8::Value> val,
TracingController::Options* out) { base::debug::CategoryFilter* out) {
if (!val->IsNumber()) std::string filter;
if (!ConvertFromV8(isolate, val, &filter))
return false; return false;
*out = static_cast<TracingController::Options>(val->IntegerValue()); *out = base::debug::CategoryFilter(filter);
return true; return true;
} }
}; };
template<>
struct Converter<base::debug::TraceOptions> {
static bool FromV8(v8::Isolate* isolate,
v8::Handle<v8::Value> val,
base::debug::TraceOptions* out) {
std::string options;
if (!ConvertFromV8(isolate, val, &options))
return false;
return out->SetFromString(options);
}
};
} // namespace mate } // namespace mate
namespace { namespace {

View file

@ -17,14 +17,13 @@ MenuViews::MenuViews() {
void MenuViews::Popup(Window* window) { void MenuViews::Popup(Window* window) {
gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint();
views::MenuRunner menu_runner(model()); views::MenuRunner menu_runner(model(), views::MenuRunner::CONTEXT_MENU);
ignore_result(menu_runner.RunMenuAt( ignore_result(menu_runner.RunMenuAt(
static_cast<NativeWindowViews*>(window->window())->widget(), static_cast<NativeWindowViews*>(window->window())->widget(),
NULL, NULL,
gfx::Rect(cursor, gfx::Size()), gfx::Rect(cursor, gfx::Size()),
views::MENU_ANCHOR_TOPLEFT, views::MENU_ANCHOR_TOPLEFT,
ui::MENU_SOURCE_MOUSE, ui::MENU_SOURCE_MOUSE));
views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU));
} }
// static // static

View file

@ -35,10 +35,10 @@ void WebContents::RenderProcessGone(base::TerminationStatus status) {
Emit("crashed"); Emit("crashed");
} }
void WebContents::DidFinishLoad(int64 frame_id, void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url, const GURL& validated_url) {
bool is_main_frame, bool is_main_frame = !render_frame_host->GetParent();
content::RenderViewHost* render_view_host) {
base::ListValue args; base::ListValue args;
args.AppendBoolean(is_main_frame); args.AppendBoolean(is_main_frame);
Emit("did-frame-finish-load", args); Emit("did-frame-finish-load", args);

View file

@ -52,11 +52,8 @@ class WebContents : public mate::EventEmitter,
// content::WebContentsObserver implementations: // content::WebContentsObserver implementations:
virtual void RenderViewDeleted(content::RenderViewHost*) OVERRIDE; virtual void RenderViewDeleted(content::RenderViewHost*) OVERRIDE;
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE; virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
virtual void DidFinishLoad( virtual void DidFinishLoad(content::RenderFrameHost* render_frame_host,
int64 frame_id, const GURL& validated_url) OVERRIDE;
const GURL& validated_url,
bool is_main_frame,
content::RenderViewHost* render_view_host) OVERRIDE;
virtual void DidStartLoading( virtual void DidStartLoading(
content::RenderViewHost* render_view_host) OVERRIDE; content::RenderViewHost* render_view_host) OVERRIDE;
virtual void DidStopLoading( virtual void DidStopLoading(

View file

@ -18,8 +18,8 @@
#include "content/public/browser/resource_dispatcher_host.h" #include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/browser/site_instance.h" #include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/common/web_preferences.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "webkit/common/webpreferences.h"
namespace atom { namespace atom {
@ -76,7 +76,7 @@ content::AccessTokenStore* AtomBrowserClient::CreateAccessTokenStore() {
void AtomBrowserClient::OverrideWebkitPrefs( void AtomBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* render_view_host, content::RenderViewHost* render_view_host,
const GURL& url, const GURL& url,
WebPreferences* prefs) { content::WebPreferences* prefs) {
prefs->javascript_enabled = true; prefs->javascript_enabled = true;
prefs->web_security_enabled = true; prefs->web_security_enabled = true;
prefs->javascript_can_open_windows_automatically = true; prefs->javascript_can_open_windows_automatically = true;

View file

@ -28,7 +28,7 @@ class AtomBrowserClient : public brightray::BrowserClient {
virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE; virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host, virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
const GURL& url, const GURL& url,
WebPreferences* prefs) OVERRIDE; content::WebPreferences* prefs) OVERRIDE;
virtual bool ShouldSwapBrowsingInstancesForNavigation( virtual bool ShouldSwapBrowsingInstancesForNavigation(
content::SiteInstance* site_instance, content::SiteInstance* site_instance,
const GURL& current_url, const GURL& current_url,

View file

@ -44,13 +44,13 @@
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/renderer_preferences.h" #include "content/public/common/renderer_preferences.h"
#include "content/public/common/user_agent.h" #include "content/public/common/user_agent.h"
#include "content/public/common/web_preferences.h"
#include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_macros.h"
#include "native_mate/dictionary.h" #include "native_mate/dictionary.h"
#include "ui/gfx/codec/png_codec.h" #include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/point.h" #include "ui/gfx/point.h"
#include "ui/gfx/rect.h" #include "ui/gfx/rect.h"
#include "ui/gfx/size.h" #include "ui/gfx/size.h"
#include "webkit/common/webpreferences.h"
using content::NavigationEntry; using content::NavigationEntry;
@ -248,9 +248,8 @@ bool NativeWindow::IsDevToolsOpened() {
void NativeWindow::InspectElement(int x, int y) { void NativeWindow::InspectElement(int x, int y) {
OpenDevTools(); OpenDevTools();
content::RenderViewHost* rvh = GetWebContents()->GetRenderViewHost();
scoped_refptr<content::DevToolsAgentHost> agent( scoped_refptr<content::DevToolsAgentHost> agent(
content::DevToolsAgentHost::GetOrCreateFor(rvh)); content::DevToolsAgentHost::GetOrCreateFor(GetWebContents()));
agent->InspectElement(x, y); agent->InspectElement(x, y);
} }
@ -287,7 +286,7 @@ void NativeWindow::CapturePage(const gfx::Rect& rect,
base::Bind(&NativeWindow::OnCapturePageDone, base::Bind(&NativeWindow::OnCapturePageDone,
weak_factory_.GetWeakPtr(), weak_factory_.GetWeakPtr(),
callback), callback),
SkBitmap::kARGB_8888_Config); kAlpha_8_SkColorType);
} }
void NativeWindow::DestroyWebContents() { void NativeWindow::DestroyWebContents() {
@ -368,7 +367,8 @@ void NativeWindow::AppendExtraCommandLineSwitches(
} }
} }
void NativeWindow::OverrideWebkitPrefs(const GURL& url, WebPreferences* prefs) { void NativeWindow::OverrideWebkitPrefs(const GURL& url,
content::WebPreferences* prefs) {
if (web_preferences_.IsEmpty()) if (web_preferences_.IsEmpty())
return; return;

View file

@ -23,8 +23,6 @@
#include "native_mate/persistent_dictionary.h" #include "native_mate/persistent_dictionary.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
struct WebPreferences;
namespace base { namespace base {
class CommandLine; class CommandLine;
} }
@ -32,6 +30,7 @@ class CommandLine;
namespace content { namespace content {
class BrowserContext; class BrowserContext;
class WebContents; class WebContents;
struct WebPreferences;
} }
namespace gfx { namespace gfx {
@ -178,7 +177,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, WebPreferences* prefs); void OverrideWebkitPrefs(const GURL& url, 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.

View file

@ -99,7 +99,7 @@ void URLRequestAsarJob::DidOpen(int result) {
return; return;
} }
int rv = stream_->Seek(net::FROM_BEGIN, int rv = stream_->Seek(base::File::FROM_BEGIN,
file_info_.offset, file_info_.offset,
base::Bind(&URLRequestAsarJob::DidSeek, base::Bind(&URLRequestAsarJob::DidSeek,
weak_ptr_factory_.GetWeakPtr())); weak_ptr_factory_.GetWeakPtr()));

View file

@ -91,7 +91,7 @@ bool StringToAccelerator(const std::string& description,
LOG(ERROR) << "The accelerator string can only contain ASCII characters"; LOG(ERROR) << "The accelerator string can only contain ASCII characters";
return false; return false;
} }
std::string shortcut(StringToLowerASCII(description)); std::string shortcut(base::StringToLowerASCII(description));
std::vector<std::string> tokens; std::vector<std::string> tokens;
base::SplitString(shortcut, '+', &tokens); base::SplitString(shortcut, '+', &tokens);

View file

@ -145,7 +145,7 @@ MessageDialog::MessageDialog(NativeWindow* parent_window,
views::LabelButton* button = new views::LabelButton( views::LabelButton* button = new views::LabelButton(
this, base::UTF8ToUTF16(buttons[i])); this, base::UTF8ToUTF16(buttons[i]));
button->set_tag(i); button->set_tag(i);
button->set_min_size(gfx::Size(60, 30)); button->SetMinSize(gfx::Size(60, 30));
button->SetStyle(views::Button::STYLE_BUTTON); button->SetStyle(views::Button::STYLE_BUTTON);
button->SetGroup(kButtonGroup); button->SetGroup(kButtonGroup);

View file

@ -35,14 +35,13 @@ void MenuDelegate::RunMenu(ui::MenuModel* model, views::MenuButton* button) {
id_ = button->tag(); id_ = button->tag();
views::MenuItemView* item = BuildMenu(model); views::MenuItemView* item = BuildMenu(model);
views::MenuRunner menu_runner(item); views::MenuRunner menu_runner(item, views::MenuRunner::CONTEXT_MENU);
ignore_result(menu_runner.RunMenuAt( ignore_result(menu_runner.RunMenuAt(
button->GetWidget()->GetTopLevelWidget(), button->GetWidget()->GetTopLevelWidget(),
button, button,
bounds, bounds,
views::MENU_ANCHOR_TOPRIGHT, views::MENU_ANCHOR_TOPRIGHT,
ui::MENU_SOURCE_MOUSE, ui::MENU_SOURCE_MOUSE));
views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU));
} }
views::MenuItemView* MenuDelegate::BuildMenu(ui::MenuModel* model) { views::MenuItemView* MenuDelegate::BuildMenu(ui::MenuModel* model) {

View file

@ -60,14 +60,13 @@ void NotifyIcon::HandleClickEvent(const gfx::Point& cursor_pos,
if (!SetForegroundWindow(window_)) if (!SetForegroundWindow(window_))
return; return;
views::MenuRunner menu_runner(menu_model_); views::MenuRunner menu_runner(menu_model_, views::MenuRunner::CONTEXT_MENU);
ignore_result(menu_runner.RunMenuAt( ignore_result(menu_runner.RunMenuAt(
NULL, NULL,
NULL, NULL,
gfx::Rect(cursor_pos, gfx::Size()), gfx::Rect(cursor_pos, gfx::Size()),
views::MENU_ANCHOR_TOPLEFT, views::MENU_ANCHOR_TOPLEFT,
ui::MENU_SOURCE_MOUSE, ui::MENU_SOURCE_MOUSE));
views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU));
} }
void NotifyIcon::ResetIcon() { void NotifyIcon::ResetIcon() {

View file

@ -9,6 +9,7 @@
#include "base/values.h" #include "base/values.h"
#include "content/public/common/common_param_traits.h" #include "content/public/common/common_param_traits.h"
#include "ipc/ipc_message_macros.h" #include "ipc/ipc_message_macros.h"
#include "ui/gfx/ipc/gfx_param_traits.h"
// The message starter should be declared in ipc/ipc_message_start.h. Since // The message starter should be declared in ipc/ipc_message_start.h. Since
// we don't want to patch Chromium, we just pretend to be Content Shell. // we don't want to patch Chromium, we just pretend to be Content Shell.

View file

@ -8,7 +8,7 @@
#ifndef ATOM_COMMON_CHROME_VERSION_H_ #ifndef ATOM_COMMON_CHROME_VERSION_H_
#define ATOM_COMMON_CHROME_VERSION_H_ #define ATOM_COMMON_CHROME_VERSION_H_
#define CHROME_VERSION_STRING "37.0.2062.102" #define CHROME_VERSION_STRING "38.0.2125.101"
#define CHROME_VERSION "v" CHROME_VERSION_STRING #define CHROME_VERSION "v" CHROME_VERSION_STRING
#endif // ATOM_COMMON_CHROME_VERSION_H_ #endif // ATOM_COMMON_CHROME_VERSION_H_

View file

@ -17,10 +17,10 @@
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/common/print_messages.h" #include "chrome/common/print_messages.h"
#include "content/public/common/web_preferences.h"
#include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h" #include "content/public/renderer/render_view.h"
#include "content/public/renderer/web_preferences.h"
#include "net/base/escape.h" #include "net/base/escape.h"
#include "printing/metafile.h" #include "printing/metafile.h"
#include "printing/metafile_impl.h" #include "printing/metafile_impl.h"
@ -42,7 +42,8 @@
#include "third_party/WebKit/public/web/WebView.h" #include "third_party/WebKit/public/web/WebView.h"
#include "third_party/WebKit/public/web/WebViewClient.h" #include "third_party/WebKit/public/web/WebViewClient.h"
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "webkit/common/webpreferences.h"
using content::WebPreferences;
namespace printing { namespace printing {
@ -547,7 +548,7 @@ void PrepareFrameAndViewForPrint::CopySelection(
blink::WebView* web_view = blink::WebView::create(this); blink::WebView* web_view = blink::WebView::create(this);
owns_web_view_ = true; owns_web_view_ = true;
content::ApplyWebPreferences(prefs, web_view); content::RenderView::ApplyWebPreferences(prefs, web_view);
web_view->setMainFrame(blink::WebLocalFrame::create(this)); web_view->setMainFrame(blink::WebLocalFrame::create(this));
frame_.Reset(web_view->mainFrame()->toWebLocalFrame()); frame_.Reset(web_view->mainFrame()->toWebLocalFrame());
node_to_print_.reset(); node_to_print_.reset();

View file

@ -10,7 +10,7 @@
], ],
"devDependencies": { "devDependencies": {
"atom-package-manager": "0.98.0", "atom-package-manager": "0.102.0",
"coffee-script": "~1.7.1", "coffee-script": "~1.7.1",
"coffeelint": "~1.3.0" "coffeelint": "~1.3.0"
}, },

View file

@ -4,7 +4,7 @@ import platform
import sys import sys
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '3245ef802fbf546f1a1d206990aa9d18be6bfbfe' LIBCHROMIUMCONTENT_COMMIT = '9f5271d31e0f32eac5a20ef6f543e3f1d43ad645'
ARCH = { ARCH = {
'cygwin': '32bit', 'cygwin': '32bit',

View file

@ -22,7 +22,7 @@ describe 'third-party module', ->
it 'emits file events correctly', (done) -> it 'emits file events correctly', (done) ->
pathwatcher = require 'pathwatcher' pathwatcher = require 'pathwatcher'
temp.mkdir 'dir', (err, dir) -> temp.mkdir 'dir', (err, dir) ->
assert err == null return done() if err
file = path.join dir, 'file' file = path.join dir, 'file'
fs.writeFileSync file, 'content' fs.writeFileSync file, 'content'
watcher = pathwatcher.watch file, (event) -> watcher = pathwatcher.watch file, (event) ->

2
vendor/brightray vendored

@ -1 +1 @@
Subproject commit 2b5794b11e68130aee0af7941289eab2b33d73c6 Subproject commit 319c63da618f5fdff38f6a65c452f3802b8756d1

2
vendor/node vendored

@ -1 +1 @@
Subproject commit a80a10c6a1f2c668d90eda4e2c9aab38e4dcd4a2 Subproject commit 94229c71b0879fb40bc157fe2fe346627dbe7496