Update to API changes of Chrome 47
This commit is contained in:
parent
766bbfcb05
commit
73e7773d84
46 changed files with 113 additions and 239 deletions
|
@ -31,8 +31,8 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
|
||||||
plugin.path = path;
|
plugin.path = path;
|
||||||
plugin.permissions = ppapi::PERMISSION_ALL_BITS;
|
plugin.permissions = ppapi::PERMISSION_ALL_BITS;
|
||||||
|
|
||||||
std::vector<std::string> flash_version_numbers;
|
std::vector<std::string> flash_version_numbers = base::SplitString(
|
||||||
base::SplitString(version, '.', &flash_version_numbers);
|
version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||||
if (flash_version_numbers.size() < 1)
|
if (flash_version_numbers.size() < 1)
|
||||||
flash_version_numbers.push_back("11");
|
flash_version_numbers.push_back("11");
|
||||||
// |SplitString()| puts in an empty string given an empty string. :(
|
// |SplitString()| puts in an empty string given an empty string. :(
|
||||||
|
@ -47,7 +47,7 @@ content::PepperPluginInfo CreatePepperFlashInfo(const base::FilePath& path,
|
||||||
// E.g., "Shockwave Flash 10.2 r154":
|
// E.g., "Shockwave Flash 10.2 r154":
|
||||||
plugin.description = plugin.name + " " + flash_version_numbers[0] + "." +
|
plugin.description = plugin.name + " " + flash_version_numbers[0] + "." +
|
||||||
flash_version_numbers[1] + " r" + flash_version_numbers[2];
|
flash_version_numbers[1] + " r" + flash_version_numbers[2];
|
||||||
plugin.version = JoinString(flash_version_numbers, '.');
|
plugin.version = base::JoinString(flash_version_numbers, ".");
|
||||||
content::WebPluginMimeType swf_mime_type(
|
content::WebPluginMimeType swf_mime_type(
|
||||||
content::kFlashPluginSwfMimeType,
|
content::kFlashPluginSwfMimeType,
|
||||||
content::kFlashPluginSwfExtension,
|
content::kFlashPluginSwfExtension,
|
||||||
|
@ -81,19 +81,18 @@ std::string AtomContentClient::GetUserAgent() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomContentClient::AddAdditionalSchemes(
|
void AtomContentClient::AddAdditionalSchemes(
|
||||||
std::vector<std::string>* standard_schemes,
|
std::vector<url::SchemeWithType>* standard_schemes,
|
||||||
std::vector<std::string>* savable_schemes) {
|
std::vector<std::string>* savable_schemes) {
|
||||||
auto command_line = base::CommandLine::ForCurrentProcess();
|
auto command_line = base::CommandLine::ForCurrentProcess();
|
||||||
auto custom_schemes = command_line->GetSwitchValueASCII(
|
auto custom_schemes = command_line->GetSwitchValueASCII(
|
||||||
switches::kRegisterStandardSchemes);
|
switches::kRegisterStandardSchemes);
|
||||||
if (!custom_schemes.empty()) {
|
if (!custom_schemes.empty()) {
|
||||||
std::vector<std::string> schemes;
|
std::vector<std::string> schemes = base::SplitString(
|
||||||
base::SplitString(custom_schemes, ',', &schemes);
|
custom_schemes, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||||
standard_schemes->insert(standard_schemes->end(),
|
for (const std::string& scheme : schemes)
|
||||||
schemes.begin(),
|
standard_schemes->push_back({scheme.c_str(), url::SCHEME_WITHOUT_PORT});
|
||||||
schemes.end());
|
|
||||||
}
|
}
|
||||||
standard_schemes->push_back("chrome-extension");
|
standard_schemes->push_back({"chrome-extension", url::SCHEME_WITHOUT_PORT});
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtomContentClient::AddPepperPlugins(
|
void AtomContentClient::AddPepperPlugins(
|
||||||
|
|
|
@ -22,7 +22,7 @@ class AtomContentClient : public brightray::ContentClient {
|
||||||
std::string GetProduct() const override;
|
std::string GetProduct() const override;
|
||||||
std::string GetUserAgent() const override;
|
std::string GetUserAgent() const override;
|
||||||
void AddAdditionalSchemes(
|
void AddAdditionalSchemes(
|
||||||
std::vector<std::string>* standard_schemes,
|
std::vector<url::SchemeWithType>* standard_schemes,
|
||||||
std::vector<std::string>* savable_schemes) override;
|
std::vector<std::string>* savable_schemes) override;
|
||||||
void AddPepperPlugins(
|
void AddPepperPlugins(
|
||||||
std::vector<content::PepperPluginInfo>* plugins) override;
|
std::vector<content::PepperPluginInfo>* plugins) override;
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct ClearStorageDataOptions {
|
||||||
uint32 GetStorageMask(const std::vector<std::string>& storage_types) {
|
uint32 GetStorageMask(const std::vector<std::string>& storage_types) {
|
||||||
uint32 storage_mask = 0;
|
uint32 storage_mask = 0;
|
||||||
for (const auto& it : storage_types) {
|
for (const auto& it : storage_types) {
|
||||||
auto type = base::StringToLowerASCII(it);
|
auto type = base::ToLowerASCII(it);
|
||||||
if (type == "appcache")
|
if (type == "appcache")
|
||||||
storage_mask |= StoragePartition::REMOVE_DATA_MASK_APPCACHE;
|
storage_mask |= StoragePartition::REMOVE_DATA_MASK_APPCACHE;
|
||||||
else if (type == "cookies")
|
else if (type == "cookies")
|
||||||
|
@ -75,7 +75,7 @@ uint32 GetStorageMask(const std::vector<std::string>& storage_types) {
|
||||||
uint32 GetQuotaMask(const std::vector<std::string>& quota_types) {
|
uint32 GetQuotaMask(const std::vector<std::string>& quota_types) {
|
||||||
uint32 quota_mask = 0;
|
uint32 quota_mask = 0;
|
||||||
for (const auto& it : quota_types) {
|
for (const auto& it : quota_types) {
|
||||||
auto type = base::StringToLowerASCII(it);
|
auto type = base::ToLowerASCII(it);
|
||||||
if (type == "temporary")
|
if (type == "temporary")
|
||||||
quota_mask |= StoragePartition::QUOTA_MANAGED_STORAGE_MASK_TEMPORARY;
|
quota_mask |= StoragePartition::QUOTA_MANAGED_STORAGE_MASK_TEMPORARY;
|
||||||
else if (type == "persistent")
|
else if (type == "persistent")
|
||||||
|
@ -233,7 +233,8 @@ void SetProxyInIO(net::URLRequestContextGetter* getter,
|
||||||
const net::ProxyConfig& config,
|
const net::ProxyConfig& config,
|
||||||
const base::Closure& callback) {
|
const base::Closure& callback) {
|
||||||
auto proxy_service = getter->GetURLRequestContext()->proxy_service();
|
auto proxy_service = getter->GetURLRequestContext()->proxy_service();
|
||||||
proxy_service->ResetConfigService(new net::ProxyConfigServiceFixed(config));
|
proxy_service->ResetConfigService(make_scoped_ptr(
|
||||||
|
new net::ProxyConfigServiceFixed(config)));
|
||||||
// Refetches and applies the new pac script if provided.
|
// Refetches and applies the new pac script if provided.
|
||||||
proxy_service->ForceReloadProxyConfig();
|
proxy_service->ForceReloadProxyConfig();
|
||||||
RunCallbackInUI(callback);
|
RunCallbackInUI(callback);
|
||||||
|
|
|
@ -148,7 +148,7 @@ struct Converter<net::HttpResponseHeaders*> {
|
||||||
std::string key;
|
std::string key;
|
||||||
std::string value;
|
std::string value;
|
||||||
while (headers->EnumerateHeaderLines(&iter, &key, &value)) {
|
while (headers->EnumerateHeaderLines(&iter, &key, &value)) {
|
||||||
key = base::StringToLowerASCII(key);
|
key = base::ToLowerASCII(key);
|
||||||
if (response_headers.HasKey(key)) {
|
if (response_headers.HasKey(key)) {
|
||||||
base::ListValue* values = nullptr;
|
base::ListValue* values = nullptr;
|
||||||
if (response_headers.GetList(key, &values))
|
if (response_headers.GetList(key, &values))
|
||||||
|
@ -171,7 +171,7 @@ struct Converter<content::SavePageType> {
|
||||||
std::string save_type;
|
std::string save_type;
|
||||||
if (!ConvertFromV8(isolate, val, &save_type))
|
if (!ConvertFromV8(isolate, val, &save_type))
|
||||||
return false;
|
return false;
|
||||||
save_type = base::StringToLowerASCII(save_type);
|
save_type = base::ToLowerASCII(save_type);
|
||||||
if (save_type == "htmlonly") {
|
if (save_type == "htmlonly") {
|
||||||
*out = content::SAVE_PAGE_TYPE_AS_ONLY_HTML;
|
*out = content::SAVE_PAGE_TYPE_AS_ONLY_HTML;
|
||||||
} else if (save_type == "htmlcomplete") {
|
} else if (save_type == "htmlcomplete") {
|
||||||
|
|
|
@ -24,12 +24,11 @@ bool FrameSubscriber::ShouldCaptureFrame(
|
||||||
base::TimeTicks present_time,
|
base::TimeTicks present_time,
|
||||||
scoped_refptr<media::VideoFrame>* storage,
|
scoped_refptr<media::VideoFrame>* storage,
|
||||||
DeliverFrameCallback* callback) {
|
DeliverFrameCallback* callback) {
|
||||||
*storage = media::VideoFrame::CreateFrame(media::VideoFrame::YV12, size_,
|
*storage = media::VideoFrame::CreateFrame(
|
||||||
gfx::Rect(size_), size_,
|
media::PIXEL_FORMAT_YV12,
|
||||||
base::TimeDelta());
|
size_, gfx::Rect(size_), size_, base::TimeDelta());
|
||||||
*callback = base::Bind(&FrameSubscriber::OnFrameDelivered,
|
*callback = base::Bind(&FrameSubscriber::OnFrameDelivered,
|
||||||
base::Unretained(this),
|
base::Unretained(this), *storage);
|
||||||
*storage);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ void AtomBrowserClient::SuppressRendererProcessRestartForOnce() {
|
||||||
|
|
||||||
void AtomBrowserClient::SetCustomSchemes(
|
void AtomBrowserClient::SetCustomSchemes(
|
||||||
const std::vector<std::string>& schemes) {
|
const std::vector<std::string>& schemes) {
|
||||||
g_custom_schemes = JoinString(schemes, ',');
|
g_custom_schemes = base::JoinString(schemes, ",");
|
||||||
}
|
}
|
||||||
|
|
||||||
AtomBrowserClient::AtomBrowserClient() : delegate_(nullptr) {
|
AtomBrowserClient::AtomBrowserClient() : delegate_(nullptr) {
|
||||||
|
@ -116,7 +116,6 @@ void AtomBrowserClient::OverrideWebkitPrefs(
|
||||||
prefs->javascript_can_open_windows_automatically = true;
|
prefs->javascript_can_open_windows_automatically = true;
|
||||||
prefs->plugins_enabled = true;
|
prefs->plugins_enabled = true;
|
||||||
prefs->dom_paste_enabled = true;
|
prefs->dom_paste_enabled = true;
|
||||||
prefs->java_enabled = false;
|
|
||||||
prefs->allow_scripts_to_close_windows = true;
|
prefs->allow_scripts_to_close_windows = true;
|
||||||
prefs->javascript_can_access_clipboard = true;
|
prefs->javascript_can_access_clipboard = true;
|
||||||
prefs->local_storage_enabled = true;
|
prefs->local_storage_enabled = true;
|
||||||
|
|
|
@ -61,7 +61,7 @@ std::string RemoveWhitespace(const std::string& str) {
|
||||||
AtomBrowserContext::AtomBrowserContext(const std::string& partition,
|
AtomBrowserContext::AtomBrowserContext(const std::string& partition,
|
||||||
bool in_memory)
|
bool in_memory)
|
||||||
: brightray::BrowserContext(partition, in_memory),
|
: brightray::BrowserContext(partition, in_memory),
|
||||||
cert_verifier_(new AtomCertVerifier),
|
cert_verifier_(nullptr),
|
||||||
job_factory_(new AtomURLRequestJobFactory),
|
job_factory_(new AtomURLRequestJobFactory),
|
||||||
allow_ntlm_everywhere_(false) {
|
allow_ntlm_everywhere_(false) {
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ std::string AtomBrowserContext::GetUserAgent() {
|
||||||
return content::BuildUserAgentFromProduct(user_agent);
|
return content::BuildUserAgentFromProduct(user_agent);
|
||||||
}
|
}
|
||||||
|
|
||||||
net::URLRequestJobFactory* AtomBrowserContext::CreateURLRequestJobFactory(
|
scoped_ptr<net::URLRequestJobFactory> AtomBrowserContext::CreateURLRequestJobFactory(
|
||||||
content::ProtocolHandlerMap* handlers,
|
content::ProtocolHandlerMap* handlers,
|
||||||
content::URLRequestInterceptorScopedVector* interceptors) {
|
content::URLRequestInterceptorScopedVector* interceptors) {
|
||||||
scoped_ptr<AtomURLRequestJobFactory> job_factory(job_factory_);
|
scoped_ptr<AtomURLRequestJobFactory> job_factory(job_factory_);
|
||||||
|
@ -131,7 +131,7 @@ net::URLRequestJobFactory* AtomBrowserContext::CreateURLRequestJobFactory(
|
||||||
top_job_factory.Pass(), make_scoped_ptr(*it)));
|
top_job_factory.Pass(), make_scoped_ptr(*it)));
|
||||||
interceptors->weak_clear();
|
interceptors->weak_clear();
|
||||||
|
|
||||||
return top_job_factory.release();
|
return top_job_factory.Pass();
|
||||||
}
|
}
|
||||||
|
|
||||||
net::HttpCache::BackendFactory*
|
net::HttpCache::BackendFactory*
|
||||||
|
@ -160,8 +160,10 @@ content::BrowserPluginGuestManager* AtomBrowserContext::GetGuestManager() {
|
||||||
return guest_manager_.get();
|
return guest_manager_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
net::CertVerifier* AtomBrowserContext::CreateCertVerifier() {
|
scoped_ptr<net::CertVerifier> AtomBrowserContext::CreateCertVerifier() {
|
||||||
return cert_verifier_;
|
DCHECK(!cert_verifier_);
|
||||||
|
cert_verifier_ = new AtomCertVerifier;
|
||||||
|
return make_scoped_ptr(cert_verifier_);
|
||||||
}
|
}
|
||||||
|
|
||||||
net::SSLConfigService* AtomBrowserContext::CreateSSLConfigService() {
|
net::SSLConfigService* AtomBrowserContext::CreateSSLConfigService() {
|
||||||
|
|
|
@ -23,12 +23,12 @@ class AtomBrowserContext : public brightray::BrowserContext {
|
||||||
|
|
||||||
// brightray::URLRequestContextGetter::Delegate:
|
// brightray::URLRequestContextGetter::Delegate:
|
||||||
std::string GetUserAgent() override;
|
std::string GetUserAgent() override;
|
||||||
net::URLRequestJobFactory* CreateURLRequestJobFactory(
|
scoped_ptr<net::URLRequestJobFactory> CreateURLRequestJobFactory(
|
||||||
content::ProtocolHandlerMap* handlers,
|
content::ProtocolHandlerMap* handlers,
|
||||||
content::URLRequestInterceptorScopedVector* interceptors) override;
|
content::URLRequestInterceptorScopedVector* interceptors) override;
|
||||||
net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory(
|
net::HttpCache::BackendFactory* CreateHttpCacheBackendFactory(
|
||||||
const base::FilePath& base_path) override;
|
const base::FilePath& base_path) override;
|
||||||
net::CertVerifier* CreateCertVerifier() override;
|
scoped_ptr<net::CertVerifier> CreateCertVerifier() override;
|
||||||
net::SSLConfigService* CreateSSLConfigService() override;
|
net::SSLConfigService* CreateSSLConfigService() override;
|
||||||
bool AllowNTLMCredentialsForDomain(const GURL& auth_origin) override;
|
bool AllowNTLMCredentialsForDomain(const GURL& auth_origin) override;
|
||||||
|
|
||||||
|
|
|
@ -380,7 +380,7 @@ gfx::ImageSkia CommonWebContentsDelegate::GetDevToolsWindowIcon() {
|
||||||
void CommonWebContentsDelegate::GetDevToolsWindowWMClass(
|
void CommonWebContentsDelegate::GetDevToolsWindowWMClass(
|
||||||
std::string* name, std::string* class_name) {
|
std::string* name, std::string* class_name) {
|
||||||
*class_name = Browser::Get()->GetName();
|
*class_name = Browser::Get()->GetName();
|
||||||
*name = base::StringToLowerASCII(*class_name);
|
*name = base::ToLowerASCII(*class_name);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -291,10 +291,10 @@ void NativeWindow::CapturePage(const gfx::Rect& rect,
|
||||||
const float scale =
|
const float scale =
|
||||||
screen->GetDisplayNearestWindow(native_view).device_scale_factor();
|
screen->GetDisplayNearestWindow(native_view).device_scale_factor();
|
||||||
if (scale > 1.0f)
|
if (scale > 1.0f)
|
||||||
bitmap_size = gfx::ToCeiledSize(gfx::ScaleSize(view_size, scale));
|
bitmap_size = gfx::ScaleToCeiledSize(view_size, scale);
|
||||||
|
|
||||||
host->CopyFromBackingStore(
|
host->CopyFromBackingStore(
|
||||||
rect.IsEmpty() ? gfx::Rect(view_size) : rect,
|
gfx::Rect(view_size),
|
||||||
bitmap_size,
|
bitmap_size,
|
||||||
base::Bind(&NativeWindow::OnCapturePageDone,
|
base::Bind(&NativeWindow::OnCapturePageDone,
|
||||||
weak_factory_.GetWeakPtr(),
|
weak_factory_.GetWeakPtr(),
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#import "atom/browser/ui/cocoa/event_processing_window.h"
|
|
||||||
#include "atom/common/draggable_region.h"
|
#include "atom/common/draggable_region.h"
|
||||||
#include "atom/common/options_switches.h"
|
#include "atom/common/options_switches.h"
|
||||||
#include "base/mac/mac_util.h"
|
#include "base/mac/mac_util.h"
|
||||||
|
@ -19,6 +18,7 @@
|
||||||
#include "content/public/browser/render_view_host.h"
|
#include "content/public/browser/render_view_host.h"
|
||||||
#include "content/public/browser/render_widget_host_view.h"
|
#include "content/public/browser/render_widget_host_view.h"
|
||||||
#include "native_mate/dictionary.h"
|
#include "native_mate/dictionary.h"
|
||||||
|
#import "ui/base/cocoa/command_dispatcher.h"
|
||||||
#include "ui/gfx/skia_util.h"
|
#include "ui/gfx/skia_util.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -209,10 +209,11 @@ bool ScopedDisableResize::disable_resize_ = false;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface AtomNSWindow : EventProcessingWindow {
|
@interface AtomNSWindow : NSWindow<CommandDispatchingWindow> {
|
||||||
@private
|
@private
|
||||||
atom::NativeWindowMac* shell_;
|
atom::NativeWindowMac* shell_;
|
||||||
bool enable_larger_than_screen_;
|
bool enable_larger_than_screen_;
|
||||||
|
base::scoped_nsobject<CommandDispatcher> commandDispatcher_;
|
||||||
}
|
}
|
||||||
@property BOOL acceptsFirstMouse;
|
@property BOOL acceptsFirstMouse;
|
||||||
@property BOOL disableAutoHideCursor;
|
@property BOOL disableAutoHideCursor;
|
||||||
|
@ -226,12 +227,15 @@ bool ScopedDisableResize::disable_resize_ = false;
|
||||||
|
|
||||||
- (void)setShell:(atom::NativeWindowMac*)shell {
|
- (void)setShell:(atom::NativeWindowMac*)shell {
|
||||||
shell_ = shell;
|
shell_ = shell;
|
||||||
|
commandDispatcher_.reset([[CommandDispatcher alloc] initWithOwner:self]);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setEnableLargerThanScreen:(bool)enable {
|
- (void)setEnableLargerThanScreen:(bool)enable {
|
||||||
enable_larger_than_screen_ = enable;
|
enable_larger_than_screen_ = enable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NSWindow overrides.
|
||||||
|
|
||||||
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen*)screen {
|
- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen*)screen {
|
||||||
// Resizing is disabled.
|
// Resizing is disabled.
|
||||||
if (ScopedDisableResize::IsResizeDisabled())
|
if (ScopedDisableResize::IsResizeDisabled())
|
||||||
|
@ -272,6 +276,25 @@ bool ScopedDisableResize::disable_resize_ = false;
|
||||||
return !self.disableKeyOrMainWindow;
|
return !self.disableKeyOrMainWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CommandDispatchingWindow implementation.
|
||||||
|
|
||||||
|
- (void)setCommandHandler:(id<UserInterfaceItemCommandHandler>)commandHandler {
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)redispatchKeyEvent:(NSEvent*)event {
|
||||||
|
return [commandDispatcher_ redispatchKeyEvent:event];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)defaultPerformKeyEquivalent:(NSEvent*)event {
|
||||||
|
return [super performKeyEquivalent:event];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)commandDispatch:(id)sender {
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)commandDispatchUsingKeyModifiers:(id)sender {
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface ControlRegionView : NSView
|
@interface ControlRegionView : NSView
|
||||||
|
@ -766,21 +789,15 @@ void NativeWindowMac::HandleKeyboardEvent(
|
||||||
event.type == content::NativeWebKeyboardEvent::Char)
|
event.type == content::NativeWebKeyboardEvent::Char)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (event.os_event.window == window_.get()) {
|
|
||||||
EventProcessingWindow* event_window =
|
|
||||||
static_cast<EventProcessingWindow*>(window_);
|
|
||||||
DCHECK([event_window isKindOfClass:[EventProcessingWindow class]]);
|
|
||||||
[event_window redispatchKeyEvent:event.os_event];
|
|
||||||
} else {
|
|
||||||
// The event comes from detached devtools view, and it has already been
|
|
||||||
// handled by the devtools itself, we now send it to application menu to
|
|
||||||
// make menu acclerators work.
|
|
||||||
BOOL handled = [[NSApp mainMenu] performKeyEquivalent:event.os_event];
|
BOOL handled = [[NSApp mainMenu] performKeyEquivalent:event.os_event];
|
||||||
// Handle the cmd+~ shortcut.
|
if (!handled && event.os_event.window != window_.get()) {
|
||||||
|
// The event comes from detached devtools view, and it has already been
|
||||||
if (!handled && (event.os_event.modifierFlags & NSCommandKeyMask) &&
|
if (!handled && (event.os_event.modifierFlags & NSCommandKeyMask) &&
|
||||||
(event.os_event.keyCode == 50 /* ~ key */))
|
(event.os_event.keyCode == 50 /* ~ key */)) {
|
||||||
|
// Handle the cmd+~ shortcut.
|
||||||
Focus(true);
|
Focus(true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<gfx::Rect> NativeWindowMac::CalculateNonDraggableRegions(
|
std::vector<gfx::Rect> NativeWindowMac::CalculateNonDraggableRegions(
|
||||||
|
|
|
@ -180,7 +180,7 @@ NativeWindowViews::NativeWindowViews(
|
||||||
// Set WM_WINDOW_ROLE.
|
// Set WM_WINDOW_ROLE.
|
||||||
params.wm_role_name = "browser-window";
|
params.wm_role_name = "browser-window";
|
||||||
// Set WM_CLASS.
|
// Set WM_CLASS.
|
||||||
params.wm_class_name = base::StringToLowerASCII(name);
|
params.wm_class_name = base::ToLowerASCII(name);
|
||||||
params.wm_class_class = name;
|
params.wm_class_class = name;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "net/http/http_response_headers.h"
|
#include "net/http/http_response_headers.h"
|
||||||
#include "net/url_request/url_fetcher.h"
|
#include "net/url_request/url_fetcher.h"
|
||||||
#include "net/url_request/url_fetcher_response_writer.h"
|
#include "net/url_request/url_fetcher_response_writer.h"
|
||||||
|
#include "net/url_request/url_request_context.h"
|
||||||
#include "net/url_request/url_request_context_builder.h"
|
#include "net/url_request/url_request_context_builder.h"
|
||||||
#include "net/url_request/url_request_status.h"
|
#include "net/url_request/url_request_status.h"
|
||||||
|
|
||||||
|
@ -23,7 +24,7 @@ namespace {
|
||||||
|
|
||||||
// Convert string to RequestType.
|
// Convert string to RequestType.
|
||||||
net::URLFetcher::RequestType GetRequestType(const std::string& raw) {
|
net::URLFetcher::RequestType GetRequestType(const std::string& raw) {
|
||||||
std::string method = base::StringToUpperASCII(raw);
|
std::string method = base::ToUpperASCII(raw);
|
||||||
if (method.empty() || method == "GET")
|
if (method.empty() || method == "GET")
|
||||||
return net::URLFetcher::GET;
|
return net::URLFetcher::GET;
|
||||||
else if (method == "POST")
|
else if (method == "POST")
|
||||||
|
@ -138,8 +139,9 @@ net::URLRequestContextGetter* URLRequestFetchJob::CreateRequestContext() {
|
||||||
auto task_runner = base::ThreadTaskRunnerHandle::Get();
|
auto task_runner = base::ThreadTaskRunnerHandle::Get();
|
||||||
net::URLRequestContextBuilder builder;
|
net::URLRequestContextBuilder builder;
|
||||||
builder.set_proxy_service(net::ProxyService::CreateDirect());
|
builder.set_proxy_service(net::ProxyService::CreateDirect());
|
||||||
url_request_context_getter_ =
|
request_context_ = builder.Build();
|
||||||
new net::TrivialURLRequestContextGetter(builder.Build(), task_runner);
|
url_request_context_getter_ = new net::TrivialURLRequestContextGetter(
|
||||||
|
request_context_.get(), task_runner);
|
||||||
}
|
}
|
||||||
return url_request_context_getter_.get();
|
return url_request_context_getter_.get();
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,7 @@ class URLRequestFetchJob : public JsAsker<net::URLRequestJob>,
|
||||||
// Create a independent request context.
|
// Create a independent request context.
|
||||||
net::URLRequestContextGetter* CreateRequestContext();
|
net::URLRequestContextGetter* CreateRequestContext();
|
||||||
|
|
||||||
|
scoped_ptr<net::URLRequestContext> request_context_;
|
||||||
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
|
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
|
||||||
scoped_ptr<net::URLFetcher> fetcher_;
|
scoped_ptr<net::URLFetcher> fetcher_;
|
||||||
scoped_refptr<net::IOBuffer> pending_buffer_;
|
scoped_refptr<net::IOBuffer> pending_buffer_;
|
||||||
|
|
|
@ -24,10 +24,10 @@ 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(base::StringToLowerASCII(description));
|
std::string shortcut(base::ToLowerASCII(description));
|
||||||
|
|
||||||
std::vector<std::string> tokens;
|
std::vector<std::string> tokens = base::SplitString(
|
||||||
base::SplitString(shortcut, '+', &tokens);
|
shortcut, "+", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||||
|
|
||||||
// Now, parse it into an accelerator.
|
// Now, parse it into an accelerator.
|
||||||
int modifiers = ui::EF_NONE;
|
int modifiers = ui::EF_NONE;
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
// Copyright (c) 2013 GitHub, Inc.
|
|
||||||
// Use of this source code is governed by the MIT license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef ATOM_BROWSER_UI_COCOA_EVENT_PROCESSING_WINDOW_H_
|
|
||||||
#define ATOM_BROWSER_UI_COCOA_EVENT_PROCESSING_WINDOW_H_
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
|
|
||||||
// Override NSWindow to access unhandled keyboard events (for command
|
|
||||||
// processing); subclassing NSWindow is the only method to do
|
|
||||||
// this.
|
|
||||||
@interface EventProcessingWindow : NSWindow {
|
|
||||||
@private
|
|
||||||
BOOL redispatchingEvent_;
|
|
||||||
BOOL eventHandled_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sends a key event to |NSApp sendEvent:|, but also makes sure that it's not
|
|
||||||
// short-circuited to the RWHV. This is used to send keyboard events to the menu
|
|
||||||
// and the cmd-` handler if a keyboard event comes back unhandled from the
|
|
||||||
// renderer. The event must be of type |NSKeyDown|, |NSKeyUp|, or
|
|
||||||
// |NSFlagsChanged|.
|
|
||||||
// Returns |YES| if |event| has been handled.
|
|
||||||
- (BOOL)redispatchKeyEvent:(NSEvent*)event;
|
|
||||||
|
|
||||||
- (BOOL)performKeyEquivalent:(NSEvent*)theEvent;
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif // ATOM_BROWSER_UI_COCOA_EVENT_PROCESSING_WINDOW_H_
|
|
|
@ -1,106 +0,0 @@
|
||||||
// Copyright (c) 2013 GitHub, Inc.
|
|
||||||
// Use of this source code is governed by the MIT license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#import "atom/browser/ui/cocoa/event_processing_window.h"
|
|
||||||
|
|
||||||
#include "base/logging.h"
|
|
||||||
#import "content/public/browser/render_widget_host_view_mac_base.h"
|
|
||||||
|
|
||||||
@interface EventProcessingWindow ()
|
|
||||||
// Duplicate the given key event, but changing the associated window.
|
|
||||||
- (NSEvent*)keyEventForWindow:(NSWindow*)window fromKeyEvent:(NSEvent*)event;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation EventProcessingWindow
|
|
||||||
|
|
||||||
- (BOOL)redispatchKeyEvent:(NSEvent*)event {
|
|
||||||
DCHECK(event);
|
|
||||||
NSEventType eventType = [event type];
|
|
||||||
if (eventType != NSKeyDown &&
|
|
||||||
eventType != NSKeyUp &&
|
|
||||||
eventType != NSFlagsChanged) {
|
|
||||||
NOTREACHED();
|
|
||||||
return YES; // Pretend it's been handled in an effort to limit damage.
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ordinarily, the event's window should be this window. However, when
|
|
||||||
// switching between normal and fullscreen mode, we switch out the window, and
|
|
||||||
// the event's window might be the previous window (or even an earlier one if
|
|
||||||
// the renderer is running slowly and several mode switches occur). In this
|
|
||||||
// rare case, we synthesize a new key event so that its associate window
|
|
||||||
// (number) is our own.
|
|
||||||
if ([event window] != self)
|
|
||||||
event = [self keyEventForWindow:self fromKeyEvent:event];
|
|
||||||
|
|
||||||
// Redispatch the event.
|
|
||||||
eventHandled_ = YES;
|
|
||||||
redispatchingEvent_ = YES;
|
|
||||||
[NSApp sendEvent:event];
|
|
||||||
redispatchingEvent_ = NO;
|
|
||||||
|
|
||||||
// If the event was not handled by [NSApp sendEvent:], the sendEvent:
|
|
||||||
// method below will be called, and because |redispatchingEvent_| is YES,
|
|
||||||
// |eventHandled_| will be set to NO.
|
|
||||||
return eventHandled_;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)sendEvent:(NSEvent*)event {
|
|
||||||
if (!redispatchingEvent_)
|
|
||||||
[super sendEvent:event];
|
|
||||||
else
|
|
||||||
eventHandled_ = NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (NSEvent*)keyEventForWindow:(NSWindow*)window fromKeyEvent:(NSEvent*)event {
|
|
||||||
NSEventType eventType = [event type];
|
|
||||||
|
|
||||||
// Convert the event's location from the original window's coordinates into
|
|
||||||
// our own.
|
|
||||||
NSPoint eventLoc = [event locationInWindow];
|
|
||||||
eventLoc = [self convertRectFromScreen:
|
|
||||||
[[event window] convertRectToScreen:NSMakeRect(eventLoc.x, eventLoc.y, 0, 0)]].origin;
|
|
||||||
|
|
||||||
// Various things *only* apply to key down/up.
|
|
||||||
BOOL eventIsARepeat = NO;
|
|
||||||
NSString* eventCharacters = nil;
|
|
||||||
NSString* eventUnmodCharacters = nil;
|
|
||||||
if (eventType == NSKeyDown || eventType == NSKeyUp) {
|
|
||||||
eventIsARepeat = [event isARepeat];
|
|
||||||
eventCharacters = [event characters];
|
|
||||||
eventUnmodCharacters = [event charactersIgnoringModifiers];
|
|
||||||
}
|
|
||||||
|
|
||||||
// This synthesis may be slightly imperfect: we provide nil for the context,
|
|
||||||
// since I (viettrungluu) am sceptical that putting in the original context
|
|
||||||
// (if one is given) is valid.
|
|
||||||
return [NSEvent keyEventWithType:eventType
|
|
||||||
location:eventLoc
|
|
||||||
modifierFlags:[event modifierFlags]
|
|
||||||
timestamp:[event timestamp]
|
|
||||||
windowNumber:[window windowNumber]
|
|
||||||
context:nil
|
|
||||||
characters:eventCharacters
|
|
||||||
charactersIgnoringModifiers:eventUnmodCharacters
|
|
||||||
isARepeat:eventIsARepeat
|
|
||||||
keyCode:[event keyCode]];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
- (BOOL)performKeyEquivalent:(NSEvent*)event {
|
|
||||||
if (redispatchingEvent_)
|
|
||||||
return NO;
|
|
||||||
|
|
||||||
// Give the web site a chance to handle the event. If it doesn't want to
|
|
||||||
// handle it, it will call us back with one of the |handle*| methods above.
|
|
||||||
NSResponder* r = [self firstResponder];
|
|
||||||
if ([r conformsToProtocol:@protocol(RenderWidgetHostViewMacBase)])
|
|
||||||
return [r performKeyEquivalent:event];
|
|
||||||
|
|
||||||
if ([super performKeyEquivalent:event])
|
|
||||||
return YES;
|
|
||||||
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end // EventProcessingWindow
|
|
|
@ -92,7 +92,7 @@ class GtkMessageBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* TranslateToStock(int id, const std::string& text) {
|
const char* TranslateToStock(int id, const std::string& text) {
|
||||||
std::string lower = base::StringToLowerASCII(text);
|
std::string lower = base::ToLowerASCII(text);
|
||||||
if (lower == "cancel")
|
if (lower == "cancel")
|
||||||
return GTK_STOCK_CANCEL;
|
return GTK_STOCK_CANCEL;
|
||||||
else if (lower == "no")
|
else if (lower == "no")
|
||||||
|
|
|
@ -34,7 +34,7 @@ struct CommonButtonID {
|
||||||
int id;
|
int id;
|
||||||
};
|
};
|
||||||
CommonButtonID GetCommonID(const base::string16& button) {
|
CommonButtonID GetCommonID(const base::string16& button) {
|
||||||
base::string16 lower = base::StringToLowerASCII(button);
|
base::string16 lower = base::ToLowerASCII(button);
|
||||||
if (lower == L"ok")
|
if (lower == L"ok")
|
||||||
return { TDCBF_OK_BUTTON, IDOK };
|
return { TDCBF_OK_BUTTON, IDOK };
|
||||||
else if (lower == L"yes")
|
else if (lower == L"yes")
|
||||||
|
|
|
@ -42,7 +42,7 @@ void SetWindowType(::Window xwindow, const std::string& type) {
|
||||||
XDisplay* xdisplay = gfx::GetXDisplay();
|
XDisplay* xdisplay = gfx::GetXDisplay();
|
||||||
std::string type_prefix = "_NET_WM_WINDOW_TYPE_";
|
std::string type_prefix = "_NET_WM_WINDOW_TYPE_";
|
||||||
::Atom window_type = XInternAtom(
|
::Atom window_type = XInternAtom(
|
||||||
xdisplay, (type_prefix + base::StringToUpperASCII(type)).c_str(), False);
|
xdisplay, (type_prefix + base::ToUpperASCII(type)).c_str(), False);
|
||||||
XChangeProperty(xdisplay, xwindow,
|
XChangeProperty(xdisplay, xwindow,
|
||||||
XInternAtom(xdisplay, "_NET_WM_WINDOW_TYPE", False),
|
XInternAtom(xdisplay, "_NET_WM_WINDOW_TYPE", False),
|
||||||
XA_ATOM,
|
XA_ATOM,
|
||||||
|
|
|
@ -36,8 +36,6 @@ FeaturePair kWebRuntimeFeatures[] = {
|
||||||
switches::kExperimentalCanvasFeatures },
|
switches::kExperimentalCanvasFeatures },
|
||||||
{ options::kOverlayScrollbars,
|
{ options::kOverlayScrollbars,
|
||||||
switches::kOverlayScrollbars },
|
switches::kOverlayScrollbars },
|
||||||
{ options::kOverlayFullscreenVideo,
|
|
||||||
switches::kOverlayFullscreenVideo },
|
|
||||||
{ options::kSharedWorker,
|
{ options::kSharedWorker,
|
||||||
switches::kSharedWorker },
|
switches::kSharedWorker },
|
||||||
{ options::kPageVisibility,
|
{ options::kPageVisibility,
|
||||||
|
@ -148,8 +146,6 @@ void WebContentsPreferences::OverrideWebkitPrefs(
|
||||||
prefs->javascript_enabled = b;
|
prefs->javascript_enabled = b;
|
||||||
if (self->web_preferences_.GetBoolean("images", &b))
|
if (self->web_preferences_.GetBoolean("images", &b))
|
||||||
prefs->images_enabled = b;
|
prefs->images_enabled = b;
|
||||||
if (self->web_preferences_.GetBoolean("java", &b))
|
|
||||||
prefs->java_enabled = b;
|
|
||||||
if (self->web_preferences_.GetBoolean("textAreasAreResizable", &b))
|
if (self->web_preferences_.GetBoolean("textAreasAreResizable", &b))
|
||||||
prefs->text_areas_are_resizable = b;
|
prefs->text_areas_are_resizable = b;
|
||||||
if (self->web_preferences_.GetBoolean("webgl", &b))
|
if (self->web_preferences_.GetBoolean("webgl", &b))
|
||||||
|
|
|
@ -63,7 +63,8 @@ float GetScaleFactorFromPath(const base::FilePath& path) {
|
||||||
// We don't try to convert string to float here because it is very very
|
// We don't try to convert string to float here because it is very very
|
||||||
// expensive.
|
// expensive.
|
||||||
for (unsigned i = 0; i < arraysize(kScaleFactorPairs); ++i) {
|
for (unsigned i = 0; i < arraysize(kScaleFactorPairs); ++i) {
|
||||||
if (base::EndsWith(filename, kScaleFactorPairs[i].name, true))
|
if (base::EndsWith(filename, kScaleFactorPairs[i].name,
|
||||||
|
base::CompareCase::INSENSITIVE_ASCII))
|
||||||
return kScaleFactorPairs[i].scale;
|
return kScaleFactorPairs[i].scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ v8::Local<v8::Value> CallEmitWithArgs(v8::Isolate* isolate,
|
||||||
// Perform microtask checkpoint after running JavaScript.
|
// Perform microtask checkpoint after running JavaScript.
|
||||||
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||||
Locker::IsBrowserProcess() ?
|
Locker::IsBrowserProcess() ?
|
||||||
nullptr : new blink::WebScopedRunV8Script(isolate));
|
nullptr : new blink::WebScopedRunV8Script);
|
||||||
// Use node::MakeCallback to call the callback, and it will also run pending
|
// Use node::MakeCallback to call the callback, and it will also run pending
|
||||||
// tasks in Node.js.
|
// tasks in Node.js.
|
||||||
return node::MakeCallback(
|
return node::MakeCallback(
|
||||||
|
|
|
@ -48,11 +48,11 @@ CrashReporter::GetUploadedReports(const std::string& path) {
|
||||||
std::vector<CrashReporter::UploadReportResult> result;
|
std::vector<CrashReporter::UploadReportResult> result;
|
||||||
if (base::ReadFileToString(base::FilePath::FromUTF8Unsafe(path),
|
if (base::ReadFileToString(base::FilePath::FromUTF8Unsafe(path),
|
||||||
&file_content)) {
|
&file_content)) {
|
||||||
std::vector<std::string> reports;
|
std::vector<std::string> reports = base::SplitString(
|
||||||
base::SplitString(file_content, '\n', &reports);
|
file_content, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||||
for (const std::string& report : reports) {
|
for (const std::string& report : reports) {
|
||||||
std::vector<std::string> report_item;
|
std::vector<std::string> report_item = base::SplitString(
|
||||||
base::SplitString(report, ',', &report_item);
|
report, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
|
||||||
int report_time = 0;
|
int report_time = 0;
|
||||||
if (report_item.size() >= 2 && base::StringToInt(report_item[0],
|
if (report_item.size() >= 2 && base::StringToInt(report_item[0],
|
||||||
&report_time)) {
|
&report_time)) {
|
||||||
|
|
|
@ -130,7 +130,7 @@ bool CrashReporterLinux::CrashDone(const MinidumpDescriptor& minidump,
|
||||||
|
|
||||||
// static
|
// static
|
||||||
CrashReporterLinux* CrashReporterLinux::GetInstance() {
|
CrashReporterLinux* CrashReporterLinux::GetInstance() {
|
||||||
return Singleton<CrashReporterLinux>::get();
|
return base::Singleton<CrashReporterLinux>::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
|
|
||||||
|
namespace base {
|
||||||
template <typename T> struct DefaultSingletonTraits;
|
template <typename T> struct DefaultSingletonTraits;
|
||||||
|
}
|
||||||
|
|
||||||
namespace google_breakpad {
|
namespace google_breakpad {
|
||||||
class ExceptionHandler;
|
class ExceptionHandler;
|
||||||
|
@ -34,7 +36,7 @@ class CrashReporterLinux : public CrashReporter {
|
||||||
void SetUploadParameters() override;
|
void SetUploadParameters() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct DefaultSingletonTraits<CrashReporterLinux>;
|
friend struct base::DefaultSingletonTraits<CrashReporterLinux>;
|
||||||
|
|
||||||
CrashReporterLinux();
|
CrashReporterLinux();
|
||||||
virtual ~CrashReporterLinux();
|
virtual ~CrashReporterLinux();
|
||||||
|
|
|
@ -14,7 +14,9 @@
|
||||||
#include "base/strings/string_piece.h"
|
#include "base/strings/string_piece.h"
|
||||||
#include "vendor/crashpad/client/simple_string_dictionary.h"
|
#include "vendor/crashpad/client/simple_string_dictionary.h"
|
||||||
|
|
||||||
|
namespace base {
|
||||||
template <typename T> struct DefaultSingletonTraits;
|
template <typename T> struct DefaultSingletonTraits;
|
||||||
|
}
|
||||||
|
|
||||||
namespace crash_reporter {
|
namespace crash_reporter {
|
||||||
|
|
||||||
|
@ -31,7 +33,7 @@ class CrashReporterMac : public CrashReporter {
|
||||||
void SetUploadParameters() override;
|
void SetUploadParameters() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct DefaultSingletonTraits<CrashReporterMac>;
|
friend struct base::DefaultSingletonTraits<CrashReporterMac>;
|
||||||
|
|
||||||
CrashReporterMac();
|
CrashReporterMac();
|
||||||
virtual ~CrashReporterMac();
|
virtual ~CrashReporterMac();
|
||||||
|
|
|
@ -126,7 +126,7 @@ CrashReporterMac::GetUploadedReports(const std::string& path) {
|
||||||
|
|
||||||
// static
|
// static
|
||||||
CrashReporterMac* CrashReporterMac::GetInstance() {
|
CrashReporterMac* CrashReporterMac::GetInstance() {
|
||||||
return Singleton<CrashReporterMac>::get();
|
return base::Singleton<CrashReporterMac>::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
@ -259,7 +259,7 @@ google_breakpad::CustomClientInfo* CrashReporterWin::GetCustomInfo(
|
||||||
|
|
||||||
// static
|
// static
|
||||||
CrashReporterWin* CrashReporterWin::GetInstance() {
|
CrashReporterWin* CrashReporterWin::GetInstance() {
|
||||||
return Singleton<CrashReporterWin>::get();
|
return base::Singleton<CrashReporterWin>::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
@ -13,7 +13,9 @@
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "vendor/breakpad/src/client/windows/handler/exception_handler.h"
|
#include "vendor/breakpad/src/client/windows/handler/exception_handler.h"
|
||||||
|
|
||||||
|
namespace base {
|
||||||
template <typename T> struct DefaultSingletonTraits;
|
template <typename T> struct DefaultSingletonTraits;
|
||||||
|
}
|
||||||
|
|
||||||
namespace crash_reporter {
|
namespace crash_reporter {
|
||||||
|
|
||||||
|
@ -33,7 +35,7 @@ class CrashReporterWin : public CrashReporter {
|
||||||
int CrashForException(EXCEPTION_POINTERS* info);
|
int CrashForException(EXCEPTION_POINTERS* info);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct DefaultSingletonTraits<CrashReporterWin>;
|
friend struct base::DefaultSingletonTraits<CrashReporterWin>;
|
||||||
|
|
||||||
CrashReporterWin();
|
CrashReporterWin();
|
||||||
virtual ~CrashReporterWin();
|
virtual ~CrashReporterWin();
|
||||||
|
|
|
@ -45,7 +45,7 @@ template<>
|
||||||
struct Converter<blink::WebInputEvent::Type> {
|
struct Converter<blink::WebInputEvent::Type> {
|
||||||
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
|
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
|
||||||
blink::WebInputEvent::Type* out) {
|
blink::WebInputEvent::Type* out) {
|
||||||
std::string type = base::StringToLowerASCII(V8ToString(val));
|
std::string type = base::ToLowerASCII(V8ToString(val));
|
||||||
if (type == "mousedown")
|
if (type == "mousedown")
|
||||||
*out = blink::WebInputEvent::MouseDown;
|
*out = blink::WebInputEvent::MouseDown;
|
||||||
else if (type == "mouseup")
|
else if (type == "mouseup")
|
||||||
|
@ -82,7 +82,7 @@ template<>
|
||||||
struct Converter<blink::WebMouseEvent::Button> {
|
struct Converter<blink::WebMouseEvent::Button> {
|
||||||
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
|
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
|
||||||
blink::WebMouseEvent::Button* out) {
|
blink::WebMouseEvent::Button* out) {
|
||||||
std::string button = base::StringToLowerASCII(V8ToString(val));
|
std::string button = base::ToLowerASCII(V8ToString(val));
|
||||||
if (button == "left")
|
if (button == "left")
|
||||||
*out = blink::WebMouseEvent::Button::ButtonLeft;
|
*out = blink::WebMouseEvent::Button::ButtonLeft;
|
||||||
else if (button == "middle")
|
else if (button == "middle")
|
||||||
|
@ -97,7 +97,7 @@ template<>
|
||||||
struct Converter<blink::WebInputEvent::Modifiers> {
|
struct Converter<blink::WebInputEvent::Modifiers> {
|
||||||
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
|
static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val,
|
||||||
blink::WebInputEvent::Modifiers* out) {
|
blink::WebInputEvent::Modifiers* out) {
|
||||||
std::string modifier = base::StringToLowerASCII(V8ToString(val));
|
std::string modifier = base::ToLowerASCII(V8ToString(val));
|
||||||
if (modifier == "shift")
|
if (modifier == "shift")
|
||||||
*out = blink::WebInputEvent::ShiftKey;
|
*out = blink::WebInputEvent::ShiftKey;
|
||||||
else if (modifier == "control" || modifier == "ctrl")
|
else if (modifier == "control" || modifier == "ctrl")
|
||||||
|
@ -166,7 +166,7 @@ bool Converter<blink::WebKeyboardEvent>::FromV8(
|
||||||
out->windowsKeyCode = atom::KeyboardCodeFromCharCode(code, &shifted);
|
out->windowsKeyCode = atom::KeyboardCodeFromCharCode(code, &shifted);
|
||||||
else if (dict.Get("keyCode", &identifier))
|
else if (dict.Get("keyCode", &identifier))
|
||||||
out->windowsKeyCode = atom::KeyboardCodeFromKeyIdentifier(
|
out->windowsKeyCode = atom::KeyboardCodeFromKeyIdentifier(
|
||||||
base::StringToLowerASCII(identifier));
|
base::ToLowerASCII(identifier));
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ bool Converter<blink::WebDeviceEmulationParams>::FromV8(
|
||||||
|
|
||||||
std::string screen_position;
|
std::string screen_position;
|
||||||
if (dict.Get("screenPosition", &screen_position)) {
|
if (dict.Get("screenPosition", &screen_position)) {
|
||||||
screen_position = base::StringToLowerASCII(screen_position);
|
screen_position = base::ToLowerASCII(screen_position);
|
||||||
if (screen_position == "mobile")
|
if (screen_position == "mobile")
|
||||||
out->screenPosition = blink::WebDeviceEmulationParams::Mobile;
|
out->screenPosition = blink::WebDeviceEmulationParams::Mobile;
|
||||||
else if (screen_position == "desktop")
|
else if (screen_position == "desktop")
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct V8FunctionInvoker<v8::Local<v8::Value>(ArgTypes...)> {
|
||||||
return v8::Null(isolate);
|
return v8::Null(isolate);
|
||||||
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||||
Locker::IsBrowserProcess() ?
|
Locker::IsBrowserProcess() ?
|
||||||
nullptr : new blink::WebScopedRunV8Script(isolate));
|
nullptr : new blink::WebScopedRunV8Script);
|
||||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||||
v8::Local<v8::Context> context = holder->CreationContext();
|
v8::Local<v8::Context> context = holder->CreationContext();
|
||||||
v8::Context::Scope context_scope(context);
|
v8::Context::Scope context_scope(context);
|
||||||
|
@ -72,7 +72,7 @@ struct V8FunctionInvoker<void(ArgTypes...)> {
|
||||||
return;
|
return;
|
||||||
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||||
Locker::IsBrowserProcess() ?
|
Locker::IsBrowserProcess() ?
|
||||||
nullptr : new blink::WebScopedRunV8Script(isolate));
|
nullptr : new blink::WebScopedRunV8Script);
|
||||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||||
v8::Local<v8::Context> context = holder->CreationContext();
|
v8::Local<v8::Context> context = holder->CreationContext();
|
||||||
v8::Context::Scope context_scope(context);
|
v8::Context::Scope context_scope(context);
|
||||||
|
@ -93,7 +93,7 @@ struct V8FunctionInvoker<ReturnType(ArgTypes...)> {
|
||||||
return ret;
|
return ret;
|
||||||
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||||
Locker::IsBrowserProcess() ?
|
Locker::IsBrowserProcess() ?
|
||||||
nullptr : new blink::WebScopedRunV8Script(isolate));
|
nullptr : new blink::WebScopedRunV8Script);
|
||||||
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
v8::Local<v8::Function> holder = function.NewHandle(isolate);
|
||||||
v8::Local<v8::Context> context = holder->CreationContext();
|
v8::Local<v8::Context> context = holder->CreationContext();
|
||||||
v8::Context::Scope context_scope(context);
|
v8::Context::Scope context_scope(context);
|
||||||
|
|
|
@ -227,7 +227,7 @@ void NodeBindings::UvRunOnce() {
|
||||||
|
|
||||||
// Perform microtask checkpoint after running JavaScript.
|
// Perform microtask checkpoint after running JavaScript.
|
||||||
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
scoped_ptr<blink::WebScopedRunV8Script> script_scope(
|
||||||
is_browser_ ? nullptr : new blink::WebScopedRunV8Script(env->isolate()));
|
is_browser_ ? nullptr : new blink::WebScopedRunV8Script);
|
||||||
|
|
||||||
// Deal with uv events.
|
// Deal with uv events.
|
||||||
int r = uv_run(uv_loop_, UV_RUN_NOWAIT);
|
int r = uv_run(uv_loop_, UV_RUN_NOWAIT);
|
||||||
|
|
|
@ -95,7 +95,6 @@ const char kDirectWrite[] = "directWrite";
|
||||||
const char kExperimentalFeatures[] = "experimentalFeatures";
|
const char kExperimentalFeatures[] = "experimentalFeatures";
|
||||||
const char kExperimentalCanvasFeatures[] = "experimentalCanvasFeatures";
|
const char kExperimentalCanvasFeatures[] = "experimentalCanvasFeatures";
|
||||||
const char kOverlayScrollbars[] = "overlayScrollbars";
|
const char kOverlayScrollbars[] = "overlayScrollbars";
|
||||||
const char kOverlayFullscreenVideo[] = "overlayFullscreenVideo";
|
|
||||||
const char kSharedWorker[] = "sharedWorker";
|
const char kSharedWorker[] = "sharedWorker";
|
||||||
|
|
||||||
} // namespace options
|
} // namespace options
|
||||||
|
@ -139,7 +138,6 @@ const char kGuestInstanceID[] = "guest-instance-id";
|
||||||
const char kExperimentalFeatures[] = "experimental-features";
|
const char kExperimentalFeatures[] = "experimental-features";
|
||||||
const char kExperimentalCanvasFeatures[] = "experimental-canvas-features";
|
const char kExperimentalCanvasFeatures[] = "experimental-canvas-features";
|
||||||
const char kOverlayScrollbars[] = "overlay-scrollbars";
|
const char kOverlayScrollbars[] = "overlay-scrollbars";
|
||||||
const char kOverlayFullscreenVideo[] = "overlay-fullscreen-video";
|
|
||||||
const char kSharedWorker[] = "shared-worker";
|
const char kSharedWorker[] = "shared-worker";
|
||||||
const char kPageVisibility[] = "page-visiblity";
|
const char kPageVisibility[] = "page-visiblity";
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,6 @@ extern const char kGuestInstanceID[];
|
||||||
extern const char kExperimentalFeatures[];
|
extern const char kExperimentalFeatures[];
|
||||||
extern const char kExperimentalCanvasFeatures[];
|
extern const char kExperimentalCanvasFeatures[];
|
||||||
extern const char kOverlayScrollbars[];
|
extern const char kOverlayScrollbars[];
|
||||||
extern const char kOverlayFullscreenVideo[];
|
|
||||||
extern const char kSharedWorker[];
|
extern const char kSharedWorker[];
|
||||||
extern const char kPageVisibility[];
|
extern const char kPageVisibility[];
|
||||||
|
|
||||||
|
@ -79,7 +78,6 @@ extern const char kGuestInstanceID[];
|
||||||
extern const char kExperimentalFeatures[];
|
extern const char kExperimentalFeatures[];
|
||||||
extern const char kExperimentalCanvasFeatures[];
|
extern const char kExperimentalCanvasFeatures[];
|
||||||
extern const char kOverlayScrollbars[];
|
extern const char kOverlayScrollbars[];
|
||||||
extern const char kOverlayFullscreenVideo[];
|
|
||||||
extern const char kSharedWorker[];
|
extern const char kSharedWorker[];
|
||||||
extern const char kPageVisibility[];
|
extern const char kPageVisibility[];
|
||||||
|
|
||||||
|
|
|
@ -226,8 +226,6 @@ void AtomRendererClient::EnableWebRuntimeFeatures() {
|
||||||
blink::WebRuntimeFeatures::enableExperimentalCanvasFeatures(true);
|
blink::WebRuntimeFeatures::enableExperimentalCanvasFeatures(true);
|
||||||
if (IsSwitchEnabled(command_line, switches::kOverlayScrollbars))
|
if (IsSwitchEnabled(command_line, switches::kOverlayScrollbars))
|
||||||
blink::WebRuntimeFeatures::enableOverlayScrollbars(true);
|
blink::WebRuntimeFeatures::enableOverlayScrollbars(true);
|
||||||
if (IsSwitchEnabled(command_line, switches::kOverlayFullscreenVideo))
|
|
||||||
blink::WebRuntimeFeatures::enableOverlayFullscreenVideo(true);
|
|
||||||
if (IsSwitchEnabled(command_line, switches::kSharedWorker))
|
if (IsSwitchEnabled(command_line, switches::kSharedWorker))
|
||||||
blink::WebRuntimeFeatures::enableSharedWorker(true);
|
blink::WebRuntimeFeatures::enableSharedWorker(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,7 +410,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||||
// be CPU bound, the page overly complex/large or the system just
|
// be CPU bound, the page overly complex/large or the system just
|
||||||
// memory-bound.
|
// memory-bound.
|
||||||
static const int kPrinterSettingsTimeout = 60000;
|
static const int kPrinterSettingsTimeout = 60000;
|
||||||
base::OneShotTimer<base::MessageLoop> quit_timer;
|
base::OneShotTimer quit_timer;
|
||||||
quit_timer.Start(FROM_HERE,
|
quit_timer.Start(FROM_HERE,
|
||||||
TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
|
TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
|
||||||
base::MessageLoop::current(), &base::MessageLoop::Quit);
|
base::MessageLoop::current(), &base::MessageLoop::Quit);
|
||||||
|
|
|
@ -503,7 +503,7 @@ class ProcessSingleton::LinuxWatcher
|
||||||
// reads.
|
// reads.
|
||||||
size_t bytes_read_;
|
size_t bytes_read_;
|
||||||
|
|
||||||
base::OneShotTimer<SocketReader> timer_;
|
base::OneShotTimer timer_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(SocketReader);
|
DISALLOW_COPY_AND_ASSIGN(SocketReader);
|
||||||
};
|
};
|
||||||
|
|
|
@ -111,7 +111,7 @@ TtsController* TtsController::GetInstance() {
|
||||||
|
|
||||||
// static
|
// static
|
||||||
TtsControllerImpl* TtsControllerImpl::GetInstance() {
|
TtsControllerImpl* TtsControllerImpl::GetInstance() {
|
||||||
return Singleton<TtsControllerImpl>::get();
|
return base::Singleton<TtsControllerImpl>::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
TtsControllerImpl::TtsControllerImpl()
|
TtsControllerImpl::TtsControllerImpl()
|
||||||
|
|
|
@ -77,7 +77,7 @@ class TtsControllerImpl : public TtsController {
|
||||||
int GetMatchingVoice(const Utterance* utterance,
|
int GetMatchingVoice(const Utterance* utterance,
|
||||||
std::vector<VoiceData>& voices);
|
std::vector<VoiceData>& voices);
|
||||||
|
|
||||||
friend struct DefaultSingletonTraits<TtsControllerImpl>;
|
friend struct base::DefaultSingletonTraits<TtsControllerImpl>;
|
||||||
|
|
||||||
// The current utterance being spoken.
|
// The current utterance being spoken.
|
||||||
Utterance* current_utterance_;
|
Utterance* current_utterance_;
|
||||||
|
|
|
@ -91,7 +91,7 @@ class TtsPlatformImplMac : public TtsPlatformImpl {
|
||||||
int last_char_index_;
|
int last_char_index_;
|
||||||
bool paused_;
|
bool paused_;
|
||||||
|
|
||||||
friend struct DefaultSingletonTraits<TtsPlatformImplMac>;
|
friend struct base::DefaultSingletonTraits<TtsPlatformImplMac>;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplMac);
|
DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplMac);
|
||||||
};
|
};
|
||||||
|
@ -291,7 +291,7 @@ TtsPlatformImplMac::~TtsPlatformImplMac() {
|
||||||
|
|
||||||
// static
|
// static
|
||||||
TtsPlatformImplMac* TtsPlatformImplMac::GetInstance() {
|
TtsPlatformImplMac* TtsPlatformImplMac::GetInstance() {
|
||||||
return Singleton<TtsPlatformImplMac>::get();
|
return base::Singleton<TtsPlatformImplMac>::get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation ChromeTtsDelegate
|
@implementation ChromeTtsDelegate
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "third_party/skia/include/core/SkMatrix.h"
|
#include "third_party/skia/include/core/SkMatrix.h"
|
||||||
#include "third_party/skia/include/core/SkPaint.h"
|
#include "third_party/skia/include/core/SkPaint.h"
|
||||||
#include "third_party/skia/include/core/SkPoint.h"
|
#include "third_party/skia/include/core/SkPoint.h"
|
||||||
#include "third_party/skia/include/core/SkTemplates.h"
|
|
||||||
#include "third_party/skia/include/core/SkTypeface.h"
|
#include "third_party/skia/include/core/SkTypeface.h"
|
||||||
#include "ui/gfx/geometry/rect.h"
|
#include "ui/gfx/geometry/rect.h"
|
||||||
#include "url/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
@ -315,7 +314,7 @@ int32_t PepperFlashRendererHost::OnNavigate(
|
||||||
bool rejected = false;
|
bool rejected = false;
|
||||||
while (header_iter.GetNext()) {
|
while (header_iter.GetNext()) {
|
||||||
std::string lower_case_header_name =
|
std::string lower_case_header_name =
|
||||||
base::StringToLowerASCII(header_iter.name());
|
base::ToLowerASCII(header_iter.name());
|
||||||
if (!IsSimpleHeader(lower_case_header_name, header_iter.values())) {
|
if (!IsSimpleHeader(lower_case_header_name, header_iter.values())) {
|
||||||
rejected = true;
|
rejected = true;
|
||||||
|
|
||||||
|
|
|
@ -544,7 +544,6 @@ void PrepareFrameAndViewForPrint::CopySelection(
|
||||||
// on the page).
|
// on the page).
|
||||||
WebPreferences prefs = preferences;
|
WebPreferences prefs = preferences;
|
||||||
prefs.javascript_enabled = false;
|
prefs.javascript_enabled = false;
|
||||||
prefs.java_enabled = false;
|
|
||||||
|
|
||||||
blink::WebView* web_view = blink::WebView::create(this);
|
blink::WebView* web_view = blink::WebView::create(this);
|
||||||
owns_web_view_ = true;
|
owns_web_view_ = true;
|
||||||
|
|
|
@ -123,7 +123,6 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||||
* `allowRunningInsecureContent` Boolean - Allow a https page to run
|
* `allowRunningInsecureContent` Boolean - Allow a https page to run
|
||||||
JavaScript, CSS or plugins from http URLs. Default is `false`.
|
JavaScript, CSS or plugins from http URLs. Default is `false`.
|
||||||
* `images` Boolean - Enables image support. Default is `true`.
|
* `images` Boolean - Enables image support. Default is `true`.
|
||||||
* `java` Boolean - Enables Java support. Default is `false`.
|
|
||||||
* `textAreasAreResizable` Boolean - Make TextArea elements resizable. Default
|
* `textAreasAreResizable` Boolean - Make TextArea elements resizable. Default
|
||||||
is `true`.
|
is `true`.
|
||||||
* `webgl` Boolean - Enables WebGL support. Default is `true`.
|
* `webgl` Boolean - Enables WebGL support. Default is `true`.
|
||||||
|
@ -135,8 +134,6 @@ It creates a new `BrowserWindow` with native properties as set by the `options`.
|
||||||
canvas features. Default is `false`.
|
canvas features. Default is `false`.
|
||||||
* `overlayScrollbars` Boolean - Enables overlay scrollbars. Default is
|
* `overlayScrollbars` Boolean - Enables overlay scrollbars. Default is
|
||||||
`false`.
|
`false`.
|
||||||
* `overlayFullscreenVideo` Boolean - Enables overlay fullscreen video. Default
|
|
||||||
is `false`
|
|
||||||
* `sharedWorker` Boolean - Enables Shared Worker support. Default is `false`.
|
* `sharedWorker` Boolean - Enables Shared Worker support. Default is `false`.
|
||||||
* `directWrite` Boolean - Enables DirectWrite font rendering system on
|
* `directWrite` Boolean - Enables DirectWrite font rendering system on
|
||||||
Windows. Default is `true`.
|
Windows. Default is `true`.
|
||||||
|
|
|
@ -200,8 +200,6 @@
|
||||||
'atom/browser/ui/atom_menu_model.h',
|
'atom/browser/ui/atom_menu_model.h',
|
||||||
'atom/browser/ui/cocoa/atom_menu_controller.h',
|
'atom/browser/ui/cocoa/atom_menu_controller.h',
|
||||||
'atom/browser/ui/cocoa/atom_menu_controller.mm',
|
'atom/browser/ui/cocoa/atom_menu_controller.mm',
|
||||||
'atom/browser/ui/cocoa/event_processing_window.h',
|
|
||||||
'atom/browser/ui/cocoa/event_processing_window.mm',
|
|
||||||
'atom/browser/ui/file_dialog.h',
|
'atom/browser/ui/file_dialog.h',
|
||||||
'atom/browser/ui/file_dialog_gtk.cc',
|
'atom/browser/ui/file_dialog_gtk.cc',
|
||||||
'atom/browser/ui/file_dialog_mac.mm',
|
'atom/browser/ui/file_dialog_mac.mm',
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 57842edb817cc1ae38a02fd7f266dd6aa3afbb45
|
Subproject commit fff0f0e2d39886a49fce4f78aa3b625b880b3607
|
Loading…
Add table
Add a link
Reference in a new issue