mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-18 05:00:48 +01:00
Update to Chromium revision 213078.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1338 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
6a7353be3e
commit
a2a3513620
@ -17,5 +17,5 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
|
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
|
||||||
'chromium_revision': '208345',
|
'chromium_revision': '213078',
|
||||||
}
|
}
|
||||||
|
9
cef.gyp
9
cef.gyp
@ -564,7 +564,7 @@
|
|||||||
'type': 'none',
|
'type': 'none',
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'<(DEPTH)/ui/base/strings/ui_strings.gyp:ui_strings',
|
'<(DEPTH)/ui/base/strings/ui_strings.gyp:ui_strings',
|
||||||
'<(DEPTH)/webkit/support/webkit_support.gyp:webkit_strings',
|
'<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
|
||||||
'cef_strings',
|
'cef_strings',
|
||||||
],
|
],
|
||||||
'variables': {
|
'variables': {
|
||||||
@ -693,10 +693,11 @@
|
|||||||
'type': 'none',
|
'type': 'none',
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'<(DEPTH)/content/browser/devtools/devtools_resources.gyp:devtools_resources',
|
'<(DEPTH)/content/browser/devtools/devtools_resources.gyp:devtools_resources',
|
||||||
|
'<(DEPTH)/content/browser/tracing/tracing_resources.gyp:tracing_resources',
|
||||||
'<(DEPTH)/content/content_resources.gyp:content_resources',
|
'<(DEPTH)/content/content_resources.gyp:content_resources',
|
||||||
'<(DEPTH)/net/net.gyp:net_resources',
|
'<(DEPTH)/net/net.gyp:net_resources',
|
||||||
'<(DEPTH)/ui/ui.gyp:ui_resources',
|
'<(DEPTH)/ui/ui.gyp:ui_resources',
|
||||||
'<(DEPTH)/webkit/support/webkit_support.gyp:webkit_resources',
|
'<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
|
||||||
'cef_locales',
|
'cef_locales',
|
||||||
'cef_resources',
|
'cef_resources',
|
||||||
],
|
],
|
||||||
@ -709,6 +710,7 @@
|
|||||||
'action_name': 'repack_cef_pack',
|
'action_name': 'repack_cef_pack',
|
||||||
'variables': {
|
'variables': {
|
||||||
'pak_inputs': [
|
'pak_inputs': [
|
||||||
|
'<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.pak',
|
||||||
'<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
|
'<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
|
||||||
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
|
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
|
||||||
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak',
|
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak',
|
||||||
@ -731,6 +733,7 @@
|
|||||||
'action_name': 'make_pack_resources_header',
|
'action_name': 'make_pack_resources_header',
|
||||||
'variables': {
|
'variables': {
|
||||||
'header_inputs': [
|
'header_inputs': [
|
||||||
|
'<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/grit/tracing_resources.h',
|
||||||
'<(SHARED_INTERMEDIATE_DIR)/content/grit/content_resources.h',
|
'<(SHARED_INTERMEDIATE_DIR)/content/grit/content_resources.h',
|
||||||
'<(SHARED_INTERMEDIATE_DIR)/net/grit/net_resources.h',
|
'<(SHARED_INTERMEDIATE_DIR)/net/grit/net_resources.h',
|
||||||
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/grit/ui_resources.h',
|
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/grit/ui_resources.h',
|
||||||
@ -793,6 +796,7 @@
|
|||||||
'<(DEPTH)/third_party/WebKit/public/web',
|
'<(DEPTH)/third_party/WebKit/public/web',
|
||||||
# CEF grit resource includes
|
# CEF grit resource includes
|
||||||
'<(grit_out_dir)',
|
'<(grit_out_dir)',
|
||||||
|
'<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing',
|
||||||
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings',
|
'<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings',
|
||||||
'<(SHARED_INTERMEDIATE_DIR)/webkit',
|
'<(SHARED_INTERMEDIATE_DIR)/webkit',
|
||||||
],
|
],
|
||||||
@ -1002,6 +1006,7 @@
|
|||||||
# Include sources for proxy support.
|
# Include sources for proxy support.
|
||||||
'<(DEPTH)/base/prefs/testing_pref_store.cc',
|
'<(DEPTH)/base/prefs/testing_pref_store.cc',
|
||||||
'<(DEPTH)/base/prefs/testing_pref_store.h',
|
'<(DEPTH)/base/prefs/testing_pref_store.h',
|
||||||
|
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker.cc',
|
||||||
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker.h',
|
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker.h',
|
||||||
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker_impl.cc',
|
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker_impl.cc',
|
||||||
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker_impl.h',
|
'<(DEPTH)/chrome/browser/net/pref_proxy_config_tracker_impl.h',
|
||||||
|
@ -116,7 +116,7 @@ typedef struct _cef_download_item_t {
|
|||||||
///
|
///
|
||||||
// Returns the unique identifier for this download.
|
// Returns the unique identifier for this download.
|
||||||
///
|
///
|
||||||
int32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self);
|
uint32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self);
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the URL.
|
// Returns the URL.
|
||||||
|
@ -118,7 +118,7 @@ class CefDownloadItem : public virtual CefBase {
|
|||||||
// Returns the unique identifier for this download.
|
// Returns the unique identifier for this download.
|
||||||
///
|
///
|
||||||
/*--cef()--*/
|
/*--cef()--*/
|
||||||
virtual int32 GetId() =0;
|
virtual uint32 GetId() =0;
|
||||||
|
|
||||||
///
|
///
|
||||||
// Returns the URL.
|
// Returns the URL.
|
||||||
|
@ -11,17 +11,14 @@
|
|||||||
#include "libcef/browser/download_manager_delegate.h"
|
#include "libcef/browser/download_manager_delegate.h"
|
||||||
#include "libcef/browser/thread_util.h"
|
#include "libcef/browser/thread_util.h"
|
||||||
#include "libcef/browser/url_request_context_getter.h"
|
#include "libcef/browser/url_request_context_getter.h"
|
||||||
#include "libcef/common/cef_switches.h"
|
|
||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/command_line.h"
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/threading/thread.h"
|
#include "base/threading/thread.h"
|
||||||
#include "content/public/browser/download_manager.h"
|
#include "content/public/browser/download_manager.h"
|
||||||
#include "content/public/browser/browser_thread.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
#include "content/public/browser/geolocation_permission_context.h"
|
#include "content/public/browser/geolocation_permission_context.h"
|
||||||
#include "content/public/browser/resource_context.h"
|
#include "content/public/browser/resource_context.h"
|
||||||
#include "content/public/browser/speech_recognition_preferences.h"
|
|
||||||
#include "content/public/browser/storage_partition.h"
|
#include "content/public/browser/storage_partition.h"
|
||||||
|
|
||||||
using content::BrowserThread;
|
using content::BrowserThread;
|
||||||
@ -158,26 +155,6 @@ class CefGeolocationPermissionContext
|
|||||||
DISALLOW_COPY_AND_ASSIGN(CefGeolocationPermissionContext);
|
DISALLOW_COPY_AND_ASSIGN(CefGeolocationPermissionContext);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CefSpeechRecognitionPreferences
|
|
||||||
: public content::SpeechRecognitionPreferences {
|
|
||||||
public:
|
|
||||||
CefSpeechRecognitionPreferences() {
|
|
||||||
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
|
||||||
filter_profanities_ =
|
|
||||||
command_line.HasSwitch(switches::kEnableProfanityFilter);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Overridden from SpeechRecognitionPreferences:
|
|
||||||
virtual bool FilterProfanities() const OVERRIDE {
|
|
||||||
return filter_profanities_;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool filter_profanities_;
|
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefSpeechRecognitionPreferences);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
class CefBrowserContext::CefResourceContext : public content::ResourceContext {
|
class CefBrowserContext::CefResourceContext : public content::ResourceContext {
|
||||||
@ -222,7 +199,7 @@ CefBrowserContext::~CefBrowserContext() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
base::FilePath CefBrowserContext::GetPath() {
|
base::FilePath CefBrowserContext::GetPath() const {
|
||||||
return _Context->cache_path();
|
return _Context->cache_path();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,6 +249,15 @@ net::URLRequestContextGetter*
|
|||||||
return GetRequestContext();
|
return GetRequestContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CefBrowserContext::RequestMIDISysExPermission(
|
||||||
|
int render_process_id,
|
||||||
|
int render_view_id,
|
||||||
|
const GURL& requesting_frame,
|
||||||
|
const MIDISysExPermissionCallback& callback) {
|
||||||
|
// TODO(CEF): Implement Web MIDI API permission handling.
|
||||||
|
callback.Run(false);
|
||||||
|
}
|
||||||
|
|
||||||
content::ResourceContext* CefBrowserContext::GetResourceContext() {
|
content::ResourceContext* CefBrowserContext::GetResourceContext() {
|
||||||
return resource_context_.get();
|
return resource_context_.get();
|
||||||
}
|
}
|
||||||
@ -285,13 +271,6 @@ content::GeolocationPermissionContext*
|
|||||||
return geolocation_permission_context_;
|
return geolocation_permission_context_;
|
||||||
}
|
}
|
||||||
|
|
||||||
content::SpeechRecognitionPreferences*
|
|
||||||
CefBrowserContext::GetSpeechRecognitionPreferences() {
|
|
||||||
if (!speech_recognition_preferences_.get())
|
|
||||||
speech_recognition_preferences_ = new CefSpeechRecognitionPreferences();
|
|
||||||
return speech_recognition_preferences_.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
quota::SpecialStoragePolicy* CefBrowserContext::GetSpecialStoragePolicy() {
|
quota::SpecialStoragePolicy* CefBrowserContext::GetSpecialStoragePolicy() {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ class CefBrowserContext : public content::BrowserContext {
|
|||||||
virtual ~CefBrowserContext();
|
virtual ~CefBrowserContext();
|
||||||
|
|
||||||
// BrowserContext methods.
|
// BrowserContext methods.
|
||||||
virtual base::FilePath GetPath() OVERRIDE;
|
virtual base::FilePath GetPath() const OVERRIDE;
|
||||||
virtual bool IsOffTheRecord() const OVERRIDE;
|
virtual bool IsOffTheRecord() const OVERRIDE;
|
||||||
virtual content::DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE;
|
virtual content::DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE;
|
||||||
virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
|
virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
|
||||||
@ -41,11 +41,14 @@ class CefBrowserContext : public content::BrowserContext {
|
|||||||
GetMediaRequestContextForStoragePartition(
|
GetMediaRequestContextForStoragePartition(
|
||||||
const base::FilePath& partition_path,
|
const base::FilePath& partition_path,
|
||||||
bool in_memory) OVERRIDE;
|
bool in_memory) OVERRIDE;
|
||||||
|
virtual void RequestMIDISysExPermission(
|
||||||
|
int render_process_id,
|
||||||
|
int render_view_id,
|
||||||
|
const GURL& requesting_frame,
|
||||||
|
const MIDISysExPermissionCallback& callback) OVERRIDE;
|
||||||
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
|
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
|
||||||
virtual content::GeolocationPermissionContext*
|
virtual content::GeolocationPermissionContext*
|
||||||
GetGeolocationPermissionContext() OVERRIDE;
|
GetGeolocationPermissionContext() OVERRIDE;
|
||||||
virtual content::SpeechRecognitionPreferences*
|
|
||||||
GetSpeechRecognitionPreferences() OVERRIDE;
|
|
||||||
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
|
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
|
||||||
|
|
||||||
net::URLRequestContextGetter* CreateRequestContext(
|
net::URLRequestContextGetter* CreateRequestContext(
|
||||||
@ -70,8 +73,6 @@ class CefBrowserContext : public content::BrowserContext {
|
|||||||
scoped_refptr<CefURLRequestContextGetter> url_request_getter_;
|
scoped_refptr<CefURLRequestContextGetter> url_request_getter_;
|
||||||
scoped_refptr<content::GeolocationPermissionContext>
|
scoped_refptr<content::GeolocationPermissionContext>
|
||||||
geolocation_permission_context_;
|
geolocation_permission_context_;
|
||||||
scoped_refptr<content::SpeechRecognitionPreferences>
|
|
||||||
speech_recognition_preferences_;
|
|
||||||
|
|
||||||
bool use_osr_next_contents_view_;
|
bool use_osr_next_contents_view_;
|
||||||
|
|
||||||
|
@ -1631,7 +1631,7 @@ void CefBrowserHostImpl::HandleKeyboardEvent(
|
|||||||
|
|
||||||
bool CefBrowserHostImpl::CanDragEnter(
|
bool CefBrowserHostImpl::CanDragEnter(
|
||||||
content::WebContents* source,
|
content::WebContents* source,
|
||||||
const WebDropData& data,
|
const content::DropData& data,
|
||||||
WebKit::WebDragOperationsMask mask) {
|
WebKit::WebDragOperationsMask mask) {
|
||||||
CefRefPtr<CefDragHandler> handler = client_->GetDragHandler();
|
CefRefPtr<CefDragHandler> handler = client_->GetDragHandler();
|
||||||
if (handler.get()) {
|
if (handler.get()) {
|
||||||
@ -1649,7 +1649,10 @@ bool CefBrowserHostImpl::ShouldCreateWebContents(
|
|||||||
int route_id,
|
int route_id,
|
||||||
WindowContainerType window_container_type,
|
WindowContainerType window_container_type,
|
||||||
const string16& frame_name,
|
const string16& frame_name,
|
||||||
const GURL& target_url) {
|
const GURL& target_url,
|
||||||
|
WindowOpenDisposition disposition,
|
||||||
|
const WebKit::WebWindowFeatures& features,
|
||||||
|
bool user_gesture) {
|
||||||
CefContentBrowserClient::Get()->GetOrCreateBrowserInfo(
|
CefContentBrowserClient::Get()->GetOrCreateBrowserInfo(
|
||||||
web_contents->GetRenderProcessHost()->GetID(), route_id);
|
web_contents->GetRenderProcessHost()->GetID(), route_id);
|
||||||
|
|
||||||
@ -1714,7 +1717,7 @@ void CefBrowserHostImpl::RunFileChooser(
|
|||||||
|
|
||||||
RunFileChooserOnUIThread(params,
|
RunFileChooserOnUIThread(params,
|
||||||
base::Bind(&CefBrowserHostImpl::OnRunFileChooserDelegateCallback, this,
|
base::Bind(&CefBrowserHostImpl::OnRunFileChooserDelegateCallback, this,
|
||||||
tab));
|
tab, params.mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefBrowserHostImpl::SetPendingPopupInfo(
|
bool CefBrowserHostImpl::SetPendingPopupInfo(
|
||||||
@ -1757,7 +1760,8 @@ void CefBrowserHostImpl::RequestMediaAccessPermission(
|
|||||||
// For open device request pick the desired device or fall back to the
|
// For open device request pick the desired device or fall back to the
|
||||||
// first available of the given type.
|
// first available of the given type.
|
||||||
CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice(
|
CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice(
|
||||||
request.requested_device_id,
|
(microphone_requested ? request.requested_audio_device_id :
|
||||||
|
request.requested_video_device_id),
|
||||||
microphone_requested,
|
microphone_requested,
|
||||||
webcam_requested,
|
webcam_requested,
|
||||||
&devices);
|
&devices);
|
||||||
@ -1828,7 +1832,7 @@ void CefBrowserHostImpl::RenderViewReady() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefBrowserHostImpl::RenderViewGone(base::TerminationStatus status) {
|
void CefBrowserHostImpl::RenderProcessGone(base::TerminationStatus status) {
|
||||||
queue_messages_ = true;
|
queue_messages_ = true;
|
||||||
|
|
||||||
cef_termination_status_t ts = TS_ABNORMAL_TERMINATION;
|
cef_termination_status_t ts = TS_ABNORMAL_TERMINATION;
|
||||||
@ -2354,6 +2358,7 @@ void CefBrowserHostImpl::OnRunFileChooserCallback(
|
|||||||
|
|
||||||
void CefBrowserHostImpl::OnRunFileChooserDelegateCallback(
|
void CefBrowserHostImpl::OnRunFileChooserDelegateCallback(
|
||||||
content::WebContents* tab,
|
content::WebContents* tab,
|
||||||
|
content::FileChooserParams::Mode mode,
|
||||||
const std::vector<base::FilePath>& file_paths) {
|
const std::vector<base::FilePath>& file_paths) {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
|
|
||||||
@ -2361,12 +2366,6 @@ void CefBrowserHostImpl::OnRunFileChooserDelegateCallback(
|
|||||||
if (!render_view_host)
|
if (!render_view_host)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int kReadFilePermissions =
|
|
||||||
base::PLATFORM_FILE_OPEN |
|
|
||||||
base::PLATFORM_FILE_READ |
|
|
||||||
base::PLATFORM_FILE_EXCLUSIVE_READ |
|
|
||||||
base::PLATFORM_FILE_ASYNC;
|
|
||||||
|
|
||||||
// Convert FilePath list to SelectedFileInfo list.
|
// Convert FilePath list to SelectedFileInfo list.
|
||||||
std::vector<ui::SelectedFileInfo> selected_files;
|
std::vector<ui::SelectedFileInfo> selected_files;
|
||||||
for (size_t i = 0; i < file_paths.size(); ++i) {
|
for (size_t i = 0; i < file_paths.size(); ++i) {
|
||||||
@ -2375,6 +2374,5 @@ void CefBrowserHostImpl::OnRunFileChooserDelegateCallback(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Notify our RenderViewHost in all cases.
|
// Notify our RenderViewHost in all cases.
|
||||||
render_view_host->FilesSelectedInChooser(selected_files,
|
render_view_host->FilesSelectedInChooser(selected_files, mode);
|
||||||
kReadFilePermissions);
|
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "content/public/browser/web_contents.h"
|
#include "content/public/browser/web_contents.h"
|
||||||
#include "content/public/browser/web_contents_delegate.h"
|
#include "content/public/browser/web_contents_delegate.h"
|
||||||
#include "content/public/browser/web_contents_observer.h"
|
#include "content/public/browser/web_contents_observer.h"
|
||||||
|
#include "content/public/common/file_chooser_params.h"
|
||||||
#include "net/url_request/url_request_context_getter.h"
|
#include "net/url_request/url_request_context_getter.h"
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
@ -303,14 +304,17 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||||||
const content::NativeWebKeyboardEvent& event) OVERRIDE;
|
const content::NativeWebKeyboardEvent& event) OVERRIDE;
|
||||||
virtual bool CanDragEnter(
|
virtual bool CanDragEnter(
|
||||||
content::WebContents* source,
|
content::WebContents* source,
|
||||||
const WebDropData& data,
|
const content::DropData& data,
|
||||||
WebKit::WebDragOperationsMask operations_allowed) OVERRIDE;
|
WebKit::WebDragOperationsMask operations_allowed) OVERRIDE;
|
||||||
virtual bool ShouldCreateWebContents(
|
virtual bool ShouldCreateWebContents(
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
int route_id,
|
int route_id,
|
||||||
WindowContainerType window_container_type,
|
WindowContainerType window_container_type,
|
||||||
const string16& frame_name,
|
const string16& frame_name,
|
||||||
const GURL& target_url) OVERRIDE;
|
const GURL& target_url,
|
||||||
|
WindowOpenDisposition disposition,
|
||||||
|
const WebKit::WebWindowFeatures& features,
|
||||||
|
bool user_gesture) OVERRIDE;
|
||||||
virtual void WebContentsCreated(content::WebContents* source_contents,
|
virtual void WebContentsCreated(content::WebContents* source_contents,
|
||||||
int64 source_frame_id,
|
int64 source_frame_id,
|
||||||
const string16& frame_name,
|
const string16& frame_name,
|
||||||
@ -337,7 +341,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||||||
virtual void RenderViewDeleted(
|
virtual void RenderViewDeleted(
|
||||||
content::RenderViewHost* render_view_host) OVERRIDE;
|
content::RenderViewHost* render_view_host) OVERRIDE;
|
||||||
virtual void RenderViewReady() OVERRIDE;
|
virtual void RenderViewReady() OVERRIDE;
|
||||||
virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE;
|
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
|
||||||
virtual void DidCommitProvisionalLoadForFrame(
|
virtual void DidCommitProvisionalLoadForFrame(
|
||||||
int64 frame_id,
|
int64 frame_id,
|
||||||
bool is_main_frame,
|
bool is_main_frame,
|
||||||
@ -471,6 +475,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||||||
// Used with WebContentsDelegate::RunFileChooser to notify the WebContents.
|
// Used with WebContentsDelegate::RunFileChooser to notify the WebContents.
|
||||||
void OnRunFileChooserDelegateCallback(
|
void OnRunFileChooserDelegateCallback(
|
||||||
content::WebContents* tab,
|
content::WebContents* tab,
|
||||||
|
content::FileChooserParams::Mode mode,
|
||||||
const std::vector<base::FilePath>& file_paths);
|
const std::vector<base::FilePath>& file_paths);
|
||||||
|
|
||||||
CefWindowInfo window_info_;
|
CefWindowInfo window_info_;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/command_line.h"
|
#include "base/command_line.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
#include "chrome/browser/net/proxy_service_factory.h"
|
#include "chrome/browser/net/proxy_service_factory.h"
|
||||||
#include "content/browser/webui/content_web_ui_controller_factory.h"
|
#include "content/browser/webui/content_web_ui_controller_factory.h"
|
||||||
@ -74,7 +74,7 @@ int CefBrowserMainParts::PreCreateThreads() {
|
|||||||
|
|
||||||
// Initialize proxy configuration tracker.
|
// Initialize proxy configuration tracker.
|
||||||
pref_proxy_config_tracker_.reset(
|
pref_proxy_config_tracker_.reset(
|
||||||
ProxyServiceFactory::CreatePrefProxyConfigTracker(
|
ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
|
||||||
pref_service_.get()));
|
pref_service_.get()));
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -86,11 +86,9 @@ void CefBrowserMainParts::PreMainMessageLoopRun() {
|
|||||||
// Initialize the proxy configuration service. This needs to occur before
|
// Initialize the proxy configuration service. This needs to occur before
|
||||||
// CefURLRequestContextGetter::GetURLRequestContext() is called for the
|
// CefURLRequestContextGetter::GetURLRequestContext() is called for the
|
||||||
// first time.
|
// first time.
|
||||||
ChromeProxyConfigService* chrome_proxy_config_service =
|
proxy_config_service_.reset(
|
||||||
ProxyServiceFactory::CreateProxyConfigService();
|
ProxyServiceFactory::CreateProxyConfigService(
|
||||||
proxy_config_service_.reset(chrome_proxy_config_service);
|
pref_proxy_config_tracker_.get()));
|
||||||
pref_proxy_config_tracker_->SetChromeProxyConfigService(
|
|
||||||
chrome_proxy_config_service);
|
|
||||||
|
|
||||||
// Initialize the request context getter. This indirectly triggers a call
|
// Initialize the request context getter. This indirectly triggers a call
|
||||||
// to CefURLRequestContextGetter::GetURLRequestContext() on the IO thread.
|
// to CefURLRequestContextGetter::GetURLRequestContext() on the IO thread.
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/basictypes.h"
|
#include "base/basictypes.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
|
|
||||||
// Class used to process events on the current message loop.
|
// Class used to process events on the current message loop.
|
||||||
class CefBrowserMessageLoop : public base::MessageLoopForUI {
|
class CefBrowserMessageLoop : public base::MessageLoopForUI {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "libcef/common/response_impl.h"
|
#include "libcef/common/response_impl.h"
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "base/strings/string_util.h"
|
#include "base/strings/string_util.h"
|
||||||
#include "content/public/common/url_fetcher.h"
|
#include "content/public/common/url_fetcher.h"
|
||||||
#include "net/base/load_flags.h"
|
#include "net/base/load_flags.h"
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "content/browser/net/view_blob_internals_job_factory.h"
|
#include "content/browser/net/view_blob_internals_job_factory.h"
|
||||||
#include "content/public/common/url_constants.h"
|
#include "content/public/common/url_constants.h"
|
||||||
#include "grit/cef_resources.h"
|
#include "grit/cef_resources.h"
|
||||||
|
#include "grit/tracing_resources.h"
|
||||||
#include "ipc/ipc_channel.h"
|
#include "ipc/ipc_channel.h"
|
||||||
#include "net/url_request/url_request.h"
|
#include "net/url_request/url_request.h"
|
||||||
#include "v8/include/v8.h"
|
#include "v8/include/v8.h"
|
||||||
@ -257,10 +258,10 @@ class Delegate : public InternalHandlerDelegate {
|
|||||||
|
|
||||||
bool OnTracing(const std::string& path, Action* action) {
|
bool OnTracing(const std::string& path, Action* action) {
|
||||||
if (path == "tracing.js") {
|
if (path == "tracing.js") {
|
||||||
action->resource_id = IDR_CEF_TRACING_JS;
|
action->resource_id = IDR_TRACING_JS;
|
||||||
} else {
|
} else {
|
||||||
action->mime_type = "text/html";
|
action->mime_type = "text/html";
|
||||||
action->resource_id = IDR_CEF_TRACING_HTML;
|
action->resource_id = IDR_TRACING_HTML;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
#include "include/cef_process_message.h"
|
#include "include/cef_process_message.h"
|
||||||
|
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "googleurl/src/gurl.h"
|
|
||||||
#include "net/url_request/url_request_job_factory.h"
|
#include "net/url_request/url_request_job_factory.h"
|
||||||
|
#include "url/gurl.h"
|
||||||
|
|
||||||
namespace base {
|
namespace base {
|
||||||
class ListValue;
|
class ListValue;
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
#include "content/public/browser/render_process_host.h"
|
#include "content/public/browser/render_process_host.h"
|
||||||
#include "content/public/browser/resource_dispatcher_host.h"
|
#include "content/public/browser/resource_dispatcher_host.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "googleurl/src/gurl.h"
|
|
||||||
#include "ui/base/ui_base_switches.h"
|
#include "ui/base/ui_base_switches.h"
|
||||||
|
#include "url/gurl.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ class CefPluginServiceFilter : public content::PluginServiceFilter {
|
|||||||
const void* context,
|
const void* context,
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
const GURL& policy_url,
|
const GURL& policy_url,
|
||||||
webkit::WebPluginInfo* plugin) OVERRIDE {
|
content::WebPluginInfo* plugin) OVERRIDE {
|
||||||
bool allowed = true;
|
bool allowed = true;
|
||||||
|
|
||||||
CefRefPtr<CefBrowserHostImpl> browser =
|
CefRefPtr<CefBrowserHostImpl> browser =
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "base/synchronization/lock.h"
|
#include "base/synchronization/lock.h"
|
||||||
#include "content/public/browser/content_browser_client.h"
|
#include "content/public/browser/content_browser_client.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
class CefBrowserContext;
|
class CefBrowserContext;
|
||||||
class CefBrowserInfo;
|
class CefBrowserInfo;
|
||||||
|
@ -182,7 +182,7 @@ bool CefContext::Initialize(const CefMainArgs& args,
|
|||||||
|
|
||||||
cache_path_ = base::FilePath(CefString(&settings.cache_path));
|
cache_path_ = base::FilePath(CefString(&settings.cache_path));
|
||||||
if (!cache_path_.empty() &&
|
if (!cache_path_.empty() &&
|
||||||
!file_util::DirectoryExists(cache_path_) &&
|
!base::DirectoryExists(cache_path_) &&
|
||||||
!file_util::CreateDirectory(cache_path_)) {
|
!file_util::CreateDirectory(cache_path_)) {
|
||||||
NOTREACHED() << "The cache_path directory could not be created";
|
NOTREACHED() << "The cache_path directory could not be created";
|
||||||
cache_path_ = base::FilePath();
|
cache_path_ = base::FilePath();
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/threading/thread_restrictions.h"
|
#include "base/threading/thread_restrictions.h"
|
||||||
#include "content/browser/net/sqlite_persistent_cookie_store.h"
|
#include "content/browser/net/sqlite_persistent_cookie_store.h"
|
||||||
#include "googleurl/src/gurl.h"
|
|
||||||
#include "net/cookies/cookie_util.h"
|
#include "net/cookies/cookie_util.h"
|
||||||
#include "net/cookies/parsed_cookie.h"
|
#include "net/cookies/parsed_cookie.h"
|
||||||
#include "net/url_request/url_request_context.h"
|
#include "net/url_request/url_request_context.h"
|
||||||
|
#include "url/gurl.h"
|
||||||
|
|
||||||
using content::BrowserThread;
|
using content::BrowserThread;
|
||||||
|
|
||||||
@ -285,7 +285,7 @@ bool CefCookieManagerImpl::SetStoragePath(
|
|||||||
// TODO(cef): Move directory creation to the blocking pool instead of
|
// TODO(cef): Move directory creation to the blocking pool instead of
|
||||||
// allowing file IO on this thread.
|
// allowing file IO on this thread.
|
||||||
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
||||||
if (file_util::DirectoryExists(new_path) ||
|
if (base::DirectoryExists(new_path) ||
|
||||||
file_util::CreateDirectory(new_path)) {
|
file_util::CreateDirectory(new_path)) {
|
||||||
const base::FilePath& cookie_path = new_path.AppendASCII("Cookies");
|
const base::FilePath& cookie_path = new_path.AppendASCII("Cookies");
|
||||||
persistent_store =
|
persistent_store =
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#include "base/rand_util.h"
|
#include "base/rand_util.h"
|
||||||
#include "base/strings/stringprintf.h"
|
#include "base/strings/stringprintf.h"
|
||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
#include "base/time.h"
|
#include "base/time/time.h"
|
||||||
#include "content/public/browser/devtools_http_handler.h"
|
#include "content/public/browser/devtools_http_handler.h"
|
||||||
#include "content/public/browser/render_process_host.h"
|
#include "content/public/browser/render_process_host.h"
|
||||||
#include "content/public/browser/render_view_host.h"
|
#include "content/public/browser/render_view_host.h"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "libcef/common/time_util.h"
|
#include "libcef/common/time_util.h"
|
||||||
|
|
||||||
#include "content/public/browser/download_item.h"
|
#include "content/public/browser/download_item.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
|
|
||||||
CefDownloadItemImpl::CefDownloadItemImpl(content::DownloadItem* value)
|
CefDownloadItemImpl::CefDownloadItemImpl(content::DownloadItem* value)
|
||||||
@ -76,7 +76,7 @@ CefString CefDownloadItemImpl::GetFullPath() {
|
|||||||
return const_value().GetFullPath().value();
|
return const_value().GetFullPath().value();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 CefDownloadItemImpl::GetId() {
|
uint32 CefDownloadItemImpl::GetId() {
|
||||||
CEF_VALUE_VERIFY_RETURN(false, 0);
|
CEF_VALUE_VERIFY_RETURN(false, 0);
|
||||||
return const_value().GetId();
|
return const_value().GetId();
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ class CefDownloadItemImpl
|
|||||||
virtual CefTime GetStartTime() OVERRIDE;
|
virtual CefTime GetStartTime() OVERRIDE;
|
||||||
virtual CefTime GetEndTime() OVERRIDE;
|
virtual CefTime GetEndTime() OVERRIDE;
|
||||||
virtual CefString GetFullPath() OVERRIDE;
|
virtual CefString GetFullPath() OVERRIDE;
|
||||||
virtual int32 GetId() OVERRIDE;
|
virtual uint32 GetId() OVERRIDE;
|
||||||
virtual CefString GetURL() OVERRIDE;
|
virtual CefString GetURL() OVERRIDE;
|
||||||
virtual CefString GetSuggestedFileName() OVERRIDE;
|
virtual CefString GetSuggestedFileName() OVERRIDE;
|
||||||
virtual CefString GetContentDisposition() OVERRIDE;
|
virtual CefString GetContentDisposition() OVERRIDE;
|
||||||
|
@ -53,7 +53,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
|
|||||||
public:
|
public:
|
||||||
CefBeforeDownloadCallbackImpl(
|
CefBeforeDownloadCallbackImpl(
|
||||||
const base::WeakPtr<DownloadManager>& manager,
|
const base::WeakPtr<DownloadManager>& manager,
|
||||||
int32 download_id,
|
uint32 download_id,
|
||||||
const base::FilePath& suggested_name,
|
const base::FilePath& suggested_name,
|
||||||
const content::DownloadTargetCallback& callback)
|
const content::DownloadTargetCallback& callback)
|
||||||
: manager_(manager),
|
: manager_(manager),
|
||||||
@ -88,7 +88,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
|
|||||||
private:
|
private:
|
||||||
static void GenerateFilename(
|
static void GenerateFilename(
|
||||||
base::WeakPtr<DownloadManager> manager,
|
base::WeakPtr<DownloadManager> manager,
|
||||||
int32 download_id,
|
uint32 download_id,
|
||||||
const base::FilePath& suggested_name,
|
const base::FilePath& suggested_name,
|
||||||
const base::FilePath& download_path,
|
const base::FilePath& download_path,
|
||||||
bool show_dialog,
|
bool show_dialog,
|
||||||
@ -97,7 +97,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
|
|||||||
if (!suggested_path.empty()) {
|
if (!suggested_path.empty()) {
|
||||||
// Create the directory if necessary.
|
// Create the directory if necessary.
|
||||||
base::FilePath dir_path = suggested_path.DirName();
|
base::FilePath dir_path = suggested_path.DirName();
|
||||||
if (!file_util::DirectoryExists(dir_path) &&
|
if (!base::DirectoryExists(dir_path) &&
|
||||||
!file_util::CreateDirectory(dir_path)) {
|
!file_util::CreateDirectory(dir_path)) {
|
||||||
NOTREACHED() << "failed to create the download directory";
|
NOTREACHED() << "failed to create the download directory";
|
||||||
suggested_path.clear();
|
suggested_path.clear();
|
||||||
@ -122,7 +122,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
|
|||||||
|
|
||||||
static void ChooseDownloadPath(
|
static void ChooseDownloadPath(
|
||||||
base::WeakPtr<DownloadManager> manager,
|
base::WeakPtr<DownloadManager> manager,
|
||||||
int32 download_id,
|
uint32 download_id,
|
||||||
const base::FilePath& suggested_path,
|
const base::FilePath& suggested_path,
|
||||||
bool show_dialog,
|
bool show_dialog,
|
||||||
const content::DownloadTargetCallback& callback) {
|
const content::DownloadTargetCallback& callback) {
|
||||||
@ -184,7 +184,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
base::WeakPtr<DownloadManager> manager_;
|
base::WeakPtr<DownloadManager> manager_;
|
||||||
int32 download_id_;
|
uint32 download_id_;
|
||||||
base::FilePath suggested_name_;
|
base::FilePath suggested_name_;
|
||||||
content::DownloadTargetCallback callback_;
|
content::DownloadTargetCallback callback_;
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback {
|
|||||||
public:
|
public:
|
||||||
explicit CefDownloadItemCallbackImpl(
|
explicit CefDownloadItemCallbackImpl(
|
||||||
const base::WeakPtr<DownloadManager>& manager,
|
const base::WeakPtr<DownloadManager>& manager,
|
||||||
int32 download_id)
|
uint32 download_id)
|
||||||
: manager_(manager),
|
: manager_(manager),
|
||||||
download_id_(download_id) {
|
download_id_(download_id) {
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
base::WeakPtr<DownloadManager> manager_;
|
base::WeakPtr<DownloadManager> manager_;
|
||||||
int32 download_id_;
|
uint32 download_id_;
|
||||||
|
|
||||||
IMPLEMENT_REFCOUNTING(CefDownloadItemCallbackImpl);
|
IMPLEMENT_REFCOUNTING(CefDownloadItemCallbackImpl);
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefDownloadItemCallbackImpl);
|
DISALLOW_COPY_AND_ASSIGN(CefDownloadItemCallbackImpl);
|
||||||
@ -341,3 +341,9 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget(
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CefDownloadManagerDelegate::GetNextId(
|
||||||
|
const content::DownloadIdCallback& callback) {
|
||||||
|
static uint32 next_id = DownloadItem::kInvalidId + 1;
|
||||||
|
callback.Run(next_id++);
|
||||||
|
}
|
||||||
|
@ -36,6 +36,7 @@ class CefDownloadManagerDelegate
|
|||||||
virtual bool DetermineDownloadTarget(
|
virtual bool DetermineDownloadTarget(
|
||||||
content::DownloadItem* item,
|
content::DownloadItem* item,
|
||||||
const content::DownloadTargetCallback& callback) OVERRIDE;
|
const content::DownloadTargetCallback& callback) OVERRIDE;
|
||||||
|
virtual void GetNextId(const content::DownloadIdCallback& callback) OVERRIDE;
|
||||||
|
|
||||||
content::DownloadManager* manager_;
|
content::DownloadManager* manager_;
|
||||||
base::WeakPtrFactory<content::DownloadManager> manager_ptr_factory_;
|
base::WeakPtrFactory<content::DownloadManager> manager_ptr_factory_;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include "include/cef_scheme.h"
|
#include "include/cef_scheme.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
namespace scheme {
|
namespace scheme {
|
||||||
|
|
||||||
|
@ -153,22 +153,33 @@ void CefMediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(
|
void CefMediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(
|
||||||
int render_process_id,
|
int render_process_id,
|
||||||
int render_view_id,
|
int render_view_id,
|
||||||
const content::MediaStreamDevice& device,
|
int page_request_id,
|
||||||
|
const content::MediaStreamDevice& device,
|
||||||
content::MediaRequestState state) {
|
content::MediaRequestState state) {
|
||||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||||
BrowserThread::PostTask(
|
BrowserThread::PostTask(
|
||||||
BrowserThread::UI, FROM_HERE,
|
BrowserThread::UI, FROM_HERE,
|
||||||
base::Bind(
|
base::Bind(
|
||||||
&CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread,
|
&CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread,
|
||||||
base::Unretained(this), render_process_id, render_view_id, device,
|
base::Unretained(this), render_process_id, render_view_id,
|
||||||
state));
|
page_request_id, device, state));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefMediaCaptureDevicesDispatcher::OnAudioStreamPlayingChanged(
|
void CefMediaCaptureDevicesDispatcher::OnAudioStreamPlayingChanged(
|
||||||
int render_process_id, int render_view_id, int stream_id, bool playing) {
|
int render_process_id,
|
||||||
|
int render_view_id,
|
||||||
|
int stream_id,
|
||||||
|
bool is_playing,
|
||||||
|
float power_dbfs,
|
||||||
|
bool clipped) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void CefMediaCaptureDevicesDispatcher::OnCreatingAudioStream(
|
||||||
|
int render_process_id,
|
||||||
|
int render_view_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefMediaCaptureDevicesDispatcher::UpdateAudioDevicesOnUIThread(
|
void CefMediaCaptureDevicesDispatcher::UpdateAudioDevicesOnUIThread(
|
||||||
@ -192,11 +203,13 @@ void CefMediaCaptureDevicesDispatcher::UpdateVideoDevicesOnUIThread(
|
|||||||
void CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread(
|
void CefMediaCaptureDevicesDispatcher::UpdateMediaRequestStateOnUIThread(
|
||||||
int render_process_id,
|
int render_process_id,
|
||||||
int render_view_id,
|
int render_view_id,
|
||||||
|
int page_request_id,
|
||||||
const content::MediaStreamDevice& device,
|
const content::MediaStreamDevice& device,
|
||||||
content::MediaRequestState state) {
|
content::MediaRequestState state) {
|
||||||
FOR_EACH_OBSERVER(Observer, observers_,
|
FOR_EACH_OBSERVER(Observer, observers_,
|
||||||
OnRequestUpdate(render_process_id,
|
OnRequestUpdate(render_process_id,
|
||||||
render_view_id,
|
render_view_id,
|
||||||
|
page_request_id,
|
||||||
device,
|
device,
|
||||||
state));
|
state));
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver {
|
|||||||
virtual void OnRequestUpdate(
|
virtual void OnRequestUpdate(
|
||||||
int render_process_id,
|
int render_process_id,
|
||||||
int render_view_id,
|
int render_view_id,
|
||||||
|
int page_request_id,
|
||||||
const content::MediaStreamDevice& device,
|
const content::MediaStreamDevice& device,
|
||||||
const content::MediaRequestState state) {}
|
const content::MediaRequestState state) {}
|
||||||
|
|
||||||
@ -78,15 +79,20 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver {
|
|||||||
virtual void OnVideoCaptureDevicesChanged(
|
virtual void OnVideoCaptureDevicesChanged(
|
||||||
const content::MediaStreamDevices& devices) OVERRIDE;
|
const content::MediaStreamDevices& devices) OVERRIDE;
|
||||||
virtual void OnMediaRequestStateChanged(
|
virtual void OnMediaRequestStateChanged(
|
||||||
int render_process_id,
|
int render_process_id,
|
||||||
int render_view_id,
|
int render_view_id,
|
||||||
const content::MediaStreamDevice& device,
|
int page_request_id,
|
||||||
|
const content::MediaStreamDevice& device,
|
||||||
content::MediaRequestState state) OVERRIDE;
|
content::MediaRequestState state) OVERRIDE;
|
||||||
virtual void OnAudioStreamPlayingChanged(
|
virtual void OnAudioStreamPlayingChanged(
|
||||||
int render_process_id,
|
int render_process_id,
|
||||||
int render_view_id,
|
int render_view_id,
|
||||||
int stream_id,
|
int stream_id,
|
||||||
bool playing) OVERRIDE;
|
bool is_playing,
|
||||||
|
float power_dbfs,
|
||||||
|
bool clipped) OVERRIDE;
|
||||||
|
virtual void OnCreatingAudioStream(int render_process_id,
|
||||||
|
int render_view_id) OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct DefaultSingletonTraits<CefMediaCaptureDevicesDispatcher>;
|
friend struct DefaultSingletonTraits<CefMediaCaptureDevicesDispatcher>;
|
||||||
@ -100,6 +106,7 @@ class CefMediaCaptureDevicesDispatcher : public content::MediaObserver {
|
|||||||
void UpdateMediaRequestStateOnUIThread(
|
void UpdateMediaRequestStateOnUIThread(
|
||||||
int render_process_id,
|
int render_process_id,
|
||||||
int render_view_id,
|
int render_view_id,
|
||||||
|
int page_request_id,
|
||||||
const content::MediaStreamDevice& device,
|
const content::MediaStreamDevice& device,
|
||||||
content::MediaRequestState state);
|
content::MediaRequestState state);
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "libcef/browser/menu_creator_runner_mac.h"
|
#include "libcef/browser/menu_creator_runner_mac.h"
|
||||||
#include "libcef/browser/browser_host_impl.h"
|
#include "libcef/browser/browser_host_impl.h"
|
||||||
|
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#import "base/mac/scoped_sending_event.h"
|
#import "base/mac/scoped_sending_event.h"
|
||||||
#include "content/public/browser/web_contents_view.h"
|
#include "content/public/browser/web_contents_view.h"
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "libcef/browser/menu_creator_runner_win.h"
|
#include "libcef/browser/menu_creator_runner_win.h"
|
||||||
#include "libcef/browser/browser_host_impl.h"
|
#include "libcef/browser/browser_host_impl.h"
|
||||||
|
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "content/public/browser/web_contents_view.h"
|
#include "content/public/browser/web_contents_view.h"
|
||||||
#include "ui/gfx/point.h"
|
#include "ui/gfx/point.h"
|
||||||
#include "ui/views/controls/menu/menu_2.h"
|
#include "ui/views/controls/menu/menu_2.h"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "ui/base/accelerators/accelerator.h"
|
#include "ui/base/accelerators/accelerator.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
#include "content/public/browser/global_request_id.h"
|
#include "content/public/browser/global_request_id.h"
|
||||||
#include "content/public/common/page_transition_types.h"
|
#include "content/public/common/page_transition_types.h"
|
||||||
#include "content/public/common/referrer.h"
|
#include "content/public/common/referrer.h"
|
||||||
#include "googleurl/src/gurl.h"
|
|
||||||
#include "net/base/upload_data.h"
|
#include "net/base/upload_data.h"
|
||||||
#include "ui/base/window_open_disposition.h"
|
#include "ui/base/window_open_disposition.h"
|
||||||
|
#include "url/gurl.h"
|
||||||
|
|
||||||
// Parameters that tell CefBrowserHostImpl::Navigate() what to do.
|
// Parameters that tell CefBrowserHostImpl::Navigate() what to do.
|
||||||
struct CefNavigateParams {
|
struct CefNavigateParams {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "base/lazy_instance.h"
|
#include "base/lazy_instance.h"
|
||||||
#include "base/synchronization/lock.h"
|
#include "base/synchronization/lock.h"
|
||||||
#include "content/public/browser/render_process_host.h"
|
#include "content/public/browser/render_process_host.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "libcef/browser/render_widget_host_view_osr.h"
|
#include "libcef/browser/render_widget_host_view_osr.h"
|
||||||
#include "libcef/common/content_client.h"
|
#include "libcef/common/content_client.h"
|
||||||
|
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
#include "content/browser/renderer_host/render_widget_host_impl.h"
|
||||||
#include "content/public/browser/content_browser_client.h"
|
#include "content/public/browser/content_browser_client.h"
|
||||||
#include "content/public/browser/render_view_host.h"
|
#include "content/public/browser/render_view_host.h"
|
||||||
@ -165,7 +165,7 @@ void CefRenderWidgetHostViewOSR::WasHidden() {
|
|||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::MovePluginWindows(
|
void CefRenderWidgetHostViewOSR::MovePluginWindows(
|
||||||
const gfx::Vector2d& scroll_offset,
|
const gfx::Vector2d& scroll_offset,
|
||||||
const std::vector<webkit::npapi::WebPluginGeometry>& moves) {
|
const std::vector<content::WebPluginGeometry>& moves) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::Focus() {
|
void CefRenderWidgetHostViewOSR::Focus() {
|
||||||
@ -206,7 +206,8 @@ void CefRenderWidgetHostViewOSR::SetIsLoading(bool is_loading) {
|
|||||||
#if !defined(OS_MACOSX)
|
#if !defined(OS_MACOSX)
|
||||||
void CefRenderWidgetHostViewOSR::TextInputTypeChanged(
|
void CefRenderWidgetHostViewOSR::TextInputTypeChanged(
|
||||||
ui::TextInputType type,
|
ui::TextInputType type,
|
||||||
bool can_compose_inline) {
|
bool can_compose_inline,
|
||||||
|
ui::TextInputMode mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
|
void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
|
||||||
@ -232,7 +233,7 @@ void CefRenderWidgetHostViewOSR::DidUpdateBackingStore(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::RenderViewGone(
|
void CefRenderWidgetHostViewOSR::RenderProcessGone(
|
||||||
base::TerminationStatus status,
|
base::TerminationStatus status,
|
||||||
int error_code) {
|
int error_code) {
|
||||||
render_widget_host_ = NULL;
|
render_widget_host_ = NULL;
|
||||||
|
@ -113,13 +113,14 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase {
|
|||||||
virtual void WasHidden() OVERRIDE;
|
virtual void WasHidden() OVERRIDE;
|
||||||
virtual void MovePluginWindows(
|
virtual void MovePluginWindows(
|
||||||
const gfx::Vector2d& scroll_offset,
|
const gfx::Vector2d& scroll_offset,
|
||||||
const std::vector<webkit::npapi::WebPluginGeometry>& moves) OVERRIDE;
|
const std::vector<content::WebPluginGeometry>& moves) OVERRIDE;
|
||||||
virtual void Focus() OVERRIDE;
|
virtual void Focus() OVERRIDE;
|
||||||
virtual void Blur() OVERRIDE;
|
virtual void Blur() OVERRIDE;
|
||||||
virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE;
|
virtual void UpdateCursor(const WebCursor& cursor) OVERRIDE;
|
||||||
virtual void SetIsLoading(bool is_loading) OVERRIDE;
|
virtual void SetIsLoading(bool is_loading) OVERRIDE;
|
||||||
virtual void TextInputTypeChanged(ui::TextInputType type,
|
virtual void TextInputTypeChanged(ui::TextInputType type,
|
||||||
bool can_compose_inline) OVERRIDE;
|
bool can_compose_inline,
|
||||||
|
ui::TextInputMode mode) OVERRIDE;
|
||||||
virtual void ImeCancelComposition() OVERRIDE;
|
virtual void ImeCancelComposition() OVERRIDE;
|
||||||
virtual void ImeCompositionRangeChanged(
|
virtual void ImeCompositionRangeChanged(
|
||||||
const ui::Range& range,
|
const ui::Range& range,
|
||||||
@ -129,7 +130,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase {
|
|||||||
const gfx::Vector2d& scroll_delta,
|
const gfx::Vector2d& scroll_delta,
|
||||||
const std::vector<gfx::Rect>& copy_rects,
|
const std::vector<gfx::Rect>& copy_rects,
|
||||||
const ui::LatencyInfo& latency_info) OVERRIDE;
|
const ui::LatencyInfo& latency_info) OVERRIDE;
|
||||||
virtual void RenderViewGone(base::TerminationStatus status,
|
virtual void RenderProcessGone(base::TerminationStatus status,
|
||||||
int error_code) OVERRIDE;
|
int error_code) OVERRIDE;
|
||||||
#if defined(OS_WIN) && !defined(USE_AURA)
|
#if defined(OS_WIN) && !defined(USE_AURA)
|
||||||
virtual void WillWmDestroy() OVERRIDE;
|
virtual void WillWmDestroy() OVERRIDE;
|
||||||
|
@ -76,7 +76,8 @@ void CefRenderWidgetHostViewOSR::ImeCancelComposition() {
|
|||||||
|
|
||||||
void CefRenderWidgetHostViewOSR::TextInputTypeChanged(
|
void CefRenderWidgetHostViewOSR::TextInputTypeChanged(
|
||||||
ui::TextInputType type,
|
ui::TextInputType type,
|
||||||
bool can_compose_inline) {
|
bool can_compose_inline,
|
||||||
|
ui::TextInputMode mode) {
|
||||||
[NSApp updateWindows];
|
[NSApp updateWindows];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "include/cef_frame.h"
|
#include "include/cef_frame.h"
|
||||||
|
|
||||||
#include "content/public/browser/content_browser_client.h"
|
#include "content/public/browser/content_browser_client.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
namespace net {
|
namespace net {
|
||||||
class FtpTransactionFactory;
|
class FtpTransactionFactory;
|
||||||
|
@ -21,10 +21,9 @@
|
|||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/lazy_instance.h"
|
#include "base/lazy_instance.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "base/strings/string_util.h"
|
#include "base/strings/string_util.h"
|
||||||
#include "base/synchronization/lock.h"
|
#include "base/synchronization/lock.h"
|
||||||
#include "googleurl/src/url_util.h"
|
|
||||||
#include "net/base/completion_callback.h"
|
#include "net/base/completion_callback.h"
|
||||||
#include "net/base/io_buffer.h"
|
#include "net/base/io_buffer.h"
|
||||||
#include "net/base/upload_data.h"
|
#include "net/base/upload_data.h"
|
||||||
@ -36,6 +35,7 @@
|
|||||||
#include "net/url_request/url_request_http_job.h"
|
#include "net/url_request/url_request_http_job.h"
|
||||||
#include "net/url_request/url_request_job.h"
|
#include "net/url_request/url_request_job.h"
|
||||||
#include "net/url_request/url_request_job_factory_impl.h"
|
#include "net/url_request/url_request_job_factory_impl.h"
|
||||||
|
#include "url/url_util.h"
|
||||||
|
|
||||||
using net::URLRequestStatus;
|
using net::URLRequestStatus;
|
||||||
|
|
||||||
|
@ -1,217 +1,228 @@
|
|||||||
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "libcef/browser/speech_recognition_manager_delegate.h"
|
#include "libcef/browser/speech_recognition_manager_delegate.h"
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "base/bind.h"
|
#include "libcef/common/cef_switches.h"
|
||||||
#include "content/public/browser/browser_thread.h"
|
|
||||||
#include "content/public/browser/notification_observer.h"
|
#include "base/bind.h"
|
||||||
#include "content/public/browser/notification_registrar.h"
|
#include "base/command_line.h"
|
||||||
#include "content/public/browser/notification_source.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
#include "content/public/browser/notification_types.h"
|
#include "content/public/browser/notification_observer.h"
|
||||||
#include "content/public/browser/render_process_host.h"
|
#include "content/public/browser/notification_registrar.h"
|
||||||
#include "content/public/browser/render_view_host.h"
|
#include "content/public/browser/notification_source.h"
|
||||||
#include "content/public/browser/speech_recognition_manager.h"
|
#include "content/public/browser/notification_types.h"
|
||||||
#include "content/public/browser/speech_recognition_session_context.h"
|
#include "content/public/browser/render_process_host.h"
|
||||||
#include "content/public/browser/web_contents.h"
|
#include "content/public/browser/render_view_host.h"
|
||||||
#include "content/public/common/speech_recognition_error.h"
|
#include "content/public/browser/speech_recognition_manager.h"
|
||||||
#include "content/public/common/speech_recognition_result.h"
|
#include "content/public/browser/speech_recognition_session_context.h"
|
||||||
|
#include "content/public/browser/web_contents.h"
|
||||||
using content::BrowserThread;
|
#include "content/public/common/speech_recognition_error.h"
|
||||||
using content::SpeechRecognitionManager;
|
#include "content/public/common/speech_recognition_result.h"
|
||||||
using content::WebContents;
|
|
||||||
|
using content::BrowserThread;
|
||||||
// Simple utility to get notified when a WebContents is closed or crashes.
|
using content::SpeechRecognitionManager;
|
||||||
// Both the callback site and the callback thread are passed by the caller in
|
using content::WebContents;
|
||||||
// the constructor. There is no restriction on the constructor, however this
|
|
||||||
// class must be destroyed on the UI thread, due to the NotificationRegistrar
|
// Simple utility to get notified when a WebContents is closed or crashes.
|
||||||
// dependency.
|
// Both the callback site and the callback thread are passed by the caller in
|
||||||
class CefSpeechRecognitionManagerDelegate::WebContentsWatcher
|
// the constructor. There is no restriction on the constructor, however this
|
||||||
: public base::RefCountedThreadSafe<WebContentsWatcher>,
|
// class must be destroyed on the UI thread, due to the NotificationRegistrar
|
||||||
public content::NotificationObserver {
|
// dependency.
|
||||||
public:
|
class CefSpeechRecognitionManagerDelegate::WebContentsWatcher
|
||||||
typedef base::Callback<void(int render_process_id, int render_view_id)>
|
: public base::RefCountedThreadSafe<WebContentsWatcher>,
|
||||||
WebContentsClosedCallback;
|
public content::NotificationObserver {
|
||||||
|
public:
|
||||||
WebContentsWatcher(WebContentsClosedCallback web_contents_closed_callback,
|
typedef base::Callback<void(int render_process_id, int render_view_id)>
|
||||||
BrowserThread::ID callback_thread)
|
WebContentsClosedCallback;
|
||||||
: web_contents_closed_callback_(web_contents_closed_callback),
|
|
||||||
callback_thread_(callback_thread) {
|
WebContentsWatcher(WebContentsClosedCallback web_contents_closed_callback,
|
||||||
}
|
BrowserThread::ID callback_thread)
|
||||||
|
: web_contents_closed_callback_(web_contents_closed_callback),
|
||||||
// Starts monitoring the WebContents corresponding to the given
|
callback_thread_(callback_thread) {
|
||||||
// |render_process_id|, |render_view_id| pair, invoking
|
}
|
||||||
// |web_contents_closed_callback_| if closed/unloaded.
|
|
||||||
void Watch(int render_process_id, int render_view_id) {
|
// Starts monitoring the WebContents corresponding to the given
|
||||||
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
// |render_process_id|, |render_view_id| pair, invoking
|
||||||
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
|
// |web_contents_closed_callback_| if closed/unloaded.
|
||||||
&WebContentsWatcher::Watch, this, render_process_id, render_view_id));
|
void Watch(int render_process_id, int render_view_id) {
|
||||||
return;
|
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
||||||
}
|
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
|
||||||
|
&WebContentsWatcher::Watch, this, render_process_id, render_view_id));
|
||||||
WebContents* web_contents = NULL;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
WebContents* web_contents = NULL;
|
||||||
content::RenderViewHost* render_view_host =
|
content::RenderViewHost* render_view_host =
|
||||||
content::RenderViewHost::FromID(render_process_id, render_view_id);
|
content::RenderViewHost::FromID(render_process_id, render_view_id);
|
||||||
if (render_view_host)
|
if (render_view_host)
|
||||||
web_contents = WebContents::FromRenderViewHost(render_view_host);
|
web_contents = WebContents::FromRenderViewHost(render_view_host);
|
||||||
DCHECK(web_contents);
|
DCHECK(web_contents);
|
||||||
|
|
||||||
// Avoid multiple registrations on |registrar_| for the same |web_contents|.
|
// Avoid multiple registrations on |registrar_| for the same |web_contents|.
|
||||||
if (registered_web_contents_.find(web_contents) !=
|
if (registered_web_contents_.find(web_contents) !=
|
||||||
registered_web_contents_.end()) {
|
registered_web_contents_.end()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
registered_web_contents_.insert(web_contents);
|
registered_web_contents_.insert(web_contents);
|
||||||
|
|
||||||
// Lazy initialize the registrar.
|
// Lazy initialize the registrar.
|
||||||
if (!registrar_.get())
|
if (!registrar_.get())
|
||||||
registrar_.reset(new content::NotificationRegistrar());
|
registrar_.reset(new content::NotificationRegistrar());
|
||||||
|
|
||||||
registrar_->Add(this,
|
registrar_->Add(this,
|
||||||
content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED,
|
content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED,
|
||||||
content::Source<WebContents>(web_contents));
|
content::Source<WebContents>(web_contents));
|
||||||
}
|
}
|
||||||
|
|
||||||
// content::NotificationObserver implementation.
|
// content::NotificationObserver implementation.
|
||||||
virtual void Observe(int type,
|
virtual void Observe(int type,
|
||||||
const content::NotificationSource& source,
|
const content::NotificationSource& source,
|
||||||
const content::NotificationDetails& details) OVERRIDE {
|
const content::NotificationDetails& details) OVERRIDE {
|
||||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||||
DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, type);
|
DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED, type);
|
||||||
|
|
||||||
WebContents* web_contents = content::Source<WebContents>(source).ptr();
|
WebContents* web_contents = content::Source<WebContents>(source).ptr();
|
||||||
int render_process_id = web_contents->GetRenderProcessHost()->GetID();
|
int render_process_id = web_contents->GetRenderProcessHost()->GetID();
|
||||||
int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
|
int render_view_id = web_contents->GetRenderViewHost()->GetRoutingID();
|
||||||
|
|
||||||
registrar_->Remove(this,
|
registrar_->Remove(this,
|
||||||
content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED,
|
content::NOTIFICATION_WEB_CONTENTS_DISCONNECTED,
|
||||||
content::Source<WebContents>(web_contents));
|
content::Source<WebContents>(web_contents));
|
||||||
registered_web_contents_.erase(web_contents);
|
registered_web_contents_.erase(web_contents);
|
||||||
|
|
||||||
BrowserThread::PostTask(callback_thread_, FROM_HERE, base::Bind(
|
BrowserThread::PostTask(callback_thread_, FROM_HERE, base::Bind(
|
||||||
web_contents_closed_callback_, render_process_id, render_view_id));
|
web_contents_closed_callback_, render_process_id, render_view_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class base::RefCountedThreadSafe<WebContentsWatcher>;
|
friend class base::RefCountedThreadSafe<WebContentsWatcher>;
|
||||||
|
|
||||||
virtual ~WebContentsWatcher() {
|
virtual ~WebContentsWatcher() {
|
||||||
// Must be destroyed on the UI thread due to |registrar_| non thread-safety.
|
// Must be destroyed on the UI thread due to |registrar_| non thread-safety.
|
||||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lazy-initialized and used on the UI thread to handle web contents
|
// Lazy-initialized and used on the UI thread to handle web contents
|
||||||
// notifications (tab closing).
|
// notifications (tab closing).
|
||||||
scoped_ptr<content::NotificationRegistrar> registrar_;
|
scoped_ptr<content::NotificationRegistrar> registrar_;
|
||||||
|
|
||||||
// Keeps track of which WebContent(s) have been registered, in order to avoid
|
// Keeps track of which WebContent(s) have been registered, in order to avoid
|
||||||
// double registrations on |registrar_|
|
// double registrations on |registrar_|
|
||||||
std::set<content::WebContents*> registered_web_contents_;
|
std::set<content::WebContents*> registered_web_contents_;
|
||||||
|
|
||||||
// Callback used to notify, on the thread specified by |callback_thread_| the
|
// Callback used to notify, on the thread specified by |callback_thread_| the
|
||||||
// closure of a registered tab.
|
// closure of a registered tab.
|
||||||
WebContentsClosedCallback web_contents_closed_callback_;
|
WebContentsClosedCallback web_contents_closed_callback_;
|
||||||
content::BrowserThread::ID callback_thread_;
|
content::BrowserThread::ID callback_thread_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WebContentsWatcher);
|
DISALLOW_COPY_AND_ASSIGN(WebContentsWatcher);
|
||||||
};
|
};
|
||||||
|
|
||||||
CefSpeechRecognitionManagerDelegate
|
CefSpeechRecognitionManagerDelegate
|
||||||
::CefSpeechRecognitionManagerDelegate() {
|
::CefSpeechRecognitionManagerDelegate() {
|
||||||
}
|
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
||||||
|
filter_profanities_ =
|
||||||
CefSpeechRecognitionManagerDelegate
|
command_line.HasSwitch(switches::kEnableProfanityFilter);
|
||||||
::~CefSpeechRecognitionManagerDelegate() {
|
}
|
||||||
}
|
|
||||||
|
CefSpeechRecognitionManagerDelegate
|
||||||
void CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback(
|
::~CefSpeechRecognitionManagerDelegate() {
|
||||||
int render_process_id, int render_view_id) {
|
}
|
||||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
|
||||||
|
void CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback(
|
||||||
SpeechRecognitionManager* manager = SpeechRecognitionManager::GetInstance();
|
int render_process_id, int render_view_id) {
|
||||||
// |manager| becomes NULL if a browser shutdown happens between the post of
|
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||||
// this task (from the UI thread) and this call (on the IO thread). In this
|
|
||||||
// case we just return.
|
SpeechRecognitionManager* manager = SpeechRecognitionManager::GetInstance();
|
||||||
if (!manager)
|
// |manager| becomes NULL if a browser shutdown happens between the post of
|
||||||
return;
|
// this task (from the UI thread) and this call (on the IO thread). In this
|
||||||
|
// case we just return.
|
||||||
manager->AbortAllSessionsForRenderView(render_process_id, render_view_id);
|
if (!manager)
|
||||||
}
|
return;
|
||||||
|
|
||||||
void CefSpeechRecognitionManagerDelegate::OnRecognitionStart(
|
manager->AbortAllSessionsForRenderView(render_process_id, render_view_id);
|
||||||
int session_id) {
|
}
|
||||||
const content::SpeechRecognitionSessionContext& context =
|
|
||||||
SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id);
|
void CefSpeechRecognitionManagerDelegate::OnRecognitionStart(
|
||||||
|
int session_id) {
|
||||||
// Register callback to auto abort session on tab closure.
|
const content::SpeechRecognitionSessionContext& context =
|
||||||
// |web_contents_watcher_| is lazyly istantiated on the first call.
|
SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id);
|
||||||
if (!web_contents_watcher_.get()) {
|
|
||||||
web_contents_watcher_ = new WebContentsWatcher(
|
// Register callback to auto abort session on tab closure.
|
||||||
base::Bind(
|
// |web_contents_watcher_| is lazyly istantiated on the first call.
|
||||||
&CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback,
|
if (!web_contents_watcher_.get()) {
|
||||||
base::Unretained(this)),
|
web_contents_watcher_ = new WebContentsWatcher(
|
||||||
BrowserThread::IO);
|
base::Bind(
|
||||||
}
|
&CefSpeechRecognitionManagerDelegate::WebContentsClosedCallback,
|
||||||
web_contents_watcher_->Watch(context.render_process_id,
|
base::Unretained(this)),
|
||||||
context.render_view_id);
|
BrowserThread::IO);
|
||||||
}
|
}
|
||||||
|
web_contents_watcher_->Watch(context.render_process_id,
|
||||||
void CefSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) {
|
context.render_view_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefSpeechRecognitionManagerDelegate::OnEnvironmentEstimationComplete(
|
void CefSpeechRecognitionManagerDelegate::OnAudioStart(int session_id) {
|
||||||
int session_id) {
|
}
|
||||||
}
|
|
||||||
|
void CefSpeechRecognitionManagerDelegate::OnEnvironmentEstimationComplete(
|
||||||
void CefSpeechRecognitionManagerDelegate::OnSoundStart(int session_id) {
|
int session_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefSpeechRecognitionManagerDelegate::OnSoundEnd(int session_id) {
|
void CefSpeechRecognitionManagerDelegate::OnSoundStart(int session_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) {
|
void CefSpeechRecognitionManagerDelegate::OnSoundEnd(int session_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefSpeechRecognitionManagerDelegate::OnRecognitionResults(
|
void CefSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) {
|
||||||
int session_id, const content::SpeechRecognitionResults& result) {
|
}
|
||||||
}
|
|
||||||
|
void CefSpeechRecognitionManagerDelegate::OnRecognitionResults(
|
||||||
void CefSpeechRecognitionManagerDelegate::OnRecognitionError(
|
int session_id, const content::SpeechRecognitionResults& result) {
|
||||||
int session_id, const content::SpeechRecognitionError& error) {
|
}
|
||||||
}
|
|
||||||
|
void CefSpeechRecognitionManagerDelegate::OnRecognitionError(
|
||||||
void CefSpeechRecognitionManagerDelegate::OnAudioLevelsChange(
|
int session_id, const content::SpeechRecognitionError& error) {
|
||||||
int session_id, float volume, float noise_volume) {
|
}
|
||||||
}
|
|
||||||
|
void CefSpeechRecognitionManagerDelegate::OnAudioLevelsChange(
|
||||||
void CefSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) {
|
int session_id, float volume, float noise_volume) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefSpeechRecognitionManagerDelegate::GetDiagnosticInformation(
|
void CefSpeechRecognitionManagerDelegate::OnRecognitionEnd(int session_id) {
|
||||||
bool* can_report_metrics,
|
}
|
||||||
std::string* hardware_info) {
|
|
||||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
void CefSpeechRecognitionManagerDelegate::GetDiagnosticInformation(
|
||||||
}
|
bool* can_report_metrics,
|
||||||
|
std::string* hardware_info) {
|
||||||
void CefSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
|
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||||
int session_id,
|
}
|
||||||
base::Callback<void(bool ask_user, bool is_allowed)> callback) {
|
|
||||||
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
void CefSpeechRecognitionManagerDelegate::CheckRecognitionIsAllowed(
|
||||||
|
int session_id,
|
||||||
const content::SpeechRecognitionSessionContext& context =
|
base::Callback<void(bool ask_user, bool is_allowed)> callback) {
|
||||||
SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id);
|
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
||||||
|
|
||||||
// Make sure that initiators properly set the |render_process_id| field.
|
const content::SpeechRecognitionSessionContext& context =
|
||||||
DCHECK_NE(context.render_process_id, 0);
|
SpeechRecognitionManager::GetInstance()->GetSessionContext(session_id);
|
||||||
|
|
||||||
callback.Run(false, true);
|
// Make sure that initiators properly set the |render_process_id| field.
|
||||||
}
|
DCHECK_NE(context.render_process_id, 0);
|
||||||
|
|
||||||
content::SpeechRecognitionEventListener*
|
callback.Run(false, true);
|
||||||
CefSpeechRecognitionManagerDelegate::GetEventListener() {
|
}
|
||||||
return this;
|
|
||||||
}
|
content::SpeechRecognitionEventListener*
|
||||||
|
CefSpeechRecognitionManagerDelegate::GetEventListener() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CefSpeechRecognitionManagerDelegate::FilterProfanities(
|
||||||
|
int render_process_id) {
|
||||||
|
return filter_profanities_;
|
||||||
|
}
|
||||||
|
@ -45,6 +45,7 @@ class CefSpeechRecognitionManagerDelegate
|
|||||||
int session_id,
|
int session_id,
|
||||||
base::Callback<void(bool ask_user, bool is_allowed)> callback) OVERRIDE;
|
base::Callback<void(bool ask_user, bool is_allowed)> callback) OVERRIDE;
|
||||||
virtual content::SpeechRecognitionEventListener* GetEventListener() OVERRIDE;
|
virtual content::SpeechRecognitionEventListener* GetEventListener() OVERRIDE;
|
||||||
|
virtual bool FilterProfanities(int render_process_id) OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class WebContentsWatcher;
|
class WebContentsWatcher;
|
||||||
@ -54,6 +55,7 @@ class CefSpeechRecognitionManagerDelegate
|
|||||||
void WebContentsClosedCallback(int render_process_id, int render_view_id);
|
void WebContentsClosedCallback(int render_process_id, int render_view_id);
|
||||||
|
|
||||||
scoped_refptr<WebContentsWatcher> web_contents_watcher_;
|
scoped_refptr<WebContentsWatcher> web_contents_watcher_;
|
||||||
|
bool filter_profanities_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(CefSpeechRecognitionManagerDelegate);
|
DISALLOW_COPY_AND_ASSIGN(CefSpeechRecognitionManagerDelegate);
|
||||||
};
|
};
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "libcef/browser/thread_util.h"
|
#include "libcef/browser/thread_util.h"
|
||||||
|
|
||||||
#include "base/debug/trace_event.h"
|
#include "base/debug/trace_event.h"
|
||||||
#include "base/time.h"
|
#include "base/time/time.h"
|
||||||
|
|
||||||
bool CefBeginTracing(CefRefPtr<CefTraceClient> client,
|
bool CefBeginTracing(CefRefPtr<CefTraceClient> client,
|
||||||
const CefString& categories) {
|
const CefString& categories) {
|
||||||
|
@ -130,7 +130,9 @@ net::URLRequestContext* CefURLRequestContextGetter::GetURLRequestContext() {
|
|||||||
std::string(),
|
std::string(),
|
||||||
false,
|
false,
|
||||||
false));
|
false));
|
||||||
storage_->set_http_server_properties(new net::HttpServerPropertiesImpl);
|
storage_->set_http_server_properties(
|
||||||
|
make_scoped_ptr<net::HttpServerProperties>(
|
||||||
|
new net::HttpServerPropertiesImpl));
|
||||||
|
|
||||||
net::HttpCache::DefaultBackend* main_backend =
|
net::HttpCache::DefaultBackend* main_backend =
|
||||||
new net::HttpCache::DefaultBackend(
|
new net::HttpCache::DefaultBackend(
|
||||||
@ -216,7 +218,7 @@ void CefURLRequestContextGetter::SetCookieStoragePath(
|
|||||||
// TODO(cef): Move directory creation to the blocking pool instead of
|
// TODO(cef): Move directory creation to the blocking pool instead of
|
||||||
// allowing file IO on this thread.
|
// allowing file IO on this thread.
|
||||||
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
base::ThreadRestrictions::ScopedAllowIO allow_io;
|
||||||
if (file_util::DirectoryExists(path) ||
|
if (base::DirectoryExists(path) ||
|
||||||
file_util::CreateDirectory(path)) {
|
file_util::CreateDirectory(path)) {
|
||||||
const base::FilePath& cookie_path = path.AppendASCII("Cookies");
|
const base::FilePath& cookie_path = path.AppendASCII("Cookies");
|
||||||
persistent_store =
|
persistent_store =
|
||||||
|
@ -95,7 +95,7 @@ void CefWebContentsViewOSR::StoreFocus() {
|
|||||||
void CefWebContentsViewOSR::RestoreFocus() {
|
void CefWebContentsViewOSR::RestoreFocus() {
|
||||||
}
|
}
|
||||||
|
|
||||||
WebDropData* CefWebContentsViewOSR::GetDropData() const {
|
content::DropData* CefWebContentsViewOSR::GetDropData() const {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,7 +121,8 @@ bool CefWebContentsViewOSR::GetAllowOverlappingViews() const {
|
|||||||
|
|
||||||
// RenderViewHostDelegateView methods.
|
// RenderViewHostDelegateView methods.
|
||||||
|
|
||||||
void CefWebContentsViewOSR::StartDragging(const WebDropData& drop_data,
|
void CefWebContentsViewOSR::StartDragging(
|
||||||
|
const content::DropData& drop_data,
|
||||||
WebKit::WebDragOperationsMask allowed_ops,
|
WebKit::WebDragOperationsMask allowed_ops,
|
||||||
const gfx::ImageSkia& image,
|
const gfx::ImageSkia& image,
|
||||||
const gfx::Vector2d& image_offset,
|
const gfx::Vector2d& image_offset,
|
||||||
@ -130,11 +131,12 @@ void CefWebContentsViewOSR::StartDragging(const WebDropData& drop_data,
|
|||||||
web_contents_->SystemDragEnded();
|
web_contents_->SystemDragEnded();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefWebContentsViewOSR::ShowPopupMenu(const gfx::Rect& bounds,
|
void CefWebContentsViewOSR::ShowPopupMenu(
|
||||||
|
const gfx::Rect& bounds,
|
||||||
int item_height,
|
int item_height,
|
||||||
double item_font_size,
|
double item_font_size,
|
||||||
int selected_item,
|
int selected_item,
|
||||||
const std::vector<WebMenuItem>& items,
|
const std::vector<content::MenuItem>& items,
|
||||||
bool right_aligned,
|
bool right_aligned,
|
||||||
bool allow_multiple_selection) {
|
bool allow_multiple_selection) {
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ class CefWebContentsViewOSR : public content::WebContentsViewPort,
|
|||||||
virtual void SetInitialFocus() OVERRIDE;
|
virtual void SetInitialFocus() OVERRIDE;
|
||||||
virtual void StoreFocus() OVERRIDE;
|
virtual void StoreFocus() OVERRIDE;
|
||||||
virtual void RestoreFocus() OVERRIDE;
|
virtual void RestoreFocus() OVERRIDE;
|
||||||
virtual WebDropData* GetDropData() const OVERRIDE;
|
virtual content::DropData* GetDropData() const OVERRIDE;
|
||||||
virtual gfx::Rect GetViewBounds() const OVERRIDE;
|
virtual gfx::Rect GetViewBounds() const OVERRIDE;
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
virtual bool IsEventTracking() const OVERRIDE;
|
virtual bool IsEventTracking() const OVERRIDE;
|
||||||
@ -58,16 +58,18 @@ class CefWebContentsViewOSR : public content::WebContentsViewPort,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// RenderViewHostDelegateView methods.
|
// RenderViewHostDelegateView methods.
|
||||||
virtual void StartDragging(const WebDropData& drop_data,
|
virtual void StartDragging(
|
||||||
|
const content::DropData& drop_data,
|
||||||
WebKit::WebDragOperationsMask allowed_ops,
|
WebKit::WebDragOperationsMask allowed_ops,
|
||||||
const gfx::ImageSkia& image,
|
const gfx::ImageSkia& image,
|
||||||
const gfx::Vector2d& image_offset,
|
const gfx::Vector2d& image_offset,
|
||||||
const content::DragEventSourceInfo& event_info) OVERRIDE;
|
const content::DragEventSourceInfo& event_info) OVERRIDE;
|
||||||
virtual void ShowPopupMenu(const gfx::Rect& bounds,
|
virtual void ShowPopupMenu(
|
||||||
|
const gfx::Rect& bounds,
|
||||||
int item_height,
|
int item_height,
|
||||||
double item_font_size,
|
double item_font_size,
|
||||||
int selected_item,
|
int selected_item,
|
||||||
const std::vector<WebMenuItem>& items,
|
const std::vector<content::MenuItem>& items,
|
||||||
bool right_aligned,
|
bool right_aligned,
|
||||||
bool allow_multiple_selection) OVERRIDE;
|
bool allow_multiple_selection) OVERRIDE;
|
||||||
|
|
||||||
|
@ -14,13 +14,13 @@ namespace {
|
|||||||
|
|
||||||
void PluginsCallbackImpl(
|
void PluginsCallbackImpl(
|
||||||
CefRefPtr<CefWebPluginInfoVisitor> visitor,
|
CefRefPtr<CefWebPluginInfoVisitor> visitor,
|
||||||
const std::vector<webkit::WebPluginInfo>& all_plugins) {
|
const std::vector<content::WebPluginInfo>& all_plugins) {
|
||||||
CEF_REQUIRE_UIT();
|
CEF_REQUIRE_UIT();
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int total = static_cast<int>(all_plugins.size());
|
int total = static_cast<int>(all_plugins.size());
|
||||||
|
|
||||||
std::vector<webkit::WebPluginInfo>::const_iterator it = all_plugins.begin();
|
std::vector<content::WebPluginInfo>::const_iterator it = all_plugins.begin();
|
||||||
for (; it != all_plugins.end(); ++it, ++count) {
|
for (; it != all_plugins.end(); ++it, ++count) {
|
||||||
CefRefPtr<CefWebPluginInfoImpl> info(new CefWebPluginInfoImpl(*it));
|
CefRefPtr<CefWebPluginInfoImpl> info(new CefWebPluginInfoImpl(*it));
|
||||||
if (!visitor->Visit(info.get(), count, total))
|
if (!visitor->Visit(info.get(), count, total))
|
||||||
@ -34,7 +34,7 @@ void PluginsCallbackImpl(
|
|||||||
// CefWebPluginInfoImpl
|
// CefWebPluginInfoImpl
|
||||||
|
|
||||||
CefWebPluginInfoImpl::CefWebPluginInfoImpl(
|
CefWebPluginInfoImpl::CefWebPluginInfoImpl(
|
||||||
const webkit::WebPluginInfo& plugin_info)
|
const content::WebPluginInfo& plugin_info)
|
||||||
: plugin_info_(plugin_info) {
|
: plugin_info_(plugin_info) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "include/cef_web_plugin.h"
|
#include "include/cef_web_plugin.h"
|
||||||
#include "webkit/plugins/webplugininfo.h"
|
#include "content/public/common/webplugininfo.h"
|
||||||
|
|
||||||
class CefWebPluginInfoImpl : public CefWebPluginInfo {
|
class CefWebPluginInfoImpl : public CefWebPluginInfo {
|
||||||
public:
|
public:
|
||||||
explicit CefWebPluginInfoImpl(const webkit::WebPluginInfo& plugin_info);
|
explicit CefWebPluginInfoImpl(const content::WebPluginInfo& plugin_info);
|
||||||
|
|
||||||
virtual CefString GetName() OVERRIDE;
|
virtual CefString GetName() OVERRIDE;
|
||||||
virtual CefString GetPath() OVERRIDE;
|
virtual CefString GetPath() OVERRIDE;
|
||||||
@ -19,7 +19,7 @@ class CefWebPluginInfoImpl : public CefWebPluginInfo {
|
|||||||
virtual CefString GetDescription() OVERRIDE;
|
virtual CefString GetDescription() OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
webkit::WebPluginInfo plugin_info_;
|
content::WebPluginInfo plugin_info_;
|
||||||
|
|
||||||
IMPLEMENT_REFCOUNTING(CefWebPluginInfoImpl);
|
IMPLEMENT_REFCOUNTING(CefWebPluginInfoImpl);
|
||||||
};
|
};
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
// IPC messages for CEF.
|
// IPC messages for CEF.
|
||||||
// Multiply-included message file, hence no include guard.
|
// Multiply-included message file, hence no include guard.
|
||||||
|
|
||||||
#include "base/shared_memory.h"
|
#include "base/memory/shared_memory.h"
|
||||||
#include "base/values.h"
|
#include "base/values.h"
|
||||||
#include "content/public/common/common_param_traits.h"
|
#include "content/public/common/common_param_traits.h"
|
||||||
#include "content/public/common/referrer.h"
|
#include "content/public/common/referrer.h"
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "libcef/common/drag_data_impl.h"
|
#include "libcef/common/drag_data_impl.h"
|
||||||
#include "base/files/file_path.h"
|
#include "base/files/file_path.h"
|
||||||
|
|
||||||
CefDragDataImpl::CefDragDataImpl(const WebDropData& data)
|
CefDragDataImpl::CefDragDataImpl(const content::DropData& data)
|
||||||
: data_(data) {
|
: data_(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ bool CefDragDataImpl::GetFileNames(std::vector<CefString>& names) {
|
|||||||
if (data_.filenames.empty())
|
if (data_.filenames.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
std::vector<WebDropData::FileInfo>::const_iterator it =
|
std::vector<content::DropData::FileInfo>::const_iterator it =
|
||||||
data_.filenames.begin();
|
data_.filenames.begin();
|
||||||
for (; it != data_.filenames.end(); ++it)
|
for (; it != data_.filenames.end(); ++it)
|
||||||
names.push_back(it->path);
|
names.push_back(it->path);
|
||||||
|
@ -9,12 +9,12 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "include/cef_drag_data.h"
|
#include "include/cef_drag_data.h"
|
||||||
#include "webkit/common/webdropdata.h"
|
#include "content/public/common/drop_data.h"
|
||||||
|
|
||||||
// Implementation of CefDragData.
|
// Implementation of CefDragData.
|
||||||
class CefDragDataImpl : public CefDragData {
|
class CefDragDataImpl : public CefDragData {
|
||||||
public:
|
public:
|
||||||
explicit CefDragDataImpl(const WebDropData& data);
|
explicit CefDragDataImpl(const content::DropData& data);
|
||||||
|
|
||||||
virtual bool IsLink();
|
virtual bool IsLink();
|
||||||
virtual bool IsFragment();
|
virtual bool IsFragment();
|
||||||
@ -29,7 +29,7 @@ class CefDragDataImpl : public CefDragData {
|
|||||||
virtual bool GetFileNames(std::vector<CefString>& names);
|
virtual bool GetFileNames(std::vector<CefString>& names);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
WebDropData data_;
|
content::DropData data_;
|
||||||
|
|
||||||
IMPLEMENT_REFCOUNTING(CefDragDataImpl);
|
IMPLEMENT_REFCOUNTING(CefDragDataImpl);
|
||||||
};
|
};
|
||||||
|
@ -445,14 +445,14 @@ void CefMainDelegate::InitializeResourceBundle() {
|
|||||||
|
|
||||||
content_client_.set_allow_pack_file_load(true);
|
content_client_.set_allow_pack_file_load(true);
|
||||||
|
|
||||||
if (file_util::PathExists(cef_pak_file)) {
|
if (base::PathExists(cef_pak_file)) {
|
||||||
ResourceBundle::GetSharedInstance().AddDataPackFromPath(
|
ResourceBundle::GetSharedInstance().AddDataPackFromPath(
|
||||||
cef_pak_file, ui::SCALE_FACTOR_NONE);
|
cef_pak_file, ui::SCALE_FACTOR_NONE);
|
||||||
} else {
|
} else {
|
||||||
NOTREACHED() << "Could not load cef.pak";
|
NOTREACHED() << "Could not load cef.pak";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_util::PathExists(devtools_pak_file)) {
|
if (base::PathExists(devtools_pak_file)) {
|
||||||
ResourceBundle::GetSharedInstance().AddDataPackFromPath(
|
ResourceBundle::GetSharedInstance().AddDataPackFromPath(
|
||||||
devtools_pak_file, ui::SCALE_FACTOR_NONE);
|
devtools_pak_file, ui::SCALE_FACTOR_NONE);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/location.h"
|
#include "base/location.h"
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "base/message_loop/message_loop_proxy.h"
|
#include "base/message_loop/message_loop_proxy.h"
|
||||||
#include "content/public/browser/browser_thread.h"
|
#include "content/public/browser/browser_thread.h"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "include/internal/cef_time.h"
|
#include "include/internal/cef_time.h"
|
||||||
#include "base/time.h"
|
#include "base/time/time.h"
|
||||||
|
|
||||||
// Converts cef_time_t to/from a base::Time object.
|
// Converts cef_time_t to/from a base::Time object.
|
||||||
void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time);
|
void cef_time_to_basetime(const cef_time_t& cef_time, base::Time& time);
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include "include/cef_url.h"
|
#include "include/cef_url.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "url/gurl.h"
|
||||||
|
|
||||||
bool CefParseURL(const CefString& url,
|
bool CefParseURL(const CefString& url,
|
||||||
CefURLParts& parts) {
|
CefURLParts& parts) {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "libcef/renderer/render_urlrequest_impl.h"
|
#include "libcef/renderer/render_urlrequest_impl.h"
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "content/public/common/content_client.h"
|
#include "content/public/common/content_client.h"
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#include "third_party/WebKit/public/web/WebScriptSource.h"
|
#include "third_party/WebKit/public/web/WebScriptSource.h"
|
||||||
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
|
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
|
||||||
#include "third_party/WebKit/public/web/WebView.h"
|
#include "third_party/WebKit/public/web/WebView.h"
|
||||||
#include "webkit/base/file_path_string_conversions.h"
|
|
||||||
#include "webkit/glue/webkit_glue.h"
|
#include "webkit/glue/webkit_glue.h"
|
||||||
|
|
||||||
using WebKit::WebFrame;
|
using WebKit::WebFrame;
|
||||||
@ -48,6 +47,15 @@ namespace {
|
|||||||
const int64 kInvalidBrowserId = -1;
|
const int64 kInvalidBrowserId = -1;
|
||||||
const int64 kInvalidFrameId = -1;
|
const int64 kInvalidFrameId = -1;
|
||||||
|
|
||||||
|
WebKit::WebString FilePathStringToWebString(
|
||||||
|
const base::FilePath::StringType& str) {
|
||||||
|
#if defined(OS_POSIX)
|
||||||
|
return WideToUTF16Hack(base::SysNativeMBToWide(str));
|
||||||
|
#elif defined(OS_WIN)
|
||||||
|
return WideToUTF16Hack(str);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
@ -78,25 +86,25 @@ CefRefPtr<CefBrowserHost> CefBrowserImpl::GetHost() {
|
|||||||
bool CefBrowserImpl::CanGoBack() {
|
bool CefBrowserImpl::CanGoBack() {
|
||||||
CEF_REQUIRE_RT_RETURN(false);
|
CEF_REQUIRE_RT_RETURN(false);
|
||||||
|
|
||||||
return webkit_glue::CanGoBackOrForward(render_view()->GetWebView(), -1);
|
return webkit_glue::CanGoBack(render_view()->GetWebView());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefBrowserImpl::GoBack() {
|
void CefBrowserImpl::GoBack() {
|
||||||
CEF_REQUIRE_RT_RETURN_VOID();
|
CEF_REQUIRE_RT_RETURN_VOID();
|
||||||
|
|
||||||
webkit_glue::GoBackOrForward(render_view()->GetWebView(), -1);
|
webkit_glue::GoBack(render_view()->GetWebView());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefBrowserImpl::CanGoForward() {
|
bool CefBrowserImpl::CanGoForward() {
|
||||||
CEF_REQUIRE_RT_RETURN(false);
|
CEF_REQUIRE_RT_RETURN(false);
|
||||||
|
|
||||||
return webkit_glue::CanGoBackOrForward(render_view()->GetWebView(), 1);
|
return webkit_glue::CanGoForward(render_view()->GetWebView());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefBrowserImpl::GoForward() {
|
void CefBrowserImpl::GoForward() {
|
||||||
CEF_REQUIRE_RT_RETURN_VOID();
|
CEF_REQUIRE_RT_RETURN_VOID();
|
||||||
|
|
||||||
webkit_glue::GoBackOrForward(render_view()->GetWebView(), 1);
|
webkit_glue::GoForward(render_view()->GetWebView());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefBrowserImpl::IsLoading() {
|
bool CefBrowserImpl::IsLoading() {
|
||||||
@ -334,7 +342,7 @@ void CefBrowserImpl::LoadRequest(const CefMsg_LoadRequest_Params& params) {
|
|||||||
data.assign(element.bytes(), element.bytes_length());
|
data.assign(element.bytes(), element.bytes_length());
|
||||||
body.appendData(data);
|
body.appendData(data);
|
||||||
} else if (element.type() == net::UploadElement::TYPE_FILE) {
|
} else if (element.type() == net::UploadElement::TYPE_FILE) {
|
||||||
body.appendFile(webkit_base::FilePathToWebString(element.file_path()));
|
body.appendFile(FilePathStringToWebString(element.file_path().value()));
|
||||||
} else {
|
} else {
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
|
@ -469,7 +469,7 @@ bool CefContentRendererClient::OverrideCreatePlugin(
|
|||||||
content::RenderViewImpl* render_view_impl =
|
content::RenderViewImpl* render_view_impl =
|
||||||
static_cast<content::RenderViewImpl*>(render_view);
|
static_cast<content::RenderViewImpl*>(render_view);
|
||||||
|
|
||||||
webkit::WebPluginInfo info;
|
content::WebPluginInfo info;
|
||||||
std::string mime_type;
|
std::string mime_type;
|
||||||
bool found = render_view_impl->GetPluginInfo(params.url,
|
bool found = render_view_impl->GetPluginInfo(params.url,
|
||||||
frame->top()->document().url(),
|
frame->top()->document().url(),
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "base/memory/scoped_ptr.h"
|
#include "base/memory/scoped_ptr.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "base/sequenced_task_runner.h"
|
#include "base/sequenced_task_runner.h"
|
||||||
#include "content/public/renderer/content_renderer_client.h"
|
#include "content/public/renderer/content_renderer_client.h"
|
||||||
|
|
||||||
|
@ -8,12 +8,12 @@
|
|||||||
#include "libcef/common/cef_messages.h"
|
#include "libcef/common/cef_messages.h"
|
||||||
|
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "content/common/devtools_messages.h"
|
#include "content/common/devtools_messages.h"
|
||||||
#include "googleurl/src/gurl.h"
|
|
||||||
#include "googleurl/src/url_util.h"
|
|
||||||
#include "third_party/WebKit/public/platform/WebString.h"
|
#include "third_party/WebKit/public/platform/WebString.h"
|
||||||
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
|
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
|
||||||
|
#include "url/gurl.h"
|
||||||
|
#include "url/url_util.h"
|
||||||
|
|
||||||
CefRenderMessageFilter::CefRenderMessageFilter()
|
CefRenderMessageFilter::CefRenderMessageFilter()
|
||||||
: channel_(NULL) {
|
: channel_(NULL) {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "libcef/common/response_impl.h"
|
#include "libcef/common/response_impl.h"
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/message_loop.h"
|
#include "base/message_loop/message_loop.h"
|
||||||
#include "third_party/WebKit/public/platform/Platform.h"
|
#include "third_party/WebKit/public/platform/Platform.h"
|
||||||
#include "third_party/WebKit/public/platform/WebString.h"
|
#include "third_party/WebKit/public/platform/WebString.h"
|
||||||
#include "third_party/WebKit/public/platform/WebURL.h"
|
#include "third_party/WebKit/public/platform/WebURL.h"
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
MSVC_PUSH_WARNING_LEVEL(0);
|
MSVC_PUSH_WARNING_LEVEL(0);
|
||||||
#include "core/page/Frame.h"
|
#include "core/page/Frame.h"
|
||||||
#include "core/workers//WorkerContext.h"
|
#include "core/workers/WorkerGlobalScope.h"
|
||||||
#include "bindings/v8/ScriptController.h"
|
#include "bindings/v8/ScriptController.h"
|
||||||
#include "bindings/v8/V8Binding.h"
|
#include "bindings/v8/V8Binding.h"
|
||||||
#include "bindings/v8/V8RecursionScope.h"
|
#include "bindings/v8/V8RecursionScope.h"
|
||||||
@ -32,10 +32,10 @@ MSVC_POP_WARNING();
|
|||||||
#include "base/lazy_instance.h"
|
#include "base/lazy_instance.h"
|
||||||
#include "base/strings/string_number_conversions.h"
|
#include "base/strings/string_number_conversions.h"
|
||||||
#include "base/threading/thread_local.h"
|
#include "base/threading/thread_local.h"
|
||||||
#include "googleurl/src/gurl.h"
|
|
||||||
#include "third_party/WebKit/public/web/WebKit.h"
|
#include "third_party/WebKit/public/web/WebKit.h"
|
||||||
#include "third_party/WebKit/public/web/WebFrame.h"
|
#include "third_party/WebKit/public/web/WebFrame.h"
|
||||||
#include "third_party/WebKit/public/web/WebScriptController.h"
|
#include "third_party/WebKit/public/web/WebScriptController.h"
|
||||||
|
#include "url/gurl.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@ -472,40 +472,45 @@ void GetCefString(v8::Handle<v8::String> str, CefString& out) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// V8 function callback.
|
// V8 function callback.
|
||||||
v8::Handle<v8::Value> FunctionCallbackImpl(const v8::Arguments& args) {
|
void FunctionCallbackImpl(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
||||||
WebCore::V8RecursionScope recursion_scope(
|
WebCore::V8RecursionScope recursion_scope(
|
||||||
WebCore::toScriptExecutionContext(v8::Context::GetCurrent()));
|
WebCore::toScriptExecutionContext(v8::Context::GetCurrent()));
|
||||||
|
|
||||||
CefV8Handler* handler =
|
CefV8Handler* handler =
|
||||||
static_cast<CefV8Handler*>(v8::External::Cast(*args.Data())->Value());
|
static_cast<CefV8Handler*>(v8::External::Cast(*info.Data())->Value());
|
||||||
|
|
||||||
CefV8ValueList params;
|
CefV8ValueList params;
|
||||||
for (int i = 0; i < args.Length(); i++)
|
for (int i = 0; i < info.Length(); i++)
|
||||||
params.push_back(new CefV8ValueImpl(args[i]));
|
params.push_back(new CefV8ValueImpl(info[i]));
|
||||||
|
|
||||||
CefString func_name;
|
CefString func_name;
|
||||||
GetCefString(v8::Handle<v8::String>::Cast(args.Callee()->GetName()),
|
GetCefString(v8::Handle<v8::String>::Cast(info.Callee()->GetName()),
|
||||||
func_name);
|
func_name);
|
||||||
CefRefPtr<CefV8Value> object = new CefV8ValueImpl(args.This());
|
CefRefPtr<CefV8Value> object = new CefV8ValueImpl(info.This());
|
||||||
CefRefPtr<CefV8Value> retval;
|
CefRefPtr<CefV8Value> retval;
|
||||||
CefString exception;
|
CefString exception;
|
||||||
|
|
||||||
if (handler->Execute(func_name, object, params, retval, exception)) {
|
if (handler->Execute(func_name, object, params, retval, exception)) {
|
||||||
if (!exception.empty()) {
|
if (!exception.empty()) {
|
||||||
return v8::ThrowException(v8::Exception::Error(GetV8String(exception)));
|
info.GetReturnValue().Set(
|
||||||
|
v8::ThrowException(v8::Exception::Error(GetV8String(exception))));
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
CefV8ValueImpl* rv = static_cast<CefV8ValueImpl*>(retval.get());
|
CefV8ValueImpl* rv = static_cast<CefV8ValueImpl*>(retval.get());
|
||||||
if (rv && rv->IsValid())
|
if (rv && rv->IsValid()) {
|
||||||
return rv->GetV8Value(true);
|
info.GetReturnValue().Set(rv->GetV8Value(true));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return v8::Undefined();
|
info.GetReturnValue().SetUndefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
// V8 Accessor callbacks
|
// V8 Accessor callbacks
|
||||||
v8::Handle<v8::Value> AccessorGetterCallbackImpl(v8::Local<v8::String> property,
|
void AccessorGetterCallbackImpl(
|
||||||
const v8::AccessorInfo& info) {
|
v8::Local<v8::String> property,
|
||||||
|
const v8::PropertyCallbackInfo<v8::Value>& info) {
|
||||||
WebCore::V8RecursionScope recursion_scope(
|
WebCore::V8RecursionScope recursion_scope(
|
||||||
WebCore::toScriptExecutionContext(v8::Context::GetCurrent()));
|
WebCore::toScriptExecutionContext(v8::Context::GetCurrent()));
|
||||||
|
|
||||||
@ -524,22 +529,26 @@ v8::Handle<v8::Value> AccessorGetterCallbackImpl(v8::Local<v8::String> property,
|
|||||||
GetCefString(property, name);
|
GetCefString(property, name);
|
||||||
if (accessorPtr->Get(name, object, retval, exception)) {
|
if (accessorPtr->Get(name, object, retval, exception)) {
|
||||||
if (!exception.empty()) {
|
if (!exception.empty()) {
|
||||||
return v8::ThrowException(
|
info.GetReturnValue().Set(
|
||||||
v8::Exception::Error(GetV8String(exception)));
|
v8::ThrowException(v8::Exception::Error(GetV8String(exception))));
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
CefV8ValueImpl* rv = static_cast<CefV8ValueImpl*>(retval.get());
|
CefV8ValueImpl* rv = static_cast<CefV8ValueImpl*>(retval.get());
|
||||||
if (rv && rv->IsValid())
|
if (rv && rv->IsValid()) {
|
||||||
return rv->GetV8Value(true);
|
info.GetReturnValue().Set(rv->GetV8Value(true));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return v8::Undefined();
|
return info.GetReturnValue().SetUndefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AccessorSetterCallbackImpl(v8::Local<v8::String> property,
|
void AccessorSetterCallbackImpl(
|
||||||
v8::Local<v8::Value> value,
|
v8::Local<v8::String> property,
|
||||||
const v8::AccessorInfo& info) {
|
v8::Local<v8::Value> value,
|
||||||
|
const v8::PropertyCallbackInfo<void>& info) {
|
||||||
WebCore::V8RecursionScope recursion_scope(
|
WebCore::V8RecursionScope recursion_scope(
|
||||||
WebCore::toScriptExecutionContext(v8::Context::GetCurrent()));
|
WebCore::toScriptExecutionContext(v8::Context::GetCurrent()));
|
||||||
|
|
||||||
@ -586,7 +595,7 @@ v8::Local<v8::Value> CallV8Function(v8::Handle<v8::Context> context,
|
|||||||
DCHECK(controller);
|
DCHECK(controller);
|
||||||
if (controller) {
|
if (controller) {
|
||||||
func_rv = WebCore::ScriptController::callFunctionWithInstrumentation(
|
func_rv = WebCore::ScriptController::callFunctionWithInstrumentation(
|
||||||
controller->workerContext()->scriptExecutionContext(),
|
controller->workerGlobalScope()->scriptExecutionContext(),
|
||||||
function, receiver, argc, args);
|
function, receiver, argc, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1673,9 +1682,10 @@ bool CefV8ValueImpl::SetValue(const CefString& key, AccessControl settings,
|
|||||||
if (!accessorPtr.get())
|
if (!accessorPtr.get())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
v8::AccessorGetter getter = AccessorGetterCallbackImpl;
|
v8::AccessorGetterCallback getter = AccessorGetterCallbackImpl;
|
||||||
v8::AccessorSetter setter = (attribute & V8_PROPERTY_ATTRIBUTE_READONLY) ?
|
v8::AccessorSetterCallback setter =
|
||||||
NULL : AccessorSetterCallbackImpl;
|
(attribute & V8_PROPERTY_ATTRIBUTE_READONLY) ?
|
||||||
|
NULL : AccessorSetterCallbackImpl;
|
||||||
|
|
||||||
v8::TryCatch try_catch;
|
v8::TryCatch try_catch;
|
||||||
try_catch.SetVerbose(true);
|
try_catch.SetVerbose(true);
|
||||||
|
@ -14,31 +14,43 @@ MSVC_PUSH_WARNING_LEVEL(0);
|
|||||||
#include "bindings/v8/ScriptController.h"
|
#include "bindings/v8/ScriptController.h"
|
||||||
#include "core/history/BackForwardController.h"
|
#include "core/history/BackForwardController.h"
|
||||||
#include "core/page/Page.h"
|
#include "core/page/Page.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/src/WebFrameImpl.h"
|
#include "third_party/WebKit/Source/web/WebFrameImpl.h"
|
||||||
#include "third_party/WebKit/Source/WebKit/chromium/src/WebViewImpl.h"
|
#include "third_party/WebKit/Source/web/WebViewImpl.h"
|
||||||
MSVC_POP_WARNING();
|
MSVC_POP_WARNING();
|
||||||
#undef LOG
|
#undef LOG
|
||||||
|
|
||||||
namespace webkit_glue {
|
namespace webkit_glue {
|
||||||
|
|
||||||
bool CanGoBackOrForward(WebKit::WebView* view, int distance) {
|
bool CanGoBack(WebKit::WebView* view) {
|
||||||
if (!view)
|
if (!view)
|
||||||
return false;
|
return false;
|
||||||
WebKit::WebViewImpl* impl = reinterpret_cast<WebKit::WebViewImpl*>(view);
|
WebKit::WebViewImpl* impl = reinterpret_cast<WebKit::WebViewImpl*>(view);
|
||||||
if (distance == 0)
|
return (impl->page()->backForward()->backCount() > 0);
|
||||||
return true;
|
|
||||||
if (distance > 0 && distance <= impl->page()->backForward()->forwardCount())
|
|
||||||
return true;
|
|
||||||
if (distance < 0 && -distance <= impl->page()->backForward()->backCount())
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GoBackOrForward(WebKit::WebView* view, int distance) {
|
bool CanGoForward(WebKit::WebView* view) {
|
||||||
|
if (!view)
|
||||||
|
return false;
|
||||||
|
WebKit::WebViewImpl* impl = reinterpret_cast<WebKit::WebViewImpl*>(view);
|
||||||
|
return (impl->page()->backForward()->forwardCount() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GoBack(WebKit::WebView* view) {
|
||||||
if (!view)
|
if (!view)
|
||||||
return;
|
return;
|
||||||
WebKit::WebViewImpl* impl = reinterpret_cast<WebKit::WebViewImpl*>(view);
|
WebKit::WebViewImpl* impl = reinterpret_cast<WebKit::WebViewImpl*>(view);
|
||||||
impl->page()->goBackOrForward(distance);
|
WebCore::BackForwardController* controller = impl->page()->backForward();
|
||||||
|
if (controller->backCount() > 0)
|
||||||
|
controller->goBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GoForward(WebKit::WebView* view) {
|
||||||
|
if (!view)
|
||||||
|
return;
|
||||||
|
WebKit::WebViewImpl* impl = reinterpret_cast<WebKit::WebViewImpl*>(view);
|
||||||
|
WebCore::BackForwardController* controller = impl->page()->backForward();
|
||||||
|
if (controller->forwardCount() > 0)
|
||||||
|
controller->goForward();
|
||||||
}
|
}
|
||||||
|
|
||||||
v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame) {
|
v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame) {
|
||||||
|
@ -17,8 +17,10 @@ class WebView;
|
|||||||
|
|
||||||
namespace webkit_glue {
|
namespace webkit_glue {
|
||||||
|
|
||||||
bool CanGoBackOrForward(WebKit::WebView* view, int distance);
|
bool CanGoBack(WebKit::WebView* view);
|
||||||
void GoBackOrForward(WebKit::WebView* view, int distance);
|
bool CanGoForward(WebKit::WebView* view);
|
||||||
|
void GoBack(WebKit::WebView* view);
|
||||||
|
void GoForward(WebKit::WebView* view);
|
||||||
|
|
||||||
// Retrieve the V8 context associated with the frame.
|
// Retrieve the V8 context associated with the frame.
|
||||||
v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame);
|
v8::Handle<v8::Context> GetV8Context(WebKit::WebFrame* frame);
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
<include name="IDR_CEF_CREDITS_SWIFTSHADER_JPG" file="..\..\..\chrome\browser\resources\swiftshader.jpg" type="BINDATA" />
|
<include name="IDR_CEF_CREDITS_SWIFTSHADER_JPG" file="..\..\..\chrome\browser\resources\swiftshader.jpg" type="BINDATA" />
|
||||||
<include name="IDR_CEF_LICENSE_TXT" file="..\..\LICENSE.txt" type="BINDATA" />
|
<include name="IDR_CEF_LICENSE_TXT" file="..\..\LICENSE.txt" type="BINDATA" />
|
||||||
<include name="IDR_CEF_VERSION_HTML" file="about_version.html" type="BINDATA" />
|
<include name="IDR_CEF_VERSION_HTML" file="about_version.html" type="BINDATA" />
|
||||||
<include name="IDR_CEF_TRACING_HTML" file="..\..\..\third_party\trace-viewer\src\about_tracing.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
|
|
||||||
<include name="IDR_CEF_TRACING_JS" file="..\..\..\third_party\trace-viewer\src\about_tracing.js" flattenhtml="true" type="BINDATA" />
|
|
||||||
</includes>
|
</includes>
|
||||||
</release>
|
</release>
|
||||||
</grit>
|
</grit>
|
||||||
|
@ -177,7 +177,7 @@ cef_string_userfree_t CEF_CALLBACK download_item_get_full_path(
|
|||||||
return _retval.DetachToUserFree();
|
return _retval.DetachToUserFree();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 CEF_CALLBACK download_item_get_id(struct _cef_download_item_t* self) {
|
uint32 CEF_CALLBACK download_item_get_id(struct _cef_download_item_t* self) {
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
DCHECK(self);
|
DCHECK(self);
|
||||||
@ -185,7 +185,7 @@ int32 CEF_CALLBACK download_item_get_id(struct _cef_download_item_t* self) {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int32 _retval = CefDownloadItemCppToC::Get(self)->GetId();
|
uint32 _retval = CefDownloadItemCppToC::Get(self)->GetId();
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
|
@ -160,14 +160,14 @@ CefString CefDownloadItemCToCpp::GetFullPath() {
|
|||||||
return _retvalStr;
|
return _retvalStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 CefDownloadItemCToCpp::GetId() {
|
uint32 CefDownloadItemCToCpp::GetId() {
|
||||||
if (CEF_MEMBER_MISSING(struct_, get_id))
|
if (CEF_MEMBER_MISSING(struct_, get_id))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||||
|
|
||||||
// Execute
|
// Execute
|
||||||
int32 _retval = struct_->get_id(struct_);
|
uint32 _retval = struct_->get_id(struct_);
|
||||||
|
|
||||||
// Return type: simple
|
// Return type: simple
|
||||||
return _retval;
|
return _retval;
|
||||||
|
@ -45,7 +45,7 @@ class CefDownloadItemCToCpp
|
|||||||
virtual CefTime GetStartTime() OVERRIDE;
|
virtual CefTime GetStartTime() OVERRIDE;
|
||||||
virtual CefTime GetEndTime() OVERRIDE;
|
virtual CefTime GetEndTime() OVERRIDE;
|
||||||
virtual CefString GetFullPath() OVERRIDE;
|
virtual CefString GetFullPath() OVERRIDE;
|
||||||
virtual int32 GetId() OVERRIDE;
|
virtual uint32 GetId() OVERRIDE;
|
||||||
virtual CefString GetURL() OVERRIDE;
|
virtual CefString GetURL() OVERRIDE;
|
||||||
virtual CefString GetSuggestedFileName() OVERRIDE;
|
virtual CefString GetSuggestedFileName() OVERRIDE;
|
||||||
virtual CefString GetContentDisposition() OVERRIDE;
|
virtual CefString GetContentDisposition() OVERRIDE;
|
||||||
|
@ -29,7 +29,7 @@ patches = [
|
|||||||
{
|
{
|
||||||
# http://code.google.com/p/chromiumembedded/issues/detail?id=933
|
# http://code.google.com/p/chromiumembedded/issues/detail?id=933
|
||||||
'name': 'webkit_933',
|
'name': 'webkit_933',
|
||||||
'path': '../third_party/WebKit/Source/WebKit/chromium/src/',
|
'path': '../third_party/WebKit/Source/web/',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
# http://code.google.com/p/gyp/issues/detail?id=331
|
# http://code.google.com/p/gyp/issues/detail?id=331
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
Index: message_loop.cc
|
Index: message_loop.cc
|
||||||
===================================================================
|
===================================================================
|
||||||
--- message_loop.cc (revision 194165)
|
--- message_loop.cc (revision 213078)
|
||||||
+++ message_loop.cc (working copy)
|
+++ message_loop.cc (working copy)
|
||||||
@@ -191,7 +191,7 @@
|
@@ -193,7 +193,7 @@
|
||||||
MessageLoop::~MessageLoop() {
|
MessageLoop::~MessageLoop() {
|
||||||
DCHECK_EQ(this, current());
|
DCHECK_EQ(this, current());
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
Index: page/FrameView.cpp
|
Index: page/FrameView.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- page/FrameView.cpp (revision 151551)
|
--- page/FrameView.cpp (revision 154753)
|
||||||
+++ page/FrameView.cpp (working copy)
|
+++ page/FrameView.cpp (working copy)
|
||||||
@@ -198,10 +198,12 @@
|
@@ -191,10 +191,12 @@
|
||||||
if (!page)
|
if (!page)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ Index: page/FrameView.cpp
|
|||||||
PassRefPtr<FrameView> FrameView::create(Frame* frame)
|
PassRefPtr<FrameView> FrameView::create(Frame* frame)
|
||||||
Index: platform/mac/NSScrollerImpDetails.mm
|
Index: platform/mac/NSScrollerImpDetails.mm
|
||||||
===================================================================
|
===================================================================
|
||||||
--- platform/mac/NSScrollerImpDetails.mm (revision 151551)
|
--- platform/mac/NSScrollerImpDetails.mm (revision 154753)
|
||||||
+++ platform/mac/NSScrollerImpDetails.mm (working copy)
|
+++ platform/mac/NSScrollerImpDetails.mm (working copy)
|
||||||
@@ -33,6 +33,7 @@
|
@@ -33,6 +33,7 @@
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
Index: WebNode.cpp
|
Index: WebNode.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- WebNode.cpp (revision 146842)
|
--- WebNode.cpp (revision 154753)
|
||||||
+++ WebNode.cpp (working copy)
|
+++ WebNode.cpp (working copy)
|
||||||
@@ -181,7 +181,7 @@
|
@@ -173,7 +173,7 @@
|
||||||
void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
|
void WebNode::addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture)
|
||||||
{
|
{
|
||||||
// Please do not add more eventTypes to this list without an API review.
|
// Please do not add more eventTypes to this list without an API review.
|
||||||
- RELEASE_ASSERT(eventType == "mousedown");
|
- RELEASE_ASSERT(eventType == "mousedown");
|
||||||
+ //RELEASE_ASSERT(eventType == "mousedown");
|
+ // RELEASE_ASSERT(eventType == "mousedown");
|
||||||
|
|
||||||
EventListenerWrapper* listenerWrapper = listener->createEventListenerWrapper(eventType, useCapture, m_private.get());
|
EventListenerWrapper* listenerWrapper = listener->createEventListenerWrapper(eventType, useCapture, m_private.get());
|
||||||
// The listenerWrapper is only referenced by the actual Node. Once it goes
|
// The listenerWrapper is only referenced by the actual Node. Once it goes
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
Index: public/web/WebView.h
|
Index: public/web/WebView.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- public/web/WebView.h (revision 152953)
|
--- public/web/WebView.h (revision 154753)
|
||||||
+++ public/web/WebView.h (working copy)
|
+++ public/web/WebView.h (working copy)
|
||||||
@@ -421,6 +421,7 @@
|
@@ -423,6 +423,7 @@
|
||||||
|
|
||||||
// Sets whether select popup menus should be rendered by the browser.
|
// Sets whether select popup menus should be rendered by the browser.
|
||||||
WEBKIT_EXPORT static void setUseExternalPopupMenus(bool);
|
WEBKIT_EXPORT static void setUseExternalPopupMenus(bool);
|
||||||
@ -10,11 +10,11 @@ Index: public/web/WebView.h
|
|||||||
|
|
||||||
|
|
||||||
// Visited link state --------------------------------------------------
|
// Visited link state --------------------------------------------------
|
||||||
Index: Source/WebKit/chromium/src/ChromeClientImpl.cpp
|
Index: Source/web/ChromeClientImpl.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- Source/WebKit/chromium/src/ChromeClientImpl.cpp (revision 152953)
|
--- Source/web/ChromeClientImpl.cpp (revision 154753)
|
||||||
+++ Source/WebKit/chromium/src/ChromeClientImpl.cpp (working copy)
|
+++ Source/web/ChromeClientImpl.cpp (working copy)
|
||||||
@@ -895,7 +895,7 @@
|
@@ -872,7 +872,7 @@
|
||||||
|
|
||||||
PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const
|
PassRefPtr<PopupMenu> ChromeClientImpl::createPopupMenu(Frame& frame, PopupMenuClient* client) const
|
||||||
{
|
{
|
||||||
@ -23,11 +23,11 @@ Index: Source/WebKit/chromium/src/ChromeClientImpl.cpp
|
|||||||
return adoptRef(new ExternalPopupMenu(frame, client, m_webView->client()));
|
return adoptRef(new ExternalPopupMenu(frame, client, m_webView->client()));
|
||||||
|
|
||||||
return adoptRef(new PopupMenuChromium(frame, client));
|
return adoptRef(new PopupMenuChromium(frame, client));
|
||||||
Index: Source/WebKit/chromium/src/WebViewImpl.cpp
|
Index: Source/web/WebViewImpl.cpp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- Source/WebKit/chromium/src/WebViewImpl.cpp (revision 152953)
|
--- Source/web/WebViewImpl.cpp (revision 154753)
|
||||||
+++ Source/WebKit/chromium/src/WebViewImpl.cpp (working copy)
|
+++ Source/web/WebViewImpl.cpp (working copy)
|
||||||
@@ -393,6 +393,7 @@
|
@@ -388,6 +388,7 @@
|
||||||
, m_fakeDoubleTapPageScaleFactor(0)
|
, m_fakeDoubleTapPageScaleFactor(0)
|
||||||
, m_fakeDoubleTapUseAnchor(false)
|
, m_fakeDoubleTapUseAnchor(false)
|
||||||
, m_contextMenuAllowed(false)
|
, m_contextMenuAllowed(false)
|
||||||
@ -35,7 +35,7 @@ Index: Source/WebKit/chromium/src/WebViewImpl.cpp
|
|||||||
, m_doingDragAndDrop(false)
|
, m_doingDragAndDrop(false)
|
||||||
, m_ignoreInputEvents(false)
|
, m_ignoreInputEvents(false)
|
||||||
, m_suppressNextKeypressEvent(false)
|
, m_suppressNextKeypressEvent(false)
|
||||||
@@ -3676,9 +3677,14 @@
|
@@ -3702,9 +3703,14 @@
|
||||||
updateLayerTreeViewport();
|
updateLayerTreeViewport();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,11 +51,11 @@ Index: Source/WebKit/chromium/src/WebViewImpl.cpp
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WebViewImpl::setEmulatedTextZoomFactor(float textZoomFactor)
|
void WebViewImpl::setEmulatedTextZoomFactor(float textZoomFactor)
|
||||||
Index: Source/WebKit/chromium/src/WebViewImpl.h
|
Index: Source/web/WebViewImpl.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- Source/WebKit/chromium/src/WebViewImpl.h (revision 152953)
|
--- Source/web/WebViewImpl.h (revision 154753)
|
||||||
+++ Source/WebKit/chromium/src/WebViewImpl.h (working copy)
|
+++ Source/web/WebViewImpl.h (working copy)
|
||||||
@@ -415,7 +415,8 @@
|
@@ -420,7 +420,8 @@
|
||||||
|
|
||||||
// Returns true if popup menus should be rendered by the browser, false if
|
// Returns true if popup menus should be rendered by the browser, false if
|
||||||
// they should be rendered by WebKit (which is the default).
|
// they should be rendered by WebKit (which is the default).
|
||||||
@ -65,7 +65,7 @@ Index: Source/WebKit/chromium/src/WebViewImpl.h
|
|||||||
|
|
||||||
bool contextMenuAllowed() const
|
bool contextMenuAllowed() const
|
||||||
{
|
{
|
||||||
@@ -733,6 +734,8 @@
|
@@ -721,6 +722,8 @@
|
||||||
|
|
||||||
bool m_contextMenuAllowed;
|
bool m_contextMenuAllowed;
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ bool ClientHandler::OnDragEnter(CefRefPtr<CefBrowser> browser,
|
|||||||
REQUIRE_UI_THREAD();
|
REQUIRE_UI_THREAD();
|
||||||
|
|
||||||
// Forbid dragging of link URLs.
|
// Forbid dragging of link URLs.
|
||||||
if (dragData->IsLink())
|
if (mask & DRAG_OPERATION_LINK)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user