commit
f829f2eb0c
72 changed files with 494 additions and 365 deletions
|
@ -19,10 +19,10 @@ class AtomContentClient : public brightray::ContentClient {
|
|||
|
||||
protected:
|
||||
// content::ContentClient:
|
||||
virtual std::string GetProduct() const OVERRIDE;
|
||||
virtual void AddAdditionalSchemes(
|
||||
std::string GetProduct() const override;
|
||||
void AddAdditionalSchemes(
|
||||
std::vector<std::string>* standard_schemes,
|
||||
std::vector<std::string>* savable_schemes) OVERRIDE;
|
||||
std::vector<std::string>* savable_schemes) override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomContentClient);
|
||||
|
|
|
@ -13,11 +13,14 @@
|
|||
#include <fcntl.h>
|
||||
|
||||
#include <windows.h>
|
||||
#include <shellscalingapi.h>
|
||||
#include <tchar.h>
|
||||
#include <shellapi.h>
|
||||
|
||||
#include "atom/app/atom_main_delegate.h"
|
||||
#include "atom/common/crash_reporter/win/crash_service_main.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/win/windows_version.h"
|
||||
#include "content/public/app/startup_helper_win.h"
|
||||
#include "sandbox/win/src/sandbox_types.h"
|
||||
#include "ui/gfx/win/dpi.h"
|
||||
|
@ -37,6 +40,48 @@ int Start(int argc, char *argv[]);
|
|||
|
||||
#if defined(OS_WIN)
|
||||
|
||||
namespace {
|
||||
|
||||
// Win8.1 supports monitor-specific DPI scaling.
|
||||
bool SetProcessDpiAwarenessWrapper(PROCESS_DPI_AWARENESS value) {
|
||||
typedef HRESULT(WINAPI *SetProcessDpiAwarenessPtr)(PROCESS_DPI_AWARENESS);
|
||||
SetProcessDpiAwarenessPtr set_process_dpi_awareness_func =
|
||||
reinterpret_cast<SetProcessDpiAwarenessPtr>(
|
||||
GetProcAddress(GetModuleHandleA("user32.dll"),
|
||||
"SetProcessDpiAwarenessInternal"));
|
||||
if (set_process_dpi_awareness_func) {
|
||||
HRESULT hr = set_process_dpi_awareness_func(value);
|
||||
if (SUCCEEDED(hr)) {
|
||||
VLOG(1) << "SetProcessDpiAwareness succeeded.";
|
||||
return true;
|
||||
} else if (hr == E_ACCESSDENIED) {
|
||||
LOG(ERROR) << "Access denied error from SetProcessDpiAwareness. "
|
||||
"Function called twice, or manifest was used.";
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// This function works for Windows Vista through Win8. Win8.1 must use
|
||||
// SetProcessDpiAwareness[Wrapper].
|
||||
BOOL SetProcessDPIAwareWrapper() {
|
||||
typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID);
|
||||
SetProcessDPIAwarePtr set_process_dpi_aware_func =
|
||||
reinterpret_cast<SetProcessDPIAwarePtr>(
|
||||
GetProcAddress(GetModuleHandleA("user32.dll"),
|
||||
"SetProcessDPIAware"));
|
||||
return set_process_dpi_aware_func &&
|
||||
set_process_dpi_aware_func();
|
||||
}
|
||||
|
||||
void EnableHighDPISupport() {
|
||||
if (!SetProcessDpiAwarenessWrapper(PROCESS_SYSTEM_DPI_AWARE)) {
|
||||
SetProcessDPIAwareWrapper();
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
|
||||
int argc = 0;
|
||||
wchar_t** wargv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
|
||||
|
@ -103,8 +148,11 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
|
|||
content::InitializeSandboxInfo(&sandbox_info);
|
||||
atom::AtomMainDelegate delegate;
|
||||
|
||||
// Now chrome relies on a regkey to enable high dpi support.
|
||||
gfx::EnableHighDPISupport();
|
||||
// We don't want to set DPI awareness on pre-Win7 because we don't support
|
||||
// DirectWrite there. GDI fonts are kerned very badly, so better to leave
|
||||
// DPI-unaware and at effective 1.0. See also ShouldUseDirectWrite().
|
||||
if (base::win::GetVersion() >= base::win::VERSION_WIN7)
|
||||
EnableHighDPISupport();
|
||||
|
||||
content::ContentMainParams params(&delegate);
|
||||
params.instance = instance;
|
||||
|
|
|
@ -26,20 +26,20 @@ class AutoUpdater : public mate::EventEmitter,
|
|||
virtual ~AutoUpdater();
|
||||
|
||||
// AutoUpdaterDelegate implementations.
|
||||
virtual void OnError(const std::string& error) OVERRIDE;
|
||||
virtual void OnCheckingForUpdate() OVERRIDE;
|
||||
virtual void OnUpdateAvailable() OVERRIDE;
|
||||
virtual void OnUpdateNotAvailable() OVERRIDE;
|
||||
virtual void OnUpdateDownloaded(
|
||||
void OnError(const std::string& error) override;
|
||||
void OnCheckingForUpdate() override;
|
||||
void OnUpdateAvailable() override;
|
||||
void OnUpdateNotAvailable() override;
|
||||
void OnUpdateDownloaded(
|
||||
const std::string& release_notes,
|
||||
const std::string& release_name,
|
||||
const base::Time& release_date,
|
||||
const std::string& update_url,
|
||||
const base::Closure& quit_and_install) OVERRIDE;
|
||||
const base::Closure& quit_and_install) override;
|
||||
|
||||
// mate::Wrappable implementations:
|
||||
virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
|
||||
v8::Isolate* isolate);
|
||||
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
|
||||
v8::Isolate* isolate) override;
|
||||
|
||||
private:
|
||||
void QuitAndInstall();
|
||||
|
|
|
@ -28,8 +28,8 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
|
|||
virtual ~GlobalShortcut();
|
||||
|
||||
// mate::Wrappable implementations:
|
||||
virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
|
||||
v8::Isolate* isolate) OVERRIDE;
|
||||
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
|
||||
v8::Isolate* isolate) override;
|
||||
|
||||
private:
|
||||
typedef std::map<ui::Accelerator, base::Closure> AcceleratorCallbackMap;
|
||||
|
@ -41,7 +41,7 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
|
|||
void UnregisterAll();
|
||||
|
||||
// GlobalShortcutListener::Observer implementation.
|
||||
virtual void OnKeyPressed(const ui::Accelerator& accelerator) OVERRIDE;
|
||||
void OnKeyPressed(const ui::Accelerator& accelerator) override;
|
||||
|
||||
AcceleratorCallbackMap accelerator_callback_map_;
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ class MenuMac : public Menu {
|
|||
protected:
|
||||
MenuMac();
|
||||
|
||||
virtual void Popup(Window* window) OVERRIDE;
|
||||
virtual void PopupAt(Window* window, int x, int y) OVERRIDE;
|
||||
void Popup(Window* window) override;
|
||||
void PopupAt(Window* window, int x, int y) override;
|
||||
|
||||
base::scoped_nsobject<AtomMenuController> menu_controller_;
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ class MenuViews : public Menu {
|
|||
MenuViews();
|
||||
|
||||
protected:
|
||||
virtual void Popup(Window* window) OVERRIDE;
|
||||
virtual void PopupAt(Window* window, int x, int y) OVERRIDE;
|
||||
void Popup(Window* window) override;
|
||||
void PopupAt(Window* window, int x, int y) override;
|
||||
|
||||
private:
|
||||
void PopupAtPoint(Window* window, const gfx::Point& point);
|
||||
|
|
|
@ -24,9 +24,9 @@ class PowerMonitor : public mate::EventEmitter,
|
|||
virtual ~PowerMonitor();
|
||||
|
||||
// base::PowerObserver implementations:
|
||||
virtual void OnPowerStateChange(bool on_battery_power) OVERRIDE;
|
||||
virtual void OnSuspend() OVERRIDE;
|
||||
virtual void OnResume() OVERRIDE;
|
||||
void OnPowerStateChange(bool on_battery_power) override;
|
||||
void OnSuspend() override;
|
||||
void OnResume() override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(PowerMonitor);
|
||||
|
|
|
@ -53,7 +53,7 @@ class CustomProtocolRequestJob : public AdapterRequestJob {
|
|||
}
|
||||
|
||||
// AdapterRequestJob:
|
||||
virtual void GetJobTypeInUI() OVERRIDE {
|
||||
void GetJobTypeInUI() override {
|
||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
|
@ -128,9 +128,9 @@ class CustomProtocolHandler : public ProtocolHandler {
|
|||
: registry_(registry), protocol_handler_(protocol_handler) {
|
||||
}
|
||||
|
||||
virtual net::URLRequestJob* MaybeCreateJob(
|
||||
net::URLRequestJob* MaybeCreateJob(
|
||||
net::URLRequest* request,
|
||||
net::NetworkDelegate* network_delegate) const OVERRIDE {
|
||||
net::NetworkDelegate* network_delegate) const override {
|
||||
return new CustomProtocolRequestJob(registry_, protocol_handler_.get(),
|
||||
request, network_delegate);
|
||||
}
|
||||
|
|
|
@ -247,14 +247,14 @@ void WebContents::RenderViewReady() {
|
|||
// WebContents::GetRenderWidgetHostView will return the RWHV of an
|
||||
// interstitial page if one is showing at this time. We only want opacity
|
||||
// to apply to web pages.
|
||||
web_contents()->GetRenderViewHost()->GetView()->
|
||||
SetBackgroundOpaque(guest_opaque_);
|
||||
|
||||
content::RenderViewHost* rvh = web_contents()->GetRenderViewHost();
|
||||
if (auto_size_enabled_) {
|
||||
rvh->EnableAutoResize(min_auto_size_, max_auto_size_);
|
||||
if (guest_opaque_) {
|
||||
web_contents()
|
||||
->GetRenderViewHost()
|
||||
->GetView()
|
||||
->SetBackgroundColorToDefault();
|
||||
} else {
|
||||
rvh->DisableAutoResize(element_size_);
|
||||
web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor(
|
||||
SK_ColorTRANSPARENT);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -498,7 +498,15 @@ void WebContents::SetAllowTransparency(bool allow) {
|
|||
if (!web_contents()->GetRenderViewHost()->GetView())
|
||||
return;
|
||||
|
||||
web_contents()->GetRenderViewHost()->GetView()->SetBackgroundOpaque(!allow);
|
||||
if (guest_opaque_) {
|
||||
web_contents()
|
||||
->GetRenderViewHost()
|
||||
->GetView()
|
||||
->SetBackgroundColorToDefault();
|
||||
} else {
|
||||
web_contents()->GetRenderViewHost()->GetView()->SetBackgroundColor(
|
||||
SK_ColorTRANSPARENT);
|
||||
}
|
||||
}
|
||||
|
||||
mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
|
||||
|
|
|
@ -34,10 +34,10 @@ class Event : public Wrappable,
|
|||
virtual ~Event();
|
||||
|
||||
// Wrappable implementations:
|
||||
virtual ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate* isolate);
|
||||
ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate* isolate) override;
|
||||
|
||||
// content::WebContentsObserver implementations:
|
||||
virtual void WebContentsDestroyed() OVERRIDE;
|
||||
void WebContentsDestroyed() override;
|
||||
|
||||
private:
|
||||
// Replyer for the synchronous messages.
|
||||
|
|
|
@ -17,10 +17,10 @@ class AtomAccessTokenStore : public content::AccessTokenStore {
|
|||
virtual ~AtomAccessTokenStore();
|
||||
|
||||
// content::AccessTokenStore:
|
||||
virtual void LoadAccessTokens(
|
||||
const LoadAccessTokensCallbackType& callback) OVERRIDE;
|
||||
virtual void SaveAccessToken(const GURL& server_url,
|
||||
const base::string16& access_token) OVERRIDE;
|
||||
void LoadAccessTokens(
|
||||
const LoadAccessTokensCallbackType& callback) override;
|
||||
void SaveAccessToken(const GURL& server_url,
|
||||
const base::string16& access_token) override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(AtomAccessTokenStore);
|
||||
|
|
|
@ -68,8 +68,7 @@ net::URLRequestJobFactory* AtomBrowserContext::CreateURLRequestJobFactory(
|
|||
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
|
||||
|
||||
// Set up interceptors in the reverse order.
|
||||
scoped_ptr<net::URLRequestJobFactory> top_job_factory =
|
||||
job_factory.PassAs<net::URLRequestJobFactory>();
|
||||
scoped_ptr<net::URLRequestJobFactory> top_job_factory = job_factory.Pass();
|
||||
content::URLRequestInterceptorScopedVector::reverse_iterator it;
|
||||
for (it = interceptors->rbegin(); it != interceptors->rend(); ++it)
|
||||
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
|
||||
|
|
|
@ -27,14 +27,14 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
|
|||
|
||||
protected:
|
||||
// Implementations of brightray::BrowserMainParts.
|
||||
virtual brightray::BrowserContext* CreateBrowserContext() OVERRIDE;
|
||||
brightray::BrowserContext* CreateBrowserContext() override;
|
||||
|
||||
// Implementations of content::BrowserMainParts.
|
||||
virtual void PostEarlyInitialization() OVERRIDE;
|
||||
virtual void PreMainMessageLoopRun() OVERRIDE;
|
||||
void PostEarlyInitialization() override;
|
||||
void PreMainMessageLoopRun() override;
|
||||
#if defined(OS_MACOSX)
|
||||
virtual void PreMainMessageLoopStart() OVERRIDE;
|
||||
virtual void PostDestroyThreads() OVERRIDE;
|
||||
void PreMainMessageLoopStart() override;
|
||||
void PostDestroyThreads() override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace atom {
|
|||
class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
|
||||
public:
|
||||
// content::JavaScriptDialogManager implementations.
|
||||
virtual void RunJavaScriptDialog(
|
||||
void RunJavaScriptDialog(
|
||||
content::WebContents* web_contents,
|
||||
const GURL& origin_url,
|
||||
const std::string& accept_lang,
|
||||
|
@ -22,16 +22,15 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager {
|
|||
const base::string16& message_text,
|
||||
const base::string16& default_prompt_text,
|
||||
const DialogClosedCallback& callback,
|
||||
bool* did_suppress_message) OVERRIDE;
|
||||
virtual void RunBeforeUnloadDialog(
|
||||
bool* did_suppress_message) override;
|
||||
void RunBeforeUnloadDialog(
|
||||
content::WebContents* web_contents,
|
||||
const base::string16& message_text,
|
||||
bool is_reload,
|
||||
const DialogClosedCallback& callback) OVERRIDE;
|
||||
virtual void CancelActiveAndPendingDialogs(
|
||||
content::WebContents* web_contents) OVERRIDE {}
|
||||
virtual void WebContentsDestroyed(
|
||||
content::WebContents* web_contents) OVERRIDE {}
|
||||
const DialogClosedCallback& callback) override;
|
||||
void CancelActiveAndPendingDialogs(
|
||||
content::WebContents* web_contents) override {}
|
||||
void WebContentsDestroyed(content::WebContents* web_contents) override {}
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "atom/common/native_mate_converters/file_path_converter.h"
|
||||
#include "atom/common/options_switches.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/json/json_writer.h"
|
||||
#include "base/prefs/pref_service.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
|
@ -57,6 +57,10 @@
|
|||
#include "ui/gfx/screen.h"
|
||||
#include "ui/gfx/size.h"
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "ui/gfx/switches.h"
|
||||
#endif
|
||||
|
||||
using content::NavigationEntry;
|
||||
using content::RenderWidgetHostView;
|
||||
using content::RenderWidgetHost;
|
||||
|
|
|
@ -129,7 +129,7 @@ class NativeWindowClientView : public views::ClientView {
|
|||
}
|
||||
virtual ~NativeWindowClientView() {}
|
||||
|
||||
virtual bool CanClose() OVERRIDE {
|
||||
bool CanClose() override {
|
||||
static_cast<NativeWindowViews*>(contents_view())->CloseWebContents();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -28,16 +28,16 @@ class AdapterRequestJob : public net::URLRequestJob {
|
|||
|
||||
public:
|
||||
// net::URLRequestJob:
|
||||
virtual void Start() OVERRIDE;
|
||||
virtual void Kill() OVERRIDE;
|
||||
virtual bool ReadRawData(net::IOBuffer* buf,
|
||||
int buf_size,
|
||||
int *bytes_read) OVERRIDE;
|
||||
virtual bool IsRedirectResponse(GURL* location,
|
||||
int* http_status_code) OVERRIDE;
|
||||
virtual net::Filter* SetupFilter() const OVERRIDE;
|
||||
virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
|
||||
virtual bool GetCharset(std::string* charset) OVERRIDE;
|
||||
void Start() override;
|
||||
void Kill() override;
|
||||
bool ReadRawData(net::IOBuffer* buf,
|
||||
int buf_size,
|
||||
int *bytes_read) override;
|
||||
bool IsRedirectResponse(GURL* location,
|
||||
int* http_status_code) override;
|
||||
net::Filter* SetupFilter() const override;
|
||||
bool GetMimeType(std::string* mime_type) const override;
|
||||
bool GetCharset(std::string* charset) override;
|
||||
|
||||
base::WeakPtr<AdapterRequestJob> GetWeakPtr();
|
||||
|
||||
|
|
|
@ -27,10 +27,10 @@ class AsarProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler {
|
|||
Archive* GetOrCreateAsarArchive(const base::FilePath& path) const;
|
||||
|
||||
// net::URLRequestJobFactory::ProtocolHandler:
|
||||
virtual net::URLRequestJob* MaybeCreateJob(
|
||||
net::URLRequestJob* MaybeCreateJob(
|
||||
net::URLRequest* request,
|
||||
net::NetworkDelegate* network_delegate) const OVERRIDE;
|
||||
virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE;
|
||||
net::NetworkDelegate* network_delegate) const override;
|
||||
bool IsSafeRedirectTarget(const GURL& location) const override;
|
||||
|
||||
private:
|
||||
const scoped_refptr<base::TaskRunner> file_task_runner_;
|
||||
|
|
|
@ -32,12 +32,12 @@ class URLRequestAsarJob : public net::URLRequestJob {
|
|||
const scoped_refptr<base::TaskRunner>& file_task_runner);
|
||||
|
||||
// net::URLRequestJob:
|
||||
virtual void Start() OVERRIDE;
|
||||
virtual void Kill() OVERRIDE;
|
||||
virtual bool ReadRawData(net::IOBuffer* buf,
|
||||
int buf_size,
|
||||
int* bytes_read) OVERRIDE;
|
||||
virtual bool GetMimeType(std::string* mime_type) const OVERRIDE;
|
||||
void Start() override;
|
||||
void Kill() override;
|
||||
bool ReadRawData(net::IOBuffer* buf,
|
||||
int buf_size,
|
||||
int* bytes_read) override;
|
||||
bool GetMimeType(std::string* mime_type) const override;
|
||||
|
||||
protected:
|
||||
virtual ~URLRequestAsarJob();
|
||||
|
|
|
@ -50,7 +50,7 @@ ProtocolHandler* AtomURLRequestJobFactory::ReplaceProtocol(
|
|||
|
||||
base::AutoLock locked(lock_);
|
||||
if (!ContainsKey(protocol_handler_map_, scheme))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
ProtocolHandler* original_protocol_handler = protocol_handler_map_[scheme];
|
||||
protocol_handler_map_[scheme] = protocol_handler;
|
||||
return original_protocol_handler;
|
||||
|
@ -63,7 +63,7 @@ ProtocolHandler* AtomURLRequestJobFactory::GetProtocolHandler(
|
|||
base::AutoLock locked(lock_);
|
||||
ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme);
|
||||
if (it == protocol_handler_map_.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return it->second;
|
||||
}
|
||||
|
||||
|
@ -82,10 +82,23 @@ net::URLRequestJob* AtomURLRequestJobFactory::MaybeCreateJobWithProtocolHandler(
|
|||
base::AutoLock locked(lock_);
|
||||
ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme);
|
||||
if (it == protocol_handler_map_.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return it->second->MaybeCreateJob(request, network_delegate);
|
||||
}
|
||||
|
||||
net::URLRequestJob* AtomURLRequestJobFactory::MaybeInterceptRedirect(
|
||||
net::URLRequest* request,
|
||||
net::NetworkDelegate* network_delegate,
|
||||
const GURL& location) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
net::URLRequestJob* AtomURLRequestJobFactory::MaybeInterceptResponse(
|
||||
net::URLRequest* request,
|
||||
net::NetworkDelegate* network_delegate) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool AtomURLRequestJobFactory::IsHandledProtocol(
|
||||
const std::string& scheme) const {
|
||||
DCHECK(CalledOnValidThread());
|
||||
|
|
|
@ -40,13 +40,20 @@ class AtomURLRequestJobFactory : public net::URLRequestJobFactory {
|
|||
bool HasProtocolHandler(const std::string& scheme) const;
|
||||
|
||||
// URLRequestJobFactory implementation
|
||||
virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler(
|
||||
net::URLRequestJob* MaybeCreateJobWithProtocolHandler(
|
||||
const std::string& scheme,
|
||||
net::URLRequest* request,
|
||||
net::NetworkDelegate* network_delegate) const OVERRIDE;
|
||||
virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE;
|
||||
virtual bool IsHandledURL(const GURL& url) const OVERRIDE;
|
||||
virtual bool IsSafeRedirectTarget(const GURL& location) const OVERRIDE;
|
||||
net::NetworkDelegate* network_delegate) const override;
|
||||
net::URLRequestJob* MaybeInterceptRedirect(
|
||||
net::URLRequest* request,
|
||||
net::NetworkDelegate* network_delegate,
|
||||
const GURL& location) const override;
|
||||
net::URLRequestJob* MaybeInterceptResponse(
|
||||
net::URLRequest* request,
|
||||
net::NetworkDelegate* network_delegate) const override;
|
||||
bool IsHandledProtocol(const std::string& scheme) const override;
|
||||
bool IsHandledURL(const GURL& url) const override;
|
||||
bool IsSafeRedirectTarget(const GURL& location) const override;
|
||||
|
||||
private:
|
||||
typedef std::map<std::string, ProtocolHandler*> ProtocolHandlerMap;
|
||||
|
|
|
@ -20,10 +20,10 @@ class URLRequestStringJob : public net::URLRequestSimpleJob {
|
|||
const std::string& data);
|
||||
|
||||
// URLRequestSimpleJob:
|
||||
virtual int GetData(std::string* mime_type,
|
||||
std::string* charset,
|
||||
std::string* data,
|
||||
const net::CompletionCallback& callback) const OVERRIDE;
|
||||
int GetData(std::string* mime_type,
|
||||
std::string* charset,
|
||||
std::string* data,
|
||||
const net::CompletionCallback& callback) const override;
|
||||
|
||||
private:
|
||||
std::string mime_type_;
|
||||
|
|
|
@ -33,12 +33,12 @@ class NodeDebugger : public net::StreamListenSocket::Delegate {
|
|||
static void DebugMessageHandler(const v8::Debug::Message& message);
|
||||
|
||||
// net::StreamListenSocket::Delegate:
|
||||
virtual void DidAccept(net::StreamListenSocket* server,
|
||||
scoped_ptr<net::StreamListenSocket> socket) OVERRIDE;
|
||||
virtual void DidRead(net::StreamListenSocket* socket,
|
||||
const char* data,
|
||||
int len) OVERRIDE;
|
||||
virtual void DidClose(net::StreamListenSocket* socket) OVERRIDE;
|
||||
void DidAccept(net::StreamListenSocket* server,
|
||||
scoped_ptr<net::StreamListenSocket> socket) override;
|
||||
void DidRead(net::StreamListenSocket* socket,
|
||||
const char* data,
|
||||
int len) override;
|
||||
void DidClose(net::StreamListenSocket* socket) override;
|
||||
|
||||
v8::Isolate* isolate_;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "atom/browser/native_window.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "chrome/browser/ui/libgtk2ui/gtk2_signal.h"
|
||||
#include "ui/aura/window.h"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#import <CoreServices/CoreServices.h>
|
||||
|
||||
#include "atom/browser/native_window.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "base/mac/scoped_cftyperef.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <shlobj.h>
|
||||
|
||||
#include "atom/browser/native_window_views.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/i18n/case_conversion.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/string_split.h"
|
||||
|
|
|
@ -22,12 +22,12 @@ class TrayIconCocoa : public TrayIcon {
|
|||
TrayIconCocoa();
|
||||
virtual ~TrayIconCocoa();
|
||||
|
||||
virtual void SetImage(const gfx::Image& image) OVERRIDE;
|
||||
virtual void SetPressedImage(const gfx::Image& image) OVERRIDE;
|
||||
virtual void SetToolTip(const std::string& tool_tip) OVERRIDE;
|
||||
virtual void SetTitle(const std::string& title) OVERRIDE;
|
||||
virtual void SetHighlightMode(bool highlight) OVERRIDE;
|
||||
virtual void SetContextMenu(ui::SimpleMenuModel* menu_model) OVERRIDE;
|
||||
void SetImage(const gfx::Image& image) override;
|
||||
void SetPressedImage(const gfx::Image& image) override;
|
||||
void SetToolTip(const std::string& tool_tip) override;
|
||||
void SetTitle(const std::string& title) override;
|
||||
void SetHighlightMode(bool highlight) override;
|
||||
void SetContextMenu(ui::SimpleMenuModel* menu_model) override;
|
||||
|
||||
private:
|
||||
base::scoped_nsobject<NSStatusItem> item_;
|
||||
|
|
|
@ -23,14 +23,14 @@ class TrayIconGtk : public TrayIcon,
|
|||
virtual ~TrayIconGtk();
|
||||
|
||||
// TrayIcon:
|
||||
virtual void SetImage(const gfx::Image& image) OVERRIDE;
|
||||
virtual void SetToolTip(const std::string& tool_tip) OVERRIDE;
|
||||
virtual void SetContextMenu(ui::SimpleMenuModel* menu_model) OVERRIDE;
|
||||
void SetImage(const gfx::Image& image) override;
|
||||
void SetToolTip(const std::string& tool_tip) override;
|
||||
void SetContextMenu(ui::SimpleMenuModel* menu_model) override;
|
||||
|
||||
private:
|
||||
// views::StatusIconLinux::Delegate:
|
||||
virtual void OnClick() OVERRIDE;
|
||||
virtual bool HasClickAction() OVERRIDE;
|
||||
void OnClick() override;
|
||||
bool HasClickAction() override;
|
||||
|
||||
scoped_ptr<views::StatusIconLinux> icon_;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ SubmenuButton::SubmenuButton(views::ButtonListener* listener,
|
|||
underline_color_(SK_ColorBLACK) {
|
||||
#if defined(OS_LINUX)
|
||||
// Dont' use native style border.
|
||||
SetBorder(CreateDefaultBorder().PassAs<views::Border>());
|
||||
SetBorder(CreateDefaultBorder().Pass());
|
||||
#endif
|
||||
|
||||
if (GetUnderlinePosition(title, &accelerator_, &underline_start_,
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "content/public/common/file_chooser_file_info.h"
|
||||
#include "ui/shell_dialogs/selected_file_info.h"
|
||||
|
||||
namespace atom {
|
||||
|
@ -26,15 +27,19 @@ WebDialogHelper::~WebDialogHelper() {
|
|||
|
||||
void WebDialogHelper::RunFileChooser(content::WebContents* web_contents,
|
||||
const content::FileChooserParams& params) {
|
||||
std::vector<ui::SelectedFileInfo> result;
|
||||
std::vector<content::FileChooserFileInfo> result;
|
||||
if (params.mode == content::FileChooserParams::Save) {
|
||||
base::FilePath path;
|
||||
if (file_dialog::ShowSaveDialog(window_,
|
||||
base::UTF16ToUTF8(params.title),
|
||||
params.default_file_name,
|
||||
file_dialog::Filters(),
|
||||
&path))
|
||||
result.push_back(ui::SelectedFileInfo(path, path));
|
||||
&path)) {
|
||||
content::FileChooserFileInfo info;
|
||||
info.file_path = path;
|
||||
info.display_name = path.BaseName().value();
|
||||
result.push_back(info);
|
||||
}
|
||||
} else {
|
||||
int flags = file_dialog::FILE_DIALOG_CREATE_DIRECTORY;
|
||||
switch (params.mode) {
|
||||
|
@ -56,9 +61,14 @@ void WebDialogHelper::RunFileChooser(content::WebContents* web_contents,
|
|||
params.default_file_name,
|
||||
file_dialog::Filters(),
|
||||
flags,
|
||||
&paths))
|
||||
for (auto& path : paths)
|
||||
result.push_back(ui::SelectedFileInfo(path, path));
|
||||
&paths)) {
|
||||
for (auto& path : paths) {
|
||||
content::FileChooserFileInfo info;
|
||||
info.file_path = path;
|
||||
info.display_name = path.BaseName().value();
|
||||
result.push_back(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
web_contents->GetRenderViewHost()->FilesSelectedInChooser(
|
||||
|
|
|
@ -58,6 +58,9 @@ void AtomBindings::BindTo(v8::Isolate* isolate,
|
|||
dict.SetMethod("activateUvLoop",
|
||||
base::Bind(&AtomBindings::ActivateUVLoop, base::Unretained(this)));
|
||||
|
||||
// Do not warn about deprecated APIs.
|
||||
dict.Set("noDeprecation", true);
|
||||
|
||||
mate::Dictionary versions;
|
||||
if (dict.Get("versions", &versions)) {
|
||||
versions.Set("atom-shell", ATOM_VERSION_STRING);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <vector>
|
||||
|
||||
#include "base/file_util.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
|
||||
namespace asar {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef ATOM_COMMON_CHROME_VERSION_H_
|
||||
#define ATOM_COMMON_CHROME_VERSION_H_
|
||||
|
||||
#define CHROME_VERSION_STRING "39.0.2171.65"
|
||||
#define CHROME_VERSION_STRING "40.0.2214.91"
|
||||
#define CHROME_VERSION "v" CHROME_VERSION_STRING
|
||||
|
||||
#endif // ATOM_COMMON_CHROME_VERSION_H_
|
||||
|
|
|
@ -25,13 +25,13 @@ class CrashReporterLinux : public CrashReporter {
|
|||
public:
|
||||
static CrashReporterLinux* GetInstance();
|
||||
|
||||
virtual void InitBreakpad(const std::string& product_name,
|
||||
const std::string& version,
|
||||
const std::string& company_name,
|
||||
const std::string& submit_url,
|
||||
bool auto_submit,
|
||||
bool skip_system_crash_handler) OVERRIDE;
|
||||
virtual void SetUploadParameters() OVERRIDE;
|
||||
void InitBreakpad(const std::string& product_name,
|
||||
const std::string& version,
|
||||
const std::string& company_name,
|
||||
const std::string& submit_url,
|
||||
bool auto_submit,
|
||||
bool skip_system_crash_handler) override;
|
||||
void SetUploadParameters() override;
|
||||
|
||||
private:
|
||||
friend struct DefaultSingletonTraits<CrashReporterLinux>;
|
||||
|
|
|
@ -19,13 +19,13 @@ class CrashReporterMac : public CrashReporter {
|
|||
public:
|
||||
static CrashReporterMac* GetInstance();
|
||||
|
||||
virtual void InitBreakpad(const std::string& product_name,
|
||||
const std::string& version,
|
||||
const std::string& company_name,
|
||||
const std::string& submit_url,
|
||||
bool auto_submit,
|
||||
bool skip_system_crash_handler) OVERRIDE;
|
||||
virtual void SetUploadParameters() OVERRIDE;
|
||||
void InitBreakpad(const std::string& product_name,
|
||||
const std::string& version,
|
||||
const std::string& company_name,
|
||||
const std::string& submit_url,
|
||||
bool auto_submit,
|
||||
bool skip_system_crash_handler) override;
|
||||
void SetUploadParameters() override;
|
||||
|
||||
private:
|
||||
friend struct DefaultSingletonTraits<CrashReporterMac>;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "base/file_util.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/singleton.h"
|
||||
#include "base/strings/string_util.h"
|
||||
|
|
|
@ -21,13 +21,13 @@ class CrashReporterWin : public CrashReporter {
|
|||
public:
|
||||
static CrashReporterWin* GetInstance();
|
||||
|
||||
virtual void InitBreakpad(const std::string& product_name,
|
||||
const std::string& version,
|
||||
const std::string& company_name,
|
||||
const std::string& submit_url,
|
||||
bool auto_submit,
|
||||
bool skip_system_crash_handler) OVERRIDE;
|
||||
virtual void SetUploadParameters() OVERRIDE;
|
||||
void InitBreakpad(const std::string& product_name,
|
||||
const std::string& version,
|
||||
const std::string& company_name,
|
||||
const std::string& submit_url,
|
||||
bool auto_submit,
|
||||
bool skip_system_crash_handler) override;
|
||||
void SetUploadParameters() override;
|
||||
|
||||
private:
|
||||
friend struct DefaultSingletonTraits<CrashReporterWin>;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <map>
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/time/time.h"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "atom/common/crash_reporter/win/crash_service.h"
|
||||
#include "base/at_exit.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string_util.h"
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "atom/common/native_mate_converters/file_path_converter.h"
|
||||
#include "base/file_util.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "ui/gfx/codec/jpeg_codec.h"
|
||||
#include "ui/gfx/codec/png_codec.h"
|
||||
|
|
|
@ -225,7 +225,7 @@ void NodeBindings::UvRunOnce() {
|
|||
v8::Context::Scope context_scope(env->context());
|
||||
|
||||
// Deal with uv events.
|
||||
int r = uv_run(uv_loop_, (uv_run_mode)(UV_RUN_ONCE | UV_RUN_NOWAIT));
|
||||
int r = uv_run(uv_loop_, UV_RUN_NOWAIT);
|
||||
if (r == 0 || uv_loop_->stop_flag != 0)
|
||||
message_loop_->QuitWhenIdle(); // Quit from uv.
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "base/file_util.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/process/kill.h"
|
||||
#include "base/process/launch.h"
|
||||
#include "url/gurl.h"
|
||||
|
|
|
@ -26,9 +26,9 @@ class AtomRenderViewObserver : public content::RenderViewObserver {
|
|||
|
||||
private:
|
||||
// content::RenderViewObserver implementation.
|
||||
virtual void DidCreateDocumentElement(blink::WebLocalFrame* frame) OVERRIDE;
|
||||
virtual void DraggableRegionsChanged(blink::WebFrame* frame) OVERRIDE;
|
||||
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
||||
void DidCreateDocumentElement(blink::WebLocalFrame* frame) override;
|
||||
void DraggableRegionsChanged(blink::WebFrame* frame) override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
void OnBrowserMessage(const base::string16& channel,
|
||||
const base::ListValue& args);
|
||||
|
|
|
@ -41,12 +41,12 @@ class GlobalShortcutListenerMac : public GlobalShortcutListener {
|
|||
bool OnMediaOrVolumeKeyEvent(int key_code);
|
||||
|
||||
// GlobalShortcutListener implementation.
|
||||
virtual void StartListening() OVERRIDE;
|
||||
virtual void StopListening() OVERRIDE;
|
||||
virtual void StartListening() override;
|
||||
virtual void StopListening() override;
|
||||
virtual bool RegisterAcceleratorImpl(
|
||||
const ui::Accelerator& accelerator) OVERRIDE;
|
||||
const ui::Accelerator& accelerator) override;
|
||||
virtual void UnregisterAcceleratorImpl(
|
||||
const ui::Accelerator& accelerator) OVERRIDE;
|
||||
const ui::Accelerator& accelerator) override;
|
||||
|
||||
// Mac-specific functions for registering hot keys with modifiers.
|
||||
bool RegisterHotKey(const ui::Accelerator& accelerator, KeyId hot_key_id);
|
||||
|
|
|
@ -26,15 +26,15 @@ class GlobalShortcutListenerWin : public GlobalShortcutListener,
|
|||
virtual void OnWndProc(HWND hwnd,
|
||||
UINT message,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam) OVERRIDE;
|
||||
LPARAM lparam) override;
|
||||
|
||||
// GlobalShortcutListener implementation.
|
||||
virtual void StartListening() OVERRIDE;
|
||||
virtual void StopListening() OVERRIDE;
|
||||
virtual void StartListening() override;
|
||||
virtual void StopListening() override;
|
||||
virtual bool RegisterAcceleratorImpl(
|
||||
const ui::Accelerator& accelerator) OVERRIDE;
|
||||
const ui::Accelerator& accelerator) override;
|
||||
virtual void UnregisterAcceleratorImpl(
|
||||
const ui::Accelerator& accelerator) OVERRIDE;
|
||||
const ui::Accelerator& accelerator) override;
|
||||
|
||||
// Whether this object is listening for global shortcuts.
|
||||
bool is_listening_;
|
||||
|
|
|
@ -23,17 +23,17 @@ class GlobalShortcutListenerX11 : public GlobalShortcutListener,
|
|||
virtual ~GlobalShortcutListenerX11();
|
||||
|
||||
// ui::PlatformEventDispatcher implementation.
|
||||
virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
|
||||
virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
|
||||
virtual bool CanDispatchEvent(const ui::PlatformEvent& event) override;
|
||||
virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) override;
|
||||
|
||||
private:
|
||||
// GlobalShortcutListener implementation.
|
||||
virtual void StartListening() OVERRIDE;
|
||||
virtual void StopListening() OVERRIDE;
|
||||
virtual void StartListening() override;
|
||||
virtual void StopListening() override;
|
||||
virtual bool RegisterAcceleratorImpl(
|
||||
const ui::Accelerator& accelerator) OVERRIDE;
|
||||
const ui::Accelerator& accelerator) override;
|
||||
virtual void UnregisterAcceleratorImpl(
|
||||
const ui::Accelerator& accelerator) OVERRIDE;
|
||||
const ui::Accelerator& accelerator) override;
|
||||
|
||||
// Invoked when a global shortcut is pressed.
|
||||
void OnXKeyPressEvent(::XEvent* x_event);
|
||||
|
|
|
@ -51,14 +51,14 @@ class PrintJob : public PrintJobWorkerOwner,
|
|||
// content::NotificationObserver implementation.
|
||||
virtual void Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE;
|
||||
const content::NotificationDetails& details) override;
|
||||
|
||||
// PrintJobWorkerOwner implementation.
|
||||
virtual void GetSettingsDone(const PrintSettings& new_settings,
|
||||
PrintingContext::Result result) OVERRIDE;
|
||||
virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) OVERRIDE;
|
||||
virtual const PrintSettings& settings() const OVERRIDE;
|
||||
virtual int cookie() const OVERRIDE;
|
||||
PrintingContext::Result result) override;
|
||||
virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) override;
|
||||
virtual const PrintSettings& settings() const override;
|
||||
virtual int cookie() const override;
|
||||
|
||||
// Starts the actual printing. Signals the worker that it should begin to
|
||||
// spool as soon as data is available.
|
||||
|
|
|
@ -66,7 +66,7 @@ class PrintJobManager : public content::NotificationObserver {
|
|||
// content::NotificationObserver
|
||||
virtual void Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE;
|
||||
const content::NotificationDetails& details) override;
|
||||
|
||||
// Returns queries queue. Never returns NULL. Must be called on Browser UI
|
||||
// Thread. Reference could be stored and used from any thread.
|
||||
|
|
|
@ -40,8 +40,8 @@ class PrintingContextDelegate : public PrintingContext::Delegate {
|
|||
PrintingContextDelegate(int render_process_id, int render_view_id);
|
||||
virtual ~PrintingContextDelegate();
|
||||
|
||||
virtual gfx::NativeView GetParentView() OVERRIDE;
|
||||
virtual std::string GetAppLocale() OVERRIDE;
|
||||
virtual gfx::NativeView GetParentView() override;
|
||||
virtual std::string GetAppLocale() override;
|
||||
|
||||
private:
|
||||
int render_process_id_;
|
||||
|
|
|
@ -144,7 +144,7 @@ void PrintViewManagerBase::OnDidPrintPage(
|
|||
#if !defined(OS_WIN)
|
||||
// Update the rendered document. It will send notifications to the listener.
|
||||
document->SetPage(params.page_number,
|
||||
metafile.PassAs<MetafilePlayer>(),
|
||||
metafile.Pass(),
|
||||
params.page_size,
|
||||
params.content_area);
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
|||
#endif // !DISABLE_BASIC_PRINTING
|
||||
|
||||
// PrintedPagesSource implementation.
|
||||
virtual base::string16 RenderSourceName() OVERRIDE;
|
||||
virtual base::string16 RenderSourceName() override;
|
||||
|
||||
protected:
|
||||
explicit PrintViewManagerBase(content::WebContents* web_contents);
|
||||
|
@ -52,10 +52,10 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
|||
bool PrintNowInternal(IPC::Message* message);
|
||||
|
||||
// Terminates or cancels the print job if one was pending.
|
||||
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
|
||||
virtual void RenderProcessGone(base::TerminationStatus status) override;
|
||||
|
||||
// content::WebContentsObserver implementation.
|
||||
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
||||
virtual bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
// IPC Message handlers.
|
||||
virtual void OnPrintingFailed(int cookie);
|
||||
|
@ -64,10 +64,10 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
|||
// content::NotificationObserver implementation.
|
||||
virtual void Observe(int type,
|
||||
const content::NotificationSource& source,
|
||||
const content::NotificationDetails& details) OVERRIDE;
|
||||
const content::NotificationDetails& details) override;
|
||||
|
||||
// Cancels the print job.
|
||||
virtual void NavigationStopped() OVERRIDE;
|
||||
virtual void NavigationStopped() override;
|
||||
|
||||
// IPC Message handlers.
|
||||
void OnDidGetPrintedPagesCount(int cookie, int number_pages);
|
||||
|
|
|
@ -32,10 +32,10 @@ class PrintViewManagerBasic
|
|||
|
||||
// content::WebContentsObserver implementation.
|
||||
// Terminates or cancels the print job if one was pending.
|
||||
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
|
||||
virtual void RenderProcessGone(base::TerminationStatus status) override;
|
||||
|
||||
// content::WebContentsObserver implementation.
|
||||
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
||||
virtual bool OnMessageReceived(const IPC::Message& message) override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
@ -43,7 +43,7 @@ class PrintViewManagerBasic
|
|||
friend class content::WebContentsUserData<PrintViewManagerBasic>;
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
virtual void OnPrintingFailed(int cookie) OVERRIDE;
|
||||
virtual void OnPrintingFailed(int cookie) override;
|
||||
|
||||
// The file descriptor into which the PDF of the page will be written.
|
||||
base::FileDescriptor file_descriptor_;
|
||||
|
|
|
@ -33,10 +33,10 @@ class PrinterQuery : public PrintJobWorkerOwner {
|
|||
|
||||
// PrintJobWorkerOwner implementation.
|
||||
virtual void GetSettingsDone(const PrintSettings& new_settings,
|
||||
PrintingContext::Result result) OVERRIDE;
|
||||
virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) OVERRIDE;
|
||||
virtual const PrintSettings& settings() const OVERRIDE;
|
||||
virtual int cookie() const OVERRIDE;
|
||||
PrintingContext::Result result) override;
|
||||
virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) override;
|
||||
virtual const PrintSettings& settings() const override;
|
||||
virtual int cookie() const override;
|
||||
|
||||
// Initializes the printing context. It is fine to call this function multiple
|
||||
// times to reinitialize the settings. |web_contents_observer| can be queried
|
||||
|
|
|
@ -40,10 +40,10 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {
|
|||
PrintingMessageFilter(int render_process_id);
|
||||
|
||||
// content::BrowserMessageFilter methods.
|
||||
virtual void OverrideThreadForMessage(
|
||||
void OverrideThreadForMessage(
|
||||
const IPC::Message& message,
|
||||
content::BrowserThread::ID* thread) OVERRIDE;
|
||||
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
||||
content::BrowserThread::ID* thread) override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
private:
|
||||
virtual ~PrintingMessageFilter();
|
||||
|
|
|
@ -29,26 +29,26 @@ class TtsControllerImpl : public TtsController {
|
|||
static TtsControllerImpl* GetInstance();
|
||||
|
||||
// TtsController methods
|
||||
virtual bool IsSpeaking() OVERRIDE;
|
||||
virtual void SpeakOrEnqueue(Utterance* utterance) OVERRIDE;
|
||||
virtual void Stop() OVERRIDE;
|
||||
virtual void Pause() OVERRIDE;
|
||||
virtual void Resume() OVERRIDE;
|
||||
virtual bool IsSpeaking() override;
|
||||
virtual void SpeakOrEnqueue(Utterance* utterance) override;
|
||||
virtual void Stop() override;
|
||||
virtual void Pause() override;
|
||||
virtual void Resume() override;
|
||||
virtual void OnTtsEvent(int utterance_id,
|
||||
TtsEventType event_type,
|
||||
int char_index,
|
||||
const std::string& error_message) OVERRIDE;
|
||||
const std::string& error_message) override;
|
||||
virtual void GetVoices(content::BrowserContext* browser_context,
|
||||
std::vector<VoiceData>* out_voices) OVERRIDE;
|
||||
virtual void VoicesChanged() OVERRIDE;
|
||||
std::vector<VoiceData>* out_voices) override;
|
||||
virtual void VoicesChanged() override;
|
||||
virtual void AddVoicesChangedDelegate(
|
||||
VoicesChangedDelegate* delegate) OVERRIDE;
|
||||
VoicesChangedDelegate* delegate) override;
|
||||
virtual void RemoveVoicesChangedDelegate(
|
||||
VoicesChangedDelegate* delegate) OVERRIDE;
|
||||
virtual void SetTtsEngineDelegate(TtsEngineDelegate* delegate) OVERRIDE;
|
||||
virtual TtsEngineDelegate* GetTtsEngineDelegate() OVERRIDE;
|
||||
virtual void SetPlatformImpl(TtsPlatformImpl* platform_impl) OVERRIDE;
|
||||
virtual int QueueSize() OVERRIDE;
|
||||
VoicesChangedDelegate* delegate) override;
|
||||
virtual void SetTtsEngineDelegate(TtsEngineDelegate* delegate) override;
|
||||
virtual TtsEngineDelegate* GetTtsEngineDelegate() override;
|
||||
virtual void SetPlatformImpl(TtsPlatformImpl* platform_impl) override;
|
||||
virtual int QueueSize() override;
|
||||
|
||||
protected:
|
||||
TtsControllerImpl();
|
||||
|
|
|
@ -32,18 +32,18 @@ struct SPDChromeVoice {
|
|||
|
||||
class TtsPlatformImplLinux : public TtsPlatformImpl {
|
||||
public:
|
||||
virtual bool PlatformImplAvailable() OVERRIDE;
|
||||
virtual bool PlatformImplAvailable() override;
|
||||
virtual bool Speak(
|
||||
int utterance_id,
|
||||
const std::string& utterance,
|
||||
const std::string& lang,
|
||||
const VoiceData& voice,
|
||||
const UtteranceContinuousParameters& params) OVERRIDE;
|
||||
virtual bool StopSpeaking() OVERRIDE;
|
||||
virtual void Pause() OVERRIDE;
|
||||
virtual void Resume() OVERRIDE;
|
||||
virtual bool IsSpeaking() OVERRIDE;
|
||||
virtual void GetVoices(std::vector<VoiceData>* out_voices) OVERRIDE;
|
||||
const UtteranceContinuousParameters& params) override;
|
||||
virtual bool StopSpeaking() override;
|
||||
virtual void Pause() override;
|
||||
virtual void Resume() override;
|
||||
virtual bool IsSpeaking() override;
|
||||
virtual void GetVoices(std::vector<VoiceData>* out_voices) override;
|
||||
|
||||
void OnSpeechEvent(SPDNotificationType type);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class TtsPlatformImplMac;
|
|||
|
||||
class TtsPlatformImplMac : public TtsPlatformImpl {
|
||||
public:
|
||||
virtual bool PlatformImplAvailable() OVERRIDE {
|
||||
virtual bool PlatformImplAvailable() override {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -58,17 +58,17 @@ class TtsPlatformImplMac : public TtsPlatformImpl {
|
|||
const std::string& utterance,
|
||||
const std::string& lang,
|
||||
const VoiceData& voice,
|
||||
const UtteranceContinuousParameters& params) OVERRIDE;
|
||||
const UtteranceContinuousParameters& params) override;
|
||||
|
||||
virtual bool StopSpeaking() OVERRIDE;
|
||||
virtual bool StopSpeaking() override;
|
||||
|
||||
virtual void Pause() OVERRIDE;
|
||||
virtual void Pause() override;
|
||||
|
||||
virtual void Resume() OVERRIDE;
|
||||
virtual void Resume() override;
|
||||
|
||||
virtual bool IsSpeaking() OVERRIDE;
|
||||
virtual bool IsSpeaking() override;
|
||||
|
||||
virtual void GetVoices(std::vector<VoiceData>* out_voices) OVERRIDE;
|
||||
virtual void GetVoices(std::vector<VoiceData>* out_voices) override;
|
||||
|
||||
// Called by ChromeTtsDelegate when we get a callback from the
|
||||
// native speech engine.
|
||||
|
|
|
@ -23,21 +23,21 @@ class TtsMessageFilter
|
|||
content::BrowserContext* browser_context);
|
||||
|
||||
// content::BrowserMessageFilter implementation.
|
||||
virtual void OverrideThreadForMessage(
|
||||
void OverrideThreadForMessage(
|
||||
const IPC::Message& message,
|
||||
content::BrowserThread::ID* thread) OVERRIDE;
|
||||
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
||||
virtual void OnChannelClosing() OVERRIDE;
|
||||
virtual void OnDestruct() const OVERRIDE;
|
||||
content::BrowserThread::ID* thread) override;
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
void OnChannelClosing() override;
|
||||
void OnDestruct() const override;
|
||||
|
||||
// UtteranceEventDelegate implementation.
|
||||
virtual void OnTtsEvent(Utterance* utterance,
|
||||
TtsEventType event_type,
|
||||
int char_index,
|
||||
const std::string& error_message) OVERRIDE;
|
||||
void OnTtsEvent(Utterance* utterance,
|
||||
TtsEventType event_type,
|
||||
int char_index,
|
||||
const std::string& error_message) override;
|
||||
|
||||
// VoicesChangedDelegate implementation.
|
||||
virtual void OnVoicesChanged() OVERRIDE;
|
||||
void OnVoicesChanged() override;
|
||||
|
||||
private:
|
||||
friend class content::BrowserThread;
|
||||
|
@ -61,4 +61,4 @@ class TtsMessageFilter
|
|||
DISALLOW_COPY_AND_ASSIGN(TtsMessageFilter);
|
||||
};
|
||||
|
||||
#endif // CHROME_BROWSER_SPEECH_TTS_MESSAGE_FILTER_H_
|
||||
#endif // CHROME_BROWSER_SPEECH_TTS_MESSAGE_FILTER_H_
|
||||
|
|
|
@ -34,7 +34,7 @@ class TtsPlatformImplWin : public TtsPlatformImpl {
|
|||
|
||||
virtual bool IsSpeaking();
|
||||
|
||||
virtual void GetVoices(std::vector<VoiceData>* out_voices) OVERRIDE;
|
||||
virtual void GetVoices(std::vector<VoiceData>* out_voices) override;
|
||||
|
||||
// Get the single instance of this class.
|
||||
static TtsPlatformImplWin* GetInstance();
|
||||
|
|
|
@ -45,8 +45,8 @@ class ColorChooserMac : public content::ColorChooser {
|
|||
void DidChooseColorInColorPanel(SkColor color);
|
||||
void DidCloseColorPabel();
|
||||
|
||||
virtual void End() OVERRIDE;
|
||||
virtual void SetSelectedColor(SkColor color) OVERRIDE;
|
||||
virtual void End() override;
|
||||
virtual void SetSelectedColor(SkColor color) override;
|
||||
|
||||
private:
|
||||
static ColorChooserMac* current_color_chooser_;
|
||||
|
|
|
@ -31,12 +31,12 @@ class ColorChooserAura : public content::ColorChooser,
|
|||
ColorChooserAura(content::WebContents* web_contents, SkColor initial_color);
|
||||
|
||||
// content::ColorChooser overrides:
|
||||
virtual void End() OVERRIDE;
|
||||
virtual void SetSelectedColor(SkColor color) OVERRIDE;
|
||||
virtual void End() override;
|
||||
virtual void SetSelectedColor(SkColor color) override;
|
||||
|
||||
// views::ColorChooserListener overrides:
|
||||
virtual void OnColorChosen(SkColor color) OVERRIDE;
|
||||
virtual void OnColorChooserDialogClosed() OVERRIDE;
|
||||
virtual void OnColorChosen(SkColor color) override;
|
||||
virtual void OnColorChooserDialogClosed() override;
|
||||
|
||||
void DidEndColorChooser();
|
||||
|
||||
|
|
|
@ -26,8 +26,8 @@ class ColorChooserDialog
|
|||
virtual ~ColorChooserDialog();
|
||||
|
||||
// BaseShellDialog:
|
||||
virtual bool IsRunning(gfx::NativeWindow owning_window) const OVERRIDE;
|
||||
virtual void ListenerDestroyed() OVERRIDE;
|
||||
virtual bool IsRunning(gfx::NativeWindow owning_window) const override;
|
||||
virtual void ListenerDestroyed() override;
|
||||
|
||||
private:
|
||||
struct ExecuteOpenParams {
|
||||
|
|
|
@ -24,8 +24,8 @@ class ColorChooserWin : public content::ColorChooser,
|
|||
~ColorChooserWin();
|
||||
|
||||
// content::ColorChooser overrides:
|
||||
virtual void End() OVERRIDE;
|
||||
virtual void SetSelectedColor(SkColor color) OVERRIDE {}
|
||||
virtual void End() override;
|
||||
virtual void SetSelectedColor(SkColor color) override {}
|
||||
|
||||
// views::ColorChooserListener overrides:
|
||||
virtual void OnColorChosen(SkColor color);
|
||||
|
|
|
@ -79,9 +79,9 @@ class PrintWebViewHelper
|
|||
};
|
||||
|
||||
// RenderViewObserver implementation.
|
||||
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
|
||||
virtual bool OnMessageReceived(const IPC::Message& message) override;
|
||||
virtual void PrintPage(blink::WebLocalFrame* frame,
|
||||
bool user_initiated) OVERRIDE;
|
||||
bool user_initiated) override;
|
||||
|
||||
// Message handlers ---------------------------------------------------------
|
||||
#if !defined(DISABLE_BASIC_PRINTING)
|
||||
|
|
|
@ -37,15 +37,15 @@ class TtsDispatcher
|
|||
virtual ~TtsDispatcher();
|
||||
|
||||
// RenderProcessObserver override.
|
||||
virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
|
||||
virtual bool OnControlMessageReceived(const IPC::Message& message) override;
|
||||
|
||||
// blink::WebSpeechSynthesizer implementation.
|
||||
virtual void updateVoiceList() OVERRIDE;
|
||||
virtual void updateVoiceList() override;
|
||||
virtual void speak(const blink::WebSpeechSynthesisUtterance& utterance)
|
||||
OVERRIDE;
|
||||
virtual void pause() OVERRIDE;
|
||||
virtual void resume() OVERRIDE;
|
||||
virtual void cancel() OVERRIDE;
|
||||
override;
|
||||
virtual void pause() override;
|
||||
virtual void resume() override;
|
||||
virtual void cancel() override;
|
||||
|
||||
blink::WebSpeechSynthesisUtterance FindUtterance(int utterance_id);
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
],
|
||||
|
||||
"devDependencies": {
|
||||
"atom-package-manager": "0.122.0",
|
||||
"atom-package-manager": "0.126.0",
|
||||
"coffee-script": "~1.7.1",
|
||||
"coffeelint": "~1.3.0",
|
||||
"request": "*"
|
||||
|
|
|
@ -6,12 +6,11 @@ import re
|
|||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tarfile
|
||||
|
||||
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, TARGET_PLATFORM, \
|
||||
DIST_ARCH
|
||||
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
|
||||
safe_mkdir, execute, get_chromedriver_version
|
||||
execute, get_chromedriver_version
|
||||
|
||||
|
||||
ATOM_SHELL_VERSION = get_atom_shell_version()
|
||||
|
@ -19,9 +18,6 @@ ATOM_SHELL_VERSION = get_atom_shell_version()
|
|||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
|
||||
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release')
|
||||
NODE_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'node')
|
||||
DIST_HEADERS_NAME = 'node-{0}'.format(ATOM_SHELL_VERSION)
|
||||
DIST_HEADERS_DIR = os.path.join(DIST_DIR, DIST_HEADERS_NAME)
|
||||
|
||||
SYMBOL_NAME = {
|
||||
'darwin': 'libchromiumcontent.dylib.dSYM',
|
||||
|
@ -76,23 +72,6 @@ SYSTEM_LIBRARIES = [
|
|||
'libnotify.so',
|
||||
]
|
||||
|
||||
HEADERS_SUFFIX = [
|
||||
'.h',
|
||||
'.gypi',
|
||||
]
|
||||
HEADERS_DIRS = [
|
||||
'src',
|
||||
'deps/http_parser',
|
||||
'deps/zlib',
|
||||
'deps/uv',
|
||||
'deps/npm',
|
||||
'deps/mdb_v8',
|
||||
]
|
||||
HEADERS_FILES = [
|
||||
'common.gypi',
|
||||
'config.gypi',
|
||||
]
|
||||
|
||||
|
||||
def main():
|
||||
rm_rf(DIST_DIR)
|
||||
|
@ -105,7 +84,6 @@ def main():
|
|||
create_symbols()
|
||||
copy_binaries()
|
||||
copy_chromedriver()
|
||||
copy_headers()
|
||||
copy_license()
|
||||
|
||||
if TARGET_PLATFORM == 'linux':
|
||||
|
@ -115,7 +93,6 @@ def main():
|
|||
create_dist_zip()
|
||||
create_chromedriver_zip()
|
||||
create_symbols_zip()
|
||||
create_header_tarball()
|
||||
|
||||
|
||||
def parse_args():
|
||||
|
@ -153,33 +130,6 @@ def copy_chromedriver():
|
|||
shutil.copy2(os.path.join(OUT_DIR, binary), DIST_DIR)
|
||||
|
||||
|
||||
def copy_headers():
|
||||
os.mkdir(DIST_HEADERS_DIR)
|
||||
# Copy standard node headers from node. repository.
|
||||
for include_path in HEADERS_DIRS:
|
||||
abs_path = os.path.join(NODE_DIR, include_path)
|
||||
for dirpath, _, filenames in os.walk(abs_path):
|
||||
for filename in filenames:
|
||||
extension = os.path.splitext(filename)[1]
|
||||
if extension not in HEADERS_SUFFIX:
|
||||
continue
|
||||
copy_source_file(os.path.join(dirpath, filename))
|
||||
for other_file in HEADERS_FILES:
|
||||
copy_source_file(source = os.path.join(NODE_DIR, other_file))
|
||||
|
||||
# Copy V8 headers from chromium's repository.
|
||||
src = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download',
|
||||
'libchromiumcontent', 'src')
|
||||
for dirpath, _, filenames in os.walk(os.path.join(src, 'v8')):
|
||||
for filename in filenames:
|
||||
extension = os.path.splitext(filename)[1]
|
||||
if extension not in HEADERS_SUFFIX:
|
||||
continue
|
||||
copy_source_file(source=os.path.join(dirpath, filename),
|
||||
start=src,
|
||||
destination=os.path.join(DIST_HEADERS_DIR, 'deps'))
|
||||
|
||||
|
||||
def copy_license():
|
||||
shutil.copy2(os.path.join(SOURCE_ROOT, 'LICENSE'), DIST_DIR)
|
||||
|
||||
|
@ -269,19 +219,5 @@ def create_symbols_zip():
|
|||
make_zip(zip_file, files, dirs)
|
||||
|
||||
|
||||
def create_header_tarball():
|
||||
with scoped_cwd(DIST_DIR):
|
||||
tarball = tarfile.open(name=DIST_HEADERS_DIR + '.tar.gz', mode='w:gz')
|
||||
tarball.add(DIST_HEADERS_NAME)
|
||||
tarball.close()
|
||||
|
||||
|
||||
def copy_source_file(source, start=NODE_DIR, destination=DIST_HEADERS_DIR):
|
||||
relative = os.path.relpath(source, start=start)
|
||||
final_destination = os.path.join(destination, relative)
|
||||
safe_mkdir(os.path.dirname(final_destination))
|
||||
shutil.copy2(source, final_destination)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
|
|
@ -4,7 +4,7 @@ import platform
|
|||
import sys
|
||||
|
||||
BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
|
||||
LIBCHROMIUMCONTENT_COMMIT = '6300862b4b16bd171f00ae566b697098c29743f7'
|
||||
LIBCHROMIUMCONTENT_COMMIT = '103778aa0ec3772f88e915ca9efdb941afdc85cf'
|
||||
|
||||
ARCH = {
|
||||
'cygwin': '32bit',
|
||||
|
|
147
script/upload-node-headers.py
Executable file
147
script/upload-node-headers.py
Executable file
|
@ -0,0 +1,147 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
import glob
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import tarfile
|
||||
|
||||
from lib.config import TARGET_PLATFORM
|
||||
from lib.util import execute, safe_mkdir, scoped_cwd, s3_config, s3put
|
||||
|
||||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
DIST_DIR = os.path.join(SOURCE_ROOT, 'dist')
|
||||
NODE_DIR = os.path.join(SOURCE_ROOT, 'vendor', 'node')
|
||||
OUT_DIR = os.path.join(SOURCE_ROOT, 'out', 'Release')
|
||||
|
||||
HEADERS_SUFFIX = [
|
||||
'.h',
|
||||
'.gypi',
|
||||
]
|
||||
HEADERS_DIRS = [
|
||||
'src',
|
||||
'deps/http_parser',
|
||||
'deps/zlib',
|
||||
'deps/uv',
|
||||
'deps/npm',
|
||||
'deps/mdb_v8',
|
||||
]
|
||||
HEADERS_FILES = [
|
||||
'common.gypi',
|
||||
'config.gypi',
|
||||
]
|
||||
|
||||
|
||||
def main():
|
||||
safe_mkdir(DIST_DIR)
|
||||
|
||||
args = parse_args()
|
||||
dist_headers_dir = os.path.join(DIST_DIR, 'node-{0}'.format(args.version))
|
||||
|
||||
copy_headers(dist_headers_dir)
|
||||
create_header_tarball(dist_headers_dir)
|
||||
|
||||
# Upload node's headers to S3.
|
||||
bucket, access_key, secret_key = s3_config()
|
||||
upload_node(bucket, access_key, secret_key, args.version)
|
||||
|
||||
# Upload the SHASUMS.txt.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'),
|
||||
'-v', args.version])
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser(description='upload sumsha file')
|
||||
parser.add_argument('-v', '--version', help='Specify the version',
|
||||
required=True)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def copy_headers(dist_headers_dir):
|
||||
safe_mkdir(dist_headers_dir)
|
||||
|
||||
# Copy standard node headers from node. repository.
|
||||
for include_path in HEADERS_DIRS:
|
||||
abs_path = os.path.join(NODE_DIR, include_path)
|
||||
for dirpath, _, filenames in os.walk(abs_path):
|
||||
for filename in filenames:
|
||||
extension = os.path.splitext(filename)[1]
|
||||
if extension not in HEADERS_SUFFIX:
|
||||
continue
|
||||
copy_source_file(os.path.join(dirpath, filename), NODE_DIR,
|
||||
dist_headers_dir)
|
||||
for other_file in HEADERS_FILES:
|
||||
copy_source_file(os.path.join(NODE_DIR, other_file), NODE_DIR,
|
||||
dist_headers_dir)
|
||||
|
||||
# Copy V8 headers from chromium's repository.
|
||||
src = os.path.join(SOURCE_ROOT, 'vendor', 'brightray', 'vendor', 'download',
|
||||
'libchromiumcontent', 'src')
|
||||
for dirpath, _, filenames in os.walk(os.path.join(src, 'v8')):
|
||||
for filename in filenames:
|
||||
extension = os.path.splitext(filename)[1]
|
||||
if extension not in HEADERS_SUFFIX:
|
||||
continue
|
||||
copy_source_file(os.path.join(dirpath, filename), src,
|
||||
os.path.join(dist_headers_dir, 'deps'))
|
||||
|
||||
|
||||
def create_header_tarball(dist_headers_dir):
|
||||
target = dist_headers_dir + '.tar.gz'
|
||||
with scoped_cwd(DIST_DIR):
|
||||
tarball = tarfile.open(name=target, mode='w:gz')
|
||||
tarball.add(os.path.relpath(dist_headers_dir))
|
||||
tarball.close()
|
||||
|
||||
|
||||
def copy_source_file(source, start, destination):
|
||||
relative = os.path.relpath(source, start=start)
|
||||
final_destination = os.path.join(destination, relative)
|
||||
safe_mkdir(os.path.dirname(final_destination))
|
||||
shutil.copy2(source, final_destination)
|
||||
|
||||
|
||||
def upload_node(bucket, access_key, secret_key, version):
|
||||
with scoped_cwd(DIST_DIR):
|
||||
s3put(bucket, access_key, secret_key, DIST_DIR,
|
||||
'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))
|
||||
|
||||
if TARGET_PLATFORM == 'win32':
|
||||
# Generate the node.lib.
|
||||
build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
|
||||
execute([sys.executable, build, '-c', 'Release', '-t', 'generate_node_lib'])
|
||||
|
||||
# Upload the 32bit node.lib.
|
||||
node_lib = os.path.join(OUT_DIR, 'node.lib')
|
||||
s3put(bucket, access_key, secret_key, OUT_DIR,
|
||||
'atom-shell/dist/{0}'.format(version), [node_lib])
|
||||
|
||||
# Upload the fake 64bit node.lib.
|
||||
touch_x64_node_lib()
|
||||
node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
|
||||
s3put(bucket, access_key, secret_key, OUT_DIR,
|
||||
'atom-shell/dist/{0}'.format(version), [node_lib])
|
||||
|
||||
# Upload the index.json
|
||||
with scoped_cwd(SOURCE_ROOT):
|
||||
atom_shell = os.path.join(OUT_DIR, 'atom.exe')
|
||||
index_json = os.path.relpath(os.path.join(OUT_DIR, 'index.json'))
|
||||
execute([atom_shell,
|
||||
os.path.join('script', 'dump-version-info.js'),
|
||||
index_json])
|
||||
s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
|
||||
[index_json])
|
||||
|
||||
|
||||
def touch_x64_node_lib():
|
||||
x64_dir = os.path.join(OUT_DIR, 'x64')
|
||||
safe_mkdir(x64_dir)
|
||||
with open(os.path.join(x64_dir, 'node.lib'), 'w+') as node_lib:
|
||||
node_lib.write('Invalid library')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
import argparse
|
||||
import errno
|
||||
import glob
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
@ -10,8 +9,7 @@ import tempfile
|
|||
|
||||
from lib.config import DIST_ARCH, TARGET_PLATFORM
|
||||
from lib.util import execute, get_atom_shell_version, parse_version, \
|
||||
get_chromedriver_version, scoped_cwd, safe_mkdir, \
|
||||
s3_config, s3put
|
||||
get_chromedriver_version, scoped_cwd
|
||||
from lib.github import GitHub
|
||||
|
||||
|
||||
|
@ -60,20 +58,16 @@ def main():
|
|||
os.path.join(DIST_DIR, CHROMEDRIVER_NAME))
|
||||
|
||||
if args.publish_release:
|
||||
# Upload node's headers to S3.
|
||||
bucket, access_key, secret_key = s3_config()
|
||||
upload_node(bucket, access_key, secret_key, ATOM_SHELL_VERSION)
|
||||
|
||||
# Upload the SHASUMS.txt.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-checksums.py'),
|
||||
'-v', ATOM_SHELL_VERSION])
|
||||
|
||||
# Upload PDBs to Windows symbol server.
|
||||
if TARGET_PLATFORM == 'win32':
|
||||
# Upload PDBs to Windows symbol server.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-windows-pdb.py')])
|
||||
|
||||
# Upload node headers.
|
||||
execute([sys.executable,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'upload-node-headers.py'),
|
||||
'-v', ATOM_SHELL_VERSION])
|
||||
|
||||
# Press the publish button.
|
||||
publish_release(github, release_id)
|
||||
|
||||
|
@ -168,38 +162,6 @@ def publish_release(github, release_id):
|
|||
github.repos(ATOM_SHELL_REPO).releases(release_id).patch(data=data)
|
||||
|
||||
|
||||
def upload_node(bucket, access_key, secret_key, version):
|
||||
os.chdir(DIST_DIR)
|
||||
|
||||
s3put(bucket, access_key, secret_key, DIST_DIR,
|
||||
'atom-shell/dist/{0}'.format(version), glob.glob('node-*.tar.gz'))
|
||||
|
||||
if TARGET_PLATFORM == 'win32':
|
||||
# Generate the node.lib.
|
||||
build = os.path.join(SOURCE_ROOT, 'script', 'build.py')
|
||||
execute([sys.executable, build, '-c', 'Release', '-t', 'generate_node_lib'])
|
||||
|
||||
# Upload the 32bit node.lib.
|
||||
node_lib = os.path.join(OUT_DIR, 'node.lib')
|
||||
s3put(bucket, access_key, secret_key, OUT_DIR,
|
||||
'atom-shell/dist/{0}'.format(version), [node_lib])
|
||||
|
||||
# Upload the fake 64bit node.lib.
|
||||
touch_x64_node_lib()
|
||||
node_lib = os.path.join(OUT_DIR, 'x64', 'node.lib')
|
||||
s3put(bucket, access_key, secret_key, OUT_DIR,
|
||||
'atom-shell/dist/{0}'.format(version), [node_lib])
|
||||
|
||||
# Upload the index.json
|
||||
atom_shell = os.path.join(OUT_DIR, 'atom.exe')
|
||||
index_json = os.path.join(OUT_DIR, 'index.json')
|
||||
execute([atom_shell,
|
||||
os.path.join(SOURCE_ROOT, 'script', 'dump-version-info.js'),
|
||||
index_json])
|
||||
s3put(bucket, access_key, secret_key, OUT_DIR, 'atom-shell/dist',
|
||||
[index_json])
|
||||
|
||||
|
||||
def auth_token():
|
||||
token = os.environ.get('ATOM_SHELL_GITHUB_TOKEN')
|
||||
message = ('Error: Please set the $ATOM_SHELL_GITHUB_TOKEN '
|
||||
|
@ -208,13 +170,6 @@ def auth_token():
|
|||
return token
|
||||
|
||||
|
||||
def touch_x64_node_lib():
|
||||
x64_dir = os.path.join(OUT_DIR, 'x64')
|
||||
safe_mkdir(x64_dir)
|
||||
with open(os.path.join(x64_dir, 'node.lib'), 'w+') as node_lib:
|
||||
node_lib.write('Invalid library')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
sys.exit(main())
|
||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
|||
Subproject commit a45009446ac3279b385b1de1f3226251e7f0e634
|
||||
Subproject commit c96ee1ee1e2d1322c4d73be18f28c232587a43a2
|
2
vendor/node
vendored
2
vendor/node
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 296b2c198be867ed89144acb20bd3570ce375cf5
|
||||
Subproject commit 70498428ced2b8ae4ce020051f06d104b5c6c4de
|
Loading…
Reference in a new issue