From 33f0b2ad895d662ee5bccb6f84680e2585c9b3b8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 4 Mar 2015 18:15:08 -0800 Subject: [PATCH 01/16] Upgrade to Chrome 41 --- brightray/vendor/libchromiumcontent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index 3f108160eded..531d92bd1c52 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 3f108160eded696b3e843c2fbb4e5e2ac696555e +Subproject commit 531d92bd1c52e54376b09ee20e128a5e284cceb2 From c0356f0269486d1df60b75d81af064d3773e0b56 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 19:02:38 -0700 Subject: [PATCH 02/16] Fix ui/gfx/geometry headers --- brightray/browser/devtools_contents_resizing_strategy.h | 6 +++--- brightray/browser/devtools_embedder_message_dispatcher.h | 6 +++--- brightray/browser/inspectable_web_contents_impl.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/brightray/browser/devtools_contents_resizing_strategy.h b/brightray/browser/devtools_contents_resizing_strategy.h index 806d78a7156f..9c82c060b1e7 100644 --- a/brightray/browser/devtools_contents_resizing_strategy.h +++ b/brightray/browser/devtools_contents_resizing_strategy.h @@ -6,9 +6,9 @@ #define BRIGHTRAY_BROWSER_DEVTOOLS_CONTENTS_RESIZING_STRATEGY_H_ #include "base/basictypes.h" -#include "ui/gfx/insets.h" -#include "ui/gfx/rect.h" -#include "ui/gfx/size.h" +#include "ui/gfx/geometry/insets.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/gfx/geometry/size.h" // This class knows how to resize both DevTools and inspected WebContents // inside a browser window hierarchy. diff --git a/brightray/browser/devtools_embedder_message_dispatcher.h b/brightray/browser/devtools_embedder_message_dispatcher.h index 1b0bf9e3a022..defe16c1f43a 100644 --- a/brightray/browser/devtools_embedder_message_dispatcher.h +++ b/brightray/browser/devtools_embedder_message_dispatcher.h @@ -9,9 +9,9 @@ #include #include "base/callback.h" -#include "ui/gfx/insets.h" -#include "ui/gfx/rect.h" -#include "ui/gfx/size.h" +#include "ui/gfx/geometry/insets.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/gfx/geometry/size.h" namespace base { class ListValue; diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 9c80be071d64..075ee320d9e5 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -15,7 +15,7 @@ #include "content/public/browser/devtools_frontend_host.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" -#include "ui/gfx/rect.h" +#include "ui/gfx/geometry/rect.h" class PrefRegistrySimple; From 8467fee8d8e2a235d2604c6e6d20497e550c3338 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 19:07:53 -0700 Subject: [PATCH 03/16] Fix devtools_manager_delegate.cc --- brightray/browser/devtools_manager_delegate.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/brightray/browser/devtools_manager_delegate.cc b/brightray/browser/devtools_manager_delegate.cc index 2165b9c8524b..014a3d825c49 100644 --- a/brightray/browser/devtools_manager_delegate.cc +++ b/brightray/browser/devtools_manager_delegate.cc @@ -24,6 +24,7 @@ #include "content/public/common/url_constants.h" #include "content/public/common/user_agent.h" #include "net/socket/tcp_server_socket.h" +#include "net/socket/stream_socket.h" #include "ui/base/resource/resource_bundle.h" using content::DevToolsAgentHost; @@ -65,7 +66,7 @@ class TCPServerSocketFactory scoped_ptr CreateSocketFactory() { - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + auto& command_line = *base::CommandLine::ForCurrentProcess(); // See if the user specified a port on the command line (useful for // automation). If not, use an ephemeral port by specifying 0. int port = 0; @@ -151,8 +152,7 @@ class DevToolsDelegate : public content::DevToolsHttpHandlerDelegate { std::string GetDiscoveryPageHTML() override; bool BundlesFrontendResources() override; base::FilePath GetDebugFrontendDir() override; - scoped_ptr CreateSocketForTethering( - net::StreamListenSocket::Delegate* delegate, + scoped_ptr CreateSocketForTethering( std::string* name) override; private: @@ -178,11 +178,9 @@ base::FilePath DevToolsDelegate::GetDebugFrontendDir() { return base::FilePath(); } -scoped_ptr -DevToolsDelegate::CreateSocketForTethering( - net::StreamListenSocket::Delegate* delegate, +scoped_ptr DevToolsDelegate::CreateSocketForTethering( std::string* name) { - return scoped_ptr(); + return scoped_ptr(); } } // namespace From 99e2dbd6e88624e3b6b66c34b6664ecdaa3c8df4 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 19:13:17 -0700 Subject: [PATCH 04/16] Fix inspectable_web_contents_impl.h --- brightray/browser/inspectable_web_contents_impl.cc | 10 ++++++---- brightray/browser/inspectable_web_contents_impl.h | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 4fae3a1ae12e..0e09fba1a3fa 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -317,10 +317,11 @@ void InspectableWebContentsImpl::AgentHostClosed( content::DevToolsAgentHost* agent_host, bool replaced) { } -void InspectableWebContentsImpl::AboutToNavigateRenderView( - content::RenderViewHost* render_view_host) { - frontend_host_.reset(content::DevToolsFrontendHost::Create( - render_view_host, this)); +void InspectableWebContentsImpl::AboutToNavigateRenderFrame( + content::RenderFrameHost* new_host) { + if (new_host->GetParent()) + return; + frontend_host_.reset(content::DevToolsFrontendHost::Create(new_host, this)); } void InspectableWebContentsImpl::DidFinishLoad(content::RenderFrameHost* render_frame_host, @@ -355,6 +356,7 @@ bool InspectableWebContentsImpl::AddMessageToConsole( bool InspectableWebContentsImpl::ShouldCreateWebContents( content::WebContents* web_contents, int route_id, + int main_frame_route_id, WindowContainerType window_container_type, const base::string16& frame_name, const GURL& target_url, diff --git a/brightray/browser/inspectable_web_contents_impl.h b/brightray/browser/inspectable_web_contents_impl.h index 075ee320d9e5..7e249e8aa650 100644 --- a/brightray/browser/inspectable_web_contents_impl.h +++ b/brightray/browser/inspectable_web_contents_impl.h @@ -104,7 +104,7 @@ class InspectableWebContentsImpl : bool replaced) override; // content::WebContentsObserver: - void AboutToNavigateRenderView(content::RenderViewHost* render_view_host) override; + void AboutToNavigateRenderFrame(content::RenderFrameHost* new_host) override; void DidFinishLoad(content::RenderFrameHost* render_frame_host, const GURL& validated_url) override; void WebContentsDestroyed() override; @@ -118,6 +118,7 @@ class InspectableWebContentsImpl : bool ShouldCreateWebContents( content::WebContents* web_contents, int route_id, + int main_frame_route_id, WindowContainerType window_container_type, const base::string16& frame_name, const GURL& target_url, From a5026907e47f0b89900fbee2bc7a3a517dfc26f6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 19:37:13 -0700 Subject: [PATCH 05/16] Implement PlatformNotificationService --- brightray/brightray.gyp | 2 + brightray/browser/browser_client.cc | 25 ++------ brightray/browser/browser_client.h | 10 +-- brightray/browser/notification_presenter.h | 4 +- .../browser/notification_presenter_mac.h | 2 +- .../browser/notification_presenter_mac.mm | 8 +-- .../platform_notification_service_impl.cc | 64 +++++++++++++++++++ .../platform_notification_service_impl.h | 61 ++++++++++++++++++ 8 files changed, 140 insertions(+), 36 deletions(-) create mode 100644 brightray/browser/platform_notification_service_impl.cc create mode 100644 brightray/browser/platform_notification_service_impl.h diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 736d169ec6cd..17057574e68b 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -71,6 +71,8 @@ 'browser/notification_presenter.h', 'browser/notification_presenter_mac.h', 'browser/notification_presenter_mac.mm', + 'browser/platform_notification_service_impl.cc', + 'browser/platform_notification_service_impl.h', 'browser/linux/notification_presenter_linux.h', 'browser/linux/notification_presenter_linux.cc', 'browser/remote_debugging_server.cc', diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index b391cffaf8d3..b884cdcdbf1c 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -8,7 +8,7 @@ #include "browser/browser_main_parts.h" #include "browser/devtools_manager_delegate.h" #include "browser/media/media_capture_devices_dispatcher.h" -#include "browser/notification_presenter.h" +#include "browser/platform_notification_service_impl.h" #include "base/base_paths.h" #include "base/path_service.h" @@ -39,14 +39,6 @@ BrowserContext* BrowserClient::browser_context() { return browser_main_parts_->browser_context(); } -NotificationPresenter* BrowserClient::notification_presenter() { -#if defined(OS_MACOSX) || defined(OS_LINUX) - if (!notification_presenter_) - notification_presenter_.reset(NotificationPresenter::Create()); -#endif - return notification_presenter_.get(); -} - BrowserMainParts* BrowserClient::OverrideCreateBrowserMainParts( const content::MainFunctionParams&) { return new BrowserMainParts; @@ -67,21 +59,14 @@ net::URLRequestContextGetter* BrowserClient::CreateRequestContext( return context->CreateRequestContext(protocol_handlers, protocol_interceptors.Pass()); } -void BrowserClient::ShowDesktopNotification( - const content::ShowDesktopNotificationHostMsgParams& params, - content::BrowserContext* browser_context, - int render_process_id, - scoped_ptr delegate, - base::Closure* cancel_callback) { - auto presenter = notification_presenter(); - if (presenter) - presenter->ShowNotification(params, delegate.Pass(), cancel_callback); -} - content::MediaObserver* BrowserClient::GetMediaObserver() { return MediaCaptureDevicesDispatcher::GetInstance(); } +content::PlatformNotificationService* BrowserClient::GetPlatformNotificationService() { + return PlatformNotificationServiceImpl::GetInstance(); +} + void BrowserClient::GetAdditionalAllowedSchemesForFileSystem( std::vector* additional_schemes) { additional_schemes->push_back(content::kChromeDevToolsScheme); diff --git a/brightray/browser/browser_client.h b/brightray/browser/browser_client.h index e3e256249dea..fad326e10bc7 100644 --- a/brightray/browser/browser_client.h +++ b/brightray/browser/browser_client.h @@ -11,7 +11,6 @@ namespace brightray { class BrowserContext; class BrowserMainParts; -class NotificationPresenter; class BrowserClient : public content::ContentBrowserClient { public: @@ -22,7 +21,6 @@ class BrowserClient : public content::ContentBrowserClient { BrowserContext* browser_context(); BrowserMainParts* browser_main_parts() { return browser_main_parts_; } - NotificationPresenter* notification_presenter(); protected: // Subclasses should override this to provide their own BrowserMainParts @@ -41,20 +39,14 @@ class BrowserClient : public content::ContentBrowserClient { private: content::BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams&) override; - void ShowDesktopNotification( - const content::ShowDesktopNotificationHostMsgParams& params, - content::BrowserContext* browser_context, - int render_process_id, - scoped_ptr delegate, - base::Closure* cancel_callback) override; content::MediaObserver* GetMediaObserver() override; + content::PlatformNotificationService* GetPlatformNotificationService() override; void GetAdditionalAllowedSchemesForFileSystem( std::vector* additional_schemes) override; base::FilePath GetDefaultDownloadDirectory() override; content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override; BrowserMainParts* browser_main_parts_; - scoped_ptr notification_presenter_; DISALLOW_COPY_AND_ASSIGN(BrowserClient); }; diff --git a/brightray/browser/notification_presenter.h b/brightray/browser/notification_presenter.h index 6c7def322ae1..ad17cdb3c531 100644 --- a/brightray/browser/notification_presenter.h +++ b/brightray/browser/notification_presenter.h @@ -6,7 +6,7 @@ namespace content { class DesktopNotificationDelegate; -struct ShowDesktopNotificationHostMsgParams; +struct PlatformNotificationData; } namespace brightray { @@ -18,7 +18,7 @@ class NotificationPresenter { static NotificationPresenter* Create(); virtual void ShowNotification( - const content::ShowDesktopNotificationHostMsgParams&, + const content::PlatformNotificationData&, scoped_ptr delegate, base::Closure* cancel_callback) = 0; }; diff --git a/brightray/browser/notification_presenter_mac.h b/brightray/browser/notification_presenter_mac.h index 508ad315f018..0ba7fe7c35e2 100644 --- a/brightray/browser/notification_presenter_mac.h +++ b/brightray/browser/notification_presenter_mac.h @@ -21,7 +21,7 @@ class NotificationPresenterMac : public NotificationPresenter { ~NotificationPresenterMac(); virtual void ShowNotification( - const content::ShowDesktopNotificationHostMsgParams&, + const content::PlatformNotificationData&, scoped_ptr delegate, base::Closure* cancel_callback) override; diff --git a/brightray/browser/notification_presenter_mac.mm b/brightray/browser/notification_presenter_mac.mm index 78e3cc2fd455..f0a08d759742 100644 --- a/brightray/browser/notification_presenter_mac.mm +++ b/brightray/browser/notification_presenter_mac.mm @@ -8,8 +8,8 @@ #include "base/bind.h" #include "base/stl_util.h" #include "base/strings/sys_string_conversions.h" +#include "content/public/common/platform_notification_data.h" #include "content/public/browser/desktop_notification_delegate.h" -#include "content/public/common/show_desktop_notification_params.h" #import @@ -40,12 +40,12 @@ NotificationPresenterMac::~NotificationPresenterMac() { } void NotificationPresenterMac::ShowNotification( - const content::ShowDesktopNotificationHostMsgParams& params, + const content::PlatformNotificationData& data, scoped_ptr delegate, base::Closure* cancel_callback) { auto notification = [[NSUserNotification alloc] init]; - notification.title = base::SysUTF16ToNSString(params.title); - notification.informativeText = base::SysUTF16ToNSString(params.body); + notification.title = base::SysUTF16ToNSString(data.title); + notification.informativeText = base::SysUTF16ToNSString(data.body); notifications_map_[delegate.get()].reset(notification); [NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification]; diff --git a/brightray/browser/platform_notification_service_impl.cc b/brightray/browser/platform_notification_service_impl.cc new file mode 100644 index 000000000000..f47d3851198d --- /dev/null +++ b/brightray/browser/platform_notification_service_impl.cc @@ -0,0 +1,64 @@ +// Copyright (c) 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-CHROMIUM file. + +#include "browser/platform_notification_service_impl.h" + +#include "browser/notification_presenter.h" + +#include "content/public/browser/desktop_notification_delegate.h" + +namespace brightray { + +// static +PlatformNotificationServiceImpl* +PlatformNotificationServiceImpl::GetInstance() { + return Singleton::get(); +} + +PlatformNotificationServiceImpl::PlatformNotificationServiceImpl() {} +PlatformNotificationServiceImpl::~PlatformNotificationServiceImpl() {} + +NotificationPresenter* PlatformNotificationServiceImpl::notification_presenter() { +#if defined(OS_MACOSX) || defined(OS_LINUX) + if (!notification_presenter_) + notification_presenter_.reset(NotificationPresenter::Create()); +#endif + return notification_presenter_.get(); +} + +blink::WebNotificationPermission PlatformNotificationServiceImpl::CheckPermission( + content::ResourceContext* resource_context, + const GURL& origin, + int render_process_id) { + return blink::WebNotificationPermissionAllowed; +} + +void PlatformNotificationServiceImpl::DisplayNotification( + content::BrowserContext* browser_context, + const GURL& origin, + const SkBitmap& icon, + const content::PlatformNotificationData& notification_data, + scoped_ptr delegate, + int render_process_id, + base::Closure* cancel_callback) { + auto presenter = notification_presenter(); + if (presenter) + presenter->ShowNotification(notification_data, delegate.Pass(), cancel_callback); +} + +void PlatformNotificationServiceImpl::DisplayPersistentNotification( + content::BrowserContext* browser_context, + int64 service_worker_registration_id, + const GURL& origin, + const SkBitmap& icon, + const content::PlatformNotificationData& notification_data, + int render_process_id) { +} + +void PlatformNotificationServiceImpl::ClosePersistentNotification( + content::BrowserContext* browser_context, + const std::string& persistent_notification_id) { +} + +} // namespace brightray diff --git a/brightray/browser/platform_notification_service_impl.h b/brightray/browser/platform_notification_service_impl.h new file mode 100644 index 000000000000..1a542bcc89b1 --- /dev/null +++ b/brightray/browser/platform_notification_service_impl.h @@ -0,0 +1,61 @@ +// Copyright (c) 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-CHROMIUM file. + +#ifndef BROWSER_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ +#define BROWSER_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ + +#include "base/memory/singleton.h" +#include "content/public/browser/platform_notification_service.h" + +namespace brightray { + +class NotificationPresenter; + +class PlatformNotificationServiceImpl + : public content::PlatformNotificationService { + public: + // Returns the active instance of the service in the browser process. Safe to + // be called from any thread. + static PlatformNotificationServiceImpl* GetInstance(); + + NotificationPresenter* notification_presenter(); + + private: + friend struct DefaultSingletonTraits; + + PlatformNotificationServiceImpl(); + ~PlatformNotificationServiceImpl() override; + + // content::PlatformNotificationService: + virtual blink::WebNotificationPermission CheckPermission( + content::ResourceContext* resource_context, + const GURL& origin, + int render_process_id) override; + virtual void DisplayNotification( + content::BrowserContext* browser_context, + const GURL& origin, + const SkBitmap& icon, + const content::PlatformNotificationData& notification_data, + scoped_ptr delegate, + int render_process_id, + base::Closure* cancel_callback) override; + virtual void DisplayPersistentNotification( + content::BrowserContext* browser_context, + int64 service_worker_registration_id, + const GURL& origin, + const SkBitmap& icon, + const content::PlatformNotificationData& notification_data, + int render_process_id) override; + virtual void ClosePersistentNotification( + content::BrowserContext* browser_context, + const std::string& persistent_notification_id) override; + + scoped_ptr notification_presenter_; + + DISALLOW_COPY_AND_ASSIGN(PlatformNotificationServiceImpl); +}; + +} // namespace brightray + +#endif // BROWSER_PLATFORM_NOTIFICATION_SERVICE_IMPL_H_ From 95f0f25dc473fe2b340b31ed12af236ddd31087e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 19:38:40 -0700 Subject: [PATCH 06/16] Fix inspectable_web_contents_impl.cc --- brightray/browser/inspectable_web_contents_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index 0e09fba1a3fa..ba85417f59c0 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -162,7 +162,7 @@ void InspectableWebContentsImpl::ShowDevTools() { agent_host_ = content::DevToolsAgentHost::GetOrCreateFor(web_contents_.get()); frontend_host_.reset(content::DevToolsFrontendHost::Create( - web_contents_->GetRenderViewHost(), this)); + web_contents_->GetMainFrame(), this)); agent_host_->AttachClient(this); GURL devtools_url(base::StringPrintf(kChromeUIDevToolsURL, can_dock_ ? "true" : "")); From 2837b730f2138637ad28c735d81c444cf6f56fa1 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 19:47:12 -0700 Subject: [PATCH 07/16] Fix network_delegate.cc --- brightray/browser/network_delegate.cc | 29 +++++++++-- brightray/browser/network_delegate.h | 73 +++++++++++++++------------ 2 files changed, 67 insertions(+), 35 deletions(-) diff --git a/brightray/browser/network_delegate.cc b/brightray/browser/network_delegate.cc index ec019a5f2812..a065a6ebf06c 100644 --- a/brightray/browser/network_delegate.cc +++ b/brightray/browser/network_delegate.cc @@ -21,6 +21,15 @@ int NetworkDelegate::OnBeforeURLRequest( return net::OK; } +void NetworkDelegate::OnResolveProxy(const GURL& url, + int load_flags, + const net::ProxyService& proxy_service, + net::ProxyInfo* result) { +} + +void NetworkDelegate::OnProxyFallback(const net::ProxyServer& bad_proxy, int net_error) { +} + int NetworkDelegate::OnBeforeSendHeaders( net::URLRequest* request, const net::CompletionCallback& callback, @@ -28,6 +37,11 @@ int NetworkDelegate::OnBeforeSendHeaders( return net::OK; } +void NetworkDelegate::OnBeforeSendProxyHeaders(net::URLRequest* request, + const net::ProxyInfo& proxy_info, + net::HttpRequestHeaders* headers) { +} + void NetworkDelegate::OnSendHeaders( net::URLRequest* request, const net::HttpRequestHeaders& headers) { @@ -92,10 +106,17 @@ bool NetworkDelegate::OnCanThrottleRequest( return false; } -int NetworkDelegate::OnBeforeSocketStreamConnect( - net::SocketStream* socket, - const net::CompletionCallback& callback) { - return net::OK; +bool NetworkDelegate::OnCanEnablePrivacyMode( + const GURL& url, + const GURL& first_party_for_cookies) const { + return false; +} + +bool NetworkDelegate::OnCancelURLRequestWithPolicyViolatingReferrerHeader( + const net::URLRequest& request, + const GURL& target_url, + const GURL& referrer_url) const { + return false; } } // namespace brightray diff --git a/brightray/browser/network_delegate.h b/brightray/browser/network_delegate.h index 2279b3c98152..fcfbdbb89277 100644 --- a/brightray/browser/network_delegate.h +++ b/brightray/browser/network_delegate.h @@ -15,46 +15,57 @@ class NetworkDelegate : public net::NetworkDelegate { virtual ~NetworkDelegate(); protected: - virtual int OnBeforeURLRequest(net::URLRequest* request, - const net::CompletionCallback& callback, - GURL* new_url) override; - virtual int OnBeforeSendHeaders(net::URLRequest* request, - const net::CompletionCallback& callback, - net::HttpRequestHeaders* headers) override; - virtual void OnSendHeaders(net::URLRequest* request, - const net::HttpRequestHeaders& headers) override; - virtual int OnHeadersReceived( + int OnBeforeURLRequest(net::URLRequest* request, + const net::CompletionCallback& callback, + GURL* new_url) override; + void OnResolveProxy(const GURL& url, + int load_flags, + const net::ProxyService& proxy_service, + net::ProxyInfo* result) override; + void OnProxyFallback(const net::ProxyServer& bad_proxy, int net_error) override; + int OnBeforeSendHeaders(net::URLRequest* request, + const net::CompletionCallback& callback, + net::HttpRequestHeaders* headers) override; + void OnBeforeSendProxyHeaders(net::URLRequest* request, + const net::ProxyInfo& proxy_info, + net::HttpRequestHeaders* headers) override; + void OnSendHeaders(net::URLRequest* request, + const net::HttpRequestHeaders& headers) override; + int OnHeadersReceived( net::URLRequest* request, const net::CompletionCallback& callback, const net::HttpResponseHeaders* original_response_headers, scoped_refptr* override_response_headers, GURL* allowed_unsafe_redirect_url) override; - virtual void OnBeforeRedirect(net::URLRequest* request, - const GURL& new_location) override; - virtual void OnResponseStarted(net::URLRequest* request) override; - virtual void OnRawBytesRead(const net::URLRequest& request, - int bytes_read) override; - virtual void OnCompleted(net::URLRequest* request, bool started) override; - virtual void OnURLRequestDestroyed(net::URLRequest* request) override; - virtual void OnPACScriptError(int line_number, - const base::string16& error) override; - virtual AuthRequiredResponse OnAuthRequired( + void OnBeforeRedirect(net::URLRequest* request, + const GURL& new_location) override; + void OnResponseStarted(net::URLRequest* request) override; + void OnRawBytesRead(const net::URLRequest& request, + int bytes_read) override; + void OnCompleted(net::URLRequest* request, bool started) override; + void OnURLRequestDestroyed(net::URLRequest* request) override; + void OnPACScriptError(int line_number, + const base::string16& error) override; + AuthRequiredResponse OnAuthRequired( net::URLRequest* request, const net::AuthChallengeInfo& auth_info, const AuthCallback& callback, net::AuthCredentials* credentials) override; - virtual bool OnCanGetCookies(const net::URLRequest& request, - const net::CookieList& cookie_list) override; - virtual bool OnCanSetCookie(const net::URLRequest& request, - const std::string& cookie_line, - net::CookieOptions* options) override; - virtual bool OnCanAccessFile(const net::URLRequest& request, - const base::FilePath& path) const override; - virtual bool OnCanThrottleRequest( - const net::URLRequest& request) const override; - virtual int OnBeforeSocketStreamConnect( - net::SocketStream* stream, - const net::CompletionCallback& callback) override; + bool OnCanGetCookies(const net::URLRequest& request, + const net::CookieList& cookie_list) override; + bool OnCanSetCookie(const net::URLRequest& request, + const std::string& cookie_line, + net::CookieOptions* options) override; + bool OnCanAccessFile(const net::URLRequest& request, + const base::FilePath& path) const override; + bool OnCanThrottleRequest(const net::URLRequest& request) const override; + bool OnCanEnablePrivacyMode( + const GURL& url, + const GURL& first_party_for_cookies) const override; + bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( + const net::URLRequest& request, + const GURL& target_url, + const GURL& referrer_url) const override; private: DISALLOW_COPY_AND_ASSIGN(NetworkDelegate); From f04ee342ea057b655f965d580da4112bfe56f08c Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 19:53:37 -0700 Subject: [PATCH 08/16] Remove RemoteDebuggingServer class --- brightray/brightray.gyp | 2 - brightray/browser/browser_main_parts.cc | 16 +++---- brightray/browser/browser_main_parts.h | 7 +++- brightray/browser/remote_debugging_server.cc | 44 -------------------- brightray/browser/remote_debugging_server.h | 31 -------------- 5 files changed, 10 insertions(+), 90 deletions(-) delete mode 100644 brightray/browser/remote_debugging_server.cc delete mode 100644 brightray/browser/remote_debugging_server.h diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 17057574e68b..df52343db241 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -75,8 +75,6 @@ 'browser/platform_notification_service_impl.h', 'browser/linux/notification_presenter_linux.h', 'browser/linux/notification_presenter_linux.cc', - 'browser/remote_debugging_server.cc', - 'browser/remote_debugging_server.h', 'browser/url_request_context_getter.cc', 'browser/url_request_context_getter.h', 'browser/views/inspectable_web_contents_view_views.h', diff --git a/brightray/browser/browser_main_parts.cc b/brightray/browser/browser_main_parts.cc index 351bee9c9885..de938eacd990 100644 --- a/brightray/browser/browser_main_parts.cc +++ b/brightray/browser/browser_main_parts.cc @@ -5,11 +5,12 @@ #include "browser/browser_main_parts.h" #include "browser/browser_context.h" -#include "browser/remote_debugging_server.h" +#include "browser/devtools_manager_delegate.h" #include "browser/web_ui_controller_factory.h" #include "base/command_line.h" #include "base/strings/string_number_conversions.h" +#include "content/public/browser/devtools_http_handler.h" #include "content/public/common/content_switches.h" #include "net/proxy/proxy_resolver_v8.h" @@ -125,16 +126,9 @@ void BrowserMainParts::PreMainMessageLoopRun() { web_ui_controller_factory_.get()); // --remote-debugging-port - base::CommandLine* command_line = CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(switches::kRemoteDebuggingPort)) { - std::string port_str = command_line->GetSwitchValueASCII(switches::kRemoteDebuggingPort); - int port; - if (base::StringToInt(port_str, &port) && port >= 0 && port < 65535) - remote_debugging_server_.reset( - new RemoteDebuggingServer("127.0.0.1", static_cast(port))); - else - DLOG(WARNING) << "Invalid http debugger port number " << port; - } + auto command_line = base::CommandLine::ForCurrentProcess(); + if (command_line->HasSwitch(switches::kRemoteDebuggingPort)) + devtools_http_handler_.reset(DevToolsManagerDelegate::CreateHttpHandler()); } void BrowserMainParts::PostMainMessageLoopRun() { diff --git a/brightray/browser/browser_main_parts.h b/brightray/browser/browser_main_parts.h index 3e52af4bd503..59674ef2e53e 100644 --- a/brightray/browser/browser_main_parts.h +++ b/brightray/browser/browser_main_parts.h @@ -9,6 +9,10 @@ #include "base/memory/scoped_ptr.h" #include "content/public/browser/browser_main_parts.h" +namespace content { +class DevToolsHttpHandler; +} + #if defined(TOOLKIT_VIEWS) namespace brightray { class ViewsDelegate; @@ -25,7 +29,6 @@ namespace brightray { class BrowserContext; class WebUIControllerFactory; -class RemoteDebuggingServer; class BrowserMainParts : public content::BrowserMainParts { public: @@ -58,7 +61,7 @@ class BrowserMainParts : public content::BrowserMainParts { scoped_ptr browser_context_; scoped_ptr web_ui_controller_factory_; - scoped_ptr remote_debugging_server_; + scoped_ptr devtools_http_handler_; #if defined(TOOLKIT_VIEWS) scoped_ptr views_delegate_; diff --git a/brightray/browser/remote_debugging_server.cc b/brightray/browser/remote_debugging_server.cc deleted file mode 100644 index 9aa004c313a1..000000000000 --- a/brightray/browser/remote_debugging_server.cc +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE-CHROMIUM file. - -#include "browser/remote_debugging_server.h" - -#include "browser/devtools_manager_delegate.h" - -#include "base/files/file_util.h" -#include "content/public/browser/devtools_http_handler.h" -#include "net/socket/tcp_server_socket.h" - -namespace brightray { - -namespace { - -class TCPServerSocketFactory - : public content::DevToolsHttpHandler::ServerSocketFactory { - public: - TCPServerSocketFactory(const std::string& address, uint16 port, int backlog) - : content::DevToolsHttpHandler::ServerSocketFactory(address, port, backlog) {} - - private: - // content::DevToolsHttpHandler::ServerSocketFactory: - scoped_ptr Create() const override { - return scoped_ptr(new net::TCPServerSocket(NULL, net::NetLog::Source())); - } - - DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory); -}; - -} // namespace - -RemoteDebuggingServer::RemoteDebuggingServer(const std::string& ip, uint16 port) { - scoped_ptr factory( - new TCPServerSocketFactory(ip, port, 1)); - devtools_http_handler_ = DevToolsManagerDelegate::CreateHttpHandler(); -} - -RemoteDebuggingServer::~RemoteDebuggingServer() { - devtools_http_handler_->Stop(); -} - -} // namespace brightray diff --git a/brightray/browser/remote_debugging_server.h b/brightray/browser/remote_debugging_server.h deleted file mode 100644 index 89faf65730f3..000000000000 --- a/brightray/browser/remote_debugging_server.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE-CHROMIUM file. - -#ifndef BROWSER_REMOTE_DEBUGGING_SERVER_H_ -#define BROWSER_REMOTE_DEBUGGING_SERVER_H_ - -#include - -#include "base/basictypes.h" - -namespace content { -class DevToolsHttpHandler; -} - -namespace brightray { - -class RemoteDebuggingServer { - public: - RemoteDebuggingServer(const std::string& ip, uint16 port); - virtual ~RemoteDebuggingServer(); - - private: - content::DevToolsHttpHandler* devtools_http_handler_; - - DISALLOW_COPY_AND_ASSIGN(RemoteDebuggingServer); -}; - -} // namespace brightray - -#endif // BROWSER_REMOTE_DEBUGGING_SERVER_H_ From 5e1a4e122226309ad16583e38156040200a8d1f8 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 19:54:27 -0700 Subject: [PATCH 09/16] Fix url_request_context_getter.cc --- brightray/browser/url_request_context_getter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/browser/url_request_context_getter.cc b/brightray/browser/url_request_context_getter.cc index 5cafb8aed793..8a1429398186 100644 --- a/brightray/browser/url_request_context_getter.cc +++ b/brightray/browser/url_request_context_getter.cc @@ -142,7 +142,7 @@ net::HostResolver* URLRequestContextGetter::host_resolver() { net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + auto& command_line = *base::CommandLine::ForCurrentProcess(); if (!url_request_context_.get()) { url_request_context_.reset(new net::URLRequestContext); network_delegate_.reset(delegate_->CreateNetworkDelegate()); From bb8da7ec7e8ae82ec7a65c41e7ef6fc86afdf1fa Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 19:56:45 -0700 Subject: [PATCH 10/16] Fix browser_context.cc --- brightray/browser/browser_context.cc | 5 +++++ brightray/browser/browser_context.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/brightray/browser/browser_context.cc b/brightray/browser/browser_context.cc index cb374ff4c945..6d2a378be801 100644 --- a/brightray/browser/browser_context.cc +++ b/brightray/browser/browser_context.cc @@ -99,6 +99,11 @@ base::FilePath BrowserContext::GetPath() const { return path_; } +scoped_ptr BrowserContext::CreateZoomLevelDelegate( + const base::FilePath& partition_path) { + return scoped_ptr(); +} + bool BrowserContext::IsOffTheRecord() const { return false; } diff --git a/brightray/browser/browser_context.h b/brightray/browser/browser_context.h index 90cefbcf7955..ec1dd095b233 100644 --- a/brightray/browser/browser_context.h +++ b/brightray/browser/browser_context.h @@ -46,6 +46,8 @@ class BrowserContext : public content::BrowserContext, void RegisterInternalPrefs(PrefRegistrySimple* pref_registry); + scoped_ptr CreateZoomLevelDelegate( + const base::FilePath& partition_path) override; bool IsOffTheRecord() const override; net::URLRequestContextGetter* GetRequestContext() override; net::URLRequestContextGetter* GetRequestContextForRenderProcess( From 56a16915884868fc39d5d3ca0696ec15c4680078 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 8 Mar 2015 20:04:25 -0700 Subject: [PATCH 11/16] MEDIA_LOOPBACK_AUDIO_CAPTURE renamed to MEDIA_DESKTOP_AUDIO_CAPTURE --- .../browser/media/media_stream_devices_controller.cc | 12 ++++++------ .../browser/media/media_stream_devices_controller.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/brightray/browser/media/media_stream_devices_controller.cc b/brightray/browser/media/media_stream_devices_controller.cc index b55e73844f9b..3d4f4cc3328c 100644 --- a/brightray/browser/media/media_stream_devices_controller.cc +++ b/brightray/browser/media/media_stream_devices_controller.cc @@ -51,7 +51,7 @@ bool MediaStreamDevicesController::TakeAction() { // Do special handling of desktop screen cast. if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE || request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE || - request_.audio_type == content::MEDIA_LOOPBACK_AUDIO_CAPTURE || + request_.audio_type == content::MEDIA_DESKTOP_AUDIO_CAPTURE || request_.video_type == content::MEDIA_DESKTOP_VIDEO_CAPTURE) { HandleUserMediaRequest(); return true; @@ -59,7 +59,7 @@ bool MediaStreamDevicesController::TakeAction() { // Deny the request if there is no device attached to the OS. if (!HasAnyAvailableDevice()) { - Deny(); + Deny(content::MEDIA_DEVICE_NO_HARDWARE); return true; } @@ -149,11 +149,11 @@ void MediaStreamDevicesController::Accept() { cb.Run(devices, content::MEDIA_DEVICE_OK, scoped_ptr()); } -void MediaStreamDevicesController::Deny() { +void MediaStreamDevicesController::Deny(content::MediaStreamRequestResult result) { content::MediaResponseCallback cb = callback_; callback_.Reset(); cb.Run(content::MediaStreamDevices(), - content::MEDIA_DEVICE_PERMISSION_DENIED, + result, scoped_ptr()); } @@ -168,9 +168,9 @@ void MediaStreamDevicesController::HandleUserMediaRequest() { devices.push_back(content::MediaStreamDevice( content::MEDIA_TAB_VIDEO_CAPTURE, "", "")); } - if (request_.audio_type == content::MEDIA_LOOPBACK_AUDIO_CAPTURE) { + if (request_.audio_type == content::MEDIA_DESKTOP_AUDIO_CAPTURE) { devices.push_back(content::MediaStreamDevice( - content::MEDIA_LOOPBACK_AUDIO_CAPTURE, "loopback", "System Audio")); + content::MEDIA_DESKTOP_AUDIO_CAPTURE, "loopback", "System Audio")); } if (request_.video_type == content::MEDIA_DESKTOP_VIDEO_CAPTURE) { content::DesktopMediaID screen_id; diff --git a/brightray/browser/media/media_stream_devices_controller.h b/brightray/browser/media/media_stream_devices_controller.h index e77af4770271..47aacfb66b64 100644 --- a/brightray/browser/media/media_stream_devices_controller.h +++ b/brightray/browser/media/media_stream_devices_controller.h @@ -23,7 +23,7 @@ class MediaStreamDevicesController { // Explicitly accept or deny the request. void Accept(); - void Deny(); + void Deny(content::MediaStreamRequestResult result); private: // Handle the request of desktop or tab screen cast. From 1a53e293ddcf9be340fea2b44166a0fc889dfe63 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 11 Mar 2015 14:51:37 -0700 Subject: [PATCH 12/16] Use DevToolsAPI instead of InspectorFrontendAPI Now InspectorFrontendAPI is available in the iframe, we have to call DevToolsAPI which delegates the call. --- brightray/browser/inspectable_web_contents_impl.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brightray/browser/inspectable_web_contents_impl.cc b/brightray/browser/inspectable_web_contents_impl.cc index ba85417f59c0..88ed18dc1f93 100644 --- a/brightray/browser/inspectable_web_contents_impl.cc +++ b/brightray/browser/inspectable_web_contents_impl.cc @@ -243,7 +243,7 @@ void InspectableWebContentsImpl::AppendToFile( void InspectableWebContentsImpl::RequestFileSystems() { devtools_web_contents()->GetMainFrame()->ExecuteJavaScript( - base::ASCIIToUTF16("InspectorFrontendAPI.fileSystemsLoaded([])")); + base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([])")); } void InspectableWebContentsImpl::AddFileSystem() { @@ -296,7 +296,7 @@ void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontend(const std::st std::string error = embedder_message_dispatcher_->Dispatch(method, ¶ms); if (id) { std::string ack = base::StringPrintf( - "InspectorFrontendAPI.embedderMessageAck(%d, \"%s\");", id, error.c_str()); + "DevToolsAPI.embedderMessageAck(%d, \"%s\");", id, error.c_str()); devtools_web_contents()->GetMainFrame()->ExecuteJavaScript(base::UTF8ToUTF16(ack)); } } @@ -308,7 +308,7 @@ void InspectableWebContentsImpl::HandleMessageFromDevToolsFrontendToBackend( void InspectableWebContentsImpl::DispatchProtocolMessage( content::DevToolsAgentHost* agent_host, const std::string& message) { - std::string code = "InspectorFrontendAPI.dispatchMessage(" + message + ");"; + std::string code = "DevToolsAPI.dispatchMessage(" + message + ");"; base::string16 javascript = base::UTF8ToUTF16(code); web_contents()->GetMainFrame()->ExecuteJavaScript(javascript); } From 6033e5bea39b35c141588fd600a872de6265eb57 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 13 Mar 2015 16:33:48 -0700 Subject: [PATCH 13/16] Upgrade libchromiumcontent --- brightray/vendor/libchromiumcontent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index 531d92bd1c52..f3f2a0aa4295 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 531d92bd1c52e54376b09ee20e128a5e284cceb2 +Subproject commit f3f2a0aa429523a45dfb943c05106fa68fb26c44 From 54e58ae255824c7d210d823d9c2ec98753bee227 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 14 Mar 2015 18:34:53 +0000 Subject: [PATCH 14/16] Fix compilation on Linux --- brightray/browser/linux/notification_presenter_linux.cc | 8 ++++---- brightray/browser/linux/notification_presenter_linux.h | 4 ++-- brightray/browser/notification_presenter_mac.h | 3 ++- brightray/vendor/libchromiumcontent | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/brightray/browser/linux/notification_presenter_linux.cc b/brightray/browser/linux/notification_presenter_linux.cc index 193e80c76d63..a3d72bc8faa2 100644 --- a/brightray/browser/linux/notification_presenter_linux.cc +++ b/brightray/browser/linux/notification_presenter_linux.cc @@ -9,7 +9,7 @@ #include "base/logging.h" #include "base/strings/utf_string_conversions.h" #include "content/public/browser/desktop_notification_delegate.h" -#include "content/public/common/show_desktop_notification_params.h" +#include "content/public/common/platform_notification_data.h" #include "common/application_info.h" namespace brightray { @@ -51,11 +51,11 @@ NotificationPresenterLinux::~NotificationPresenterLinux() { } void NotificationPresenterLinux::ShowNotification( - const content::ShowDesktopNotificationHostMsgParams& params, + const content::PlatformNotificationData& data, scoped_ptr delegate_ptr, base::Closure* cancel_callback) { - std::string title = base::UTF16ToUTF8(params.title); - std::string body = base::UTF16ToUTF8(params.body); + std::string title = base::UTF16ToUTF8(data.title); + std::string body = base::UTF16ToUTF8(data.body); NotifyNotification* notification = notify_notification_new(title.c_str(), body.c_str(), nullptr); content::DesktopNotificationDelegate* delegate = delegate_ptr.release(); diff --git a/brightray/browser/linux/notification_presenter_linux.h b/brightray/browser/linux/notification_presenter_linux.h index 6701d399c413..384e2d2f8c7a 100644 --- a/brightray/browser/linux/notification_presenter_linux.h +++ b/brightray/browser/linux/notification_presenter_linux.h @@ -25,8 +25,8 @@ class NotificationPresenterLinux : public NotificationPresenter { private: // NotificationPresenter: - virtual void ShowNotification( - const content::ShowDesktopNotificationHostMsgParams&, + void ShowNotification( + const content::PlatformNotificationData&, scoped_ptr delegate, base::Closure* cancel_callback) override; diff --git a/brightray/browser/notification_presenter_mac.h b/brightray/browser/notification_presenter_mac.h index 0ba7fe7c35e2..fd9dd737d9e0 100644 --- a/brightray/browser/notification_presenter_mac.h +++ b/brightray/browser/notification_presenter_mac.h @@ -20,7 +20,8 @@ class NotificationPresenterMac : public NotificationPresenter { NotificationPresenterMac(); ~NotificationPresenterMac(); - virtual void ShowNotification( + // NotificationPresenter: + void ShowNotification( const content::PlatformNotificationData&, scoped_ptr delegate, base::Closure* cancel_callback) override; diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index f3f2a0aa4295..84b0897b6bf2 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit f3f2a0aa429523a45dfb943c05106fa68fb26c44 +Subproject commit 84b0897b6bf21d75ff03a1916513259aeb284252 From 21ee1f257fee3ce56e69088f8b1ebd3b1d1151df Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 18 Mar 2015 09:55:13 +0800 Subject: [PATCH 15/16] Upgrade libchromiumcontent --- brightray/vendor/libchromiumcontent | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index 84b0897b6bf2..5e41ab5d654a 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 84b0897b6bf21d75ff03a1916513259aeb284252 +Subproject commit 5e41ab5d654a5250014f2d751a2e118c540bdff2 From 4e14c8634b2aa87bf5d6dd2a7e8db62b82e0dd88 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 18 Mar 2015 12:55:02 +0800 Subject: [PATCH 16/16] Fix building on Windows --- brightray/browser/views/views_delegate.cc | 4 ++++ brightray/browser/views/views_delegate.h | 1 + brightray/vendor/libchromiumcontent | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/brightray/browser/views/views_delegate.cc b/brightray/browser/views/views_delegate.cc index a1078d41cb79..0d28ddcc321b 100644 --- a/brightray/browser/views/views_delegate.cc +++ b/brightray/browser/views/views_delegate.cc @@ -54,6 +54,10 @@ HICON ViewsDelegate::GetDefaultWindowIcon() const { return LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(1 /* IDR_MAINFRAME */)); } +HICON ViewsDelegate::GetSmallWindowIcon() const { + return GetDefaultWindowIcon(); +} + bool ViewsDelegate::IsWindowInMetro(gfx::NativeWindow window) const { return false; } diff --git a/brightray/browser/views/views_delegate.h b/brightray/browser/views/views_delegate.h index 27d64207281c..bd1e7bc2b6be 100644 --- a/brightray/browser/views/views_delegate.h +++ b/brightray/browser/views/views_delegate.h @@ -36,6 +36,7 @@ class ViewsDelegate : public views::ViewsDelegate { #if defined(OS_WIN) virtual HICON GetDefaultWindowIcon() const override; + virtual HICON GetSmallWindowIcon() const override; virtual bool IsWindowInMetro(gfx::NativeWindow window) const override; #elif defined(OS_LINUX) && !defined(OS_CHROMEOS) virtual gfx::ImageSkia* GetDefaultWindowIcon() const override; diff --git a/brightray/vendor/libchromiumcontent b/brightray/vendor/libchromiumcontent index 5e41ab5d654a..78ddaee21588 160000 --- a/brightray/vendor/libchromiumcontent +++ b/brightray/vendor/libchromiumcontent @@ -1 +1 @@ -Subproject commit 5e41ab5d654a5250014f2d751a2e118c540bdff2 +Subproject commit 78ddaee2158886da53d0801db572be38230fd814