mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-19 21:50:42 +01:00
Update to Chromium revision 140240.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@679 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
parent
06806ee190
commit
3715c23777
@ -17,5 +17,5 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
|
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
|
||||||
'chromium_revision': '139609',
|
'chromium_revision': '140240',
|
||||||
}
|
}
|
||||||
|
@ -907,6 +907,7 @@ void CefBrowserHostImpl::UpdatePreferredSize(content::WebContents* source,
|
|||||||
void CefBrowserHostImpl::RenderViewCreated(
|
void CefBrowserHostImpl::RenderViewCreated(
|
||||||
content::RenderViewHost* render_view_host) {
|
content::RenderViewHost* render_view_host) {
|
||||||
base::AutoLock lock_scope(state_lock_);
|
base::AutoLock lock_scope(state_lock_);
|
||||||
|
render_view_id_ = render_view_host->GetRoutingID();
|
||||||
render_process_id_ = render_view_host->GetProcess()->GetID();
|
render_process_id_ = render_view_host->GetProcess()->GetID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,8 +328,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
|
|||||||
|
|
||||||
// Unique ids used for routing communication to/from the renderer. We keep a
|
// Unique ids used for routing communication to/from the renderer. We keep a
|
||||||
// copy of them as member variables so that we can locate matching browsers in
|
// copy of them as member variables so that we can locate matching browsers in
|
||||||
// a thread safe manner. |render_process_id_| may change and access must be
|
// a thread safe manner. All access must be protected by the state lock.
|
||||||
// protected by |state_lock_|.
|
|
||||||
int render_process_id_;
|
int render_process_id_;
|
||||||
int render_view_id_;
|
int render_view_id_;
|
||||||
|
|
||||||
|
@ -28,16 +28,11 @@ class CefBrowserMainParts : public content::BrowserMainParts {
|
|||||||
explicit CefBrowserMainParts(const content::MainFunctionParams& parameters);
|
explicit CefBrowserMainParts(const content::MainFunctionParams& parameters);
|
||||||
virtual ~CefBrowserMainParts();
|
virtual ~CefBrowserMainParts();
|
||||||
|
|
||||||
virtual void PreEarlyInitialization() OVERRIDE {}
|
|
||||||
virtual void PostEarlyInitialization() OVERRIDE {}
|
|
||||||
virtual void PreMainMessageLoopStart() OVERRIDE;
|
virtual void PreMainMessageLoopStart() OVERRIDE;
|
||||||
virtual void PostMainMessageLoopStart() OVERRIDE {}
|
|
||||||
virtual void ToolkitInitialized() OVERRIDE {}
|
|
||||||
virtual int PreCreateThreads() OVERRIDE;
|
virtual int PreCreateThreads() OVERRIDE;
|
||||||
virtual void PreMainMessageLoopRun() OVERRIDE;
|
virtual void PreMainMessageLoopRun() OVERRIDE;
|
||||||
virtual bool MainMessageLoopRun(int* result_code) OVERRIDE;
|
virtual bool MainMessageLoopRun(int* result_code) OVERRIDE;
|
||||||
virtual void PostMainMessageLoopRun() OVERRIDE;
|
virtual void PostMainMessageLoopRun() OVERRIDE;
|
||||||
virtual void PostDestroyThreads() OVERRIDE {}
|
|
||||||
|
|
||||||
CefBrowserContext* browser_context() const { return browser_context_.get(); }
|
CefBrowserContext* browser_context() const { return browser_context_.get(); }
|
||||||
CefDevToolsDelegate* devtools_delegate() const { return devtools_delegate_; }
|
CefDevToolsDelegate* devtools_delegate() const { return devtools_delegate_; }
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#include "content/public/browser/render_process_host.h"
|
#include "content/public/browser/render_process_host.h"
|
||||||
#include "content/public/common/content_switches.h"
|
#include "content/public/common/content_switches.h"
|
||||||
#include "googleurl/src/gurl.h"
|
#include "googleurl/src/gurl.h"
|
||||||
#include "third_party/skia/include/core/SkBitmap.h"
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -313,6 +313,7 @@ CefRefPtr<CefBrowserHostImpl> CefContext::GetBrowserByID(int id) {
|
|||||||
return it->get();
|
return it->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DLOG(ERROR) << "No browser matching unique id " << id;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,6 +327,8 @@ CefRefPtr<CefBrowserHostImpl> CefContext::GetBrowserByRoutingID(
|
|||||||
return it->get();
|
return it->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DLOG(ERROR) << "No browser matching process id " << render_process_id <<
|
||||||
|
" and view id " << render_view_id;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,10 +45,14 @@ content::DownloadId CefDownloadManagerDelegate::GetNextId() {
|
|||||||
bool CefDownloadManagerDelegate::ShouldStartDownload(int32 download_id) {
|
bool CefDownloadManagerDelegate::ShouldStartDownload(int32 download_id) {
|
||||||
DownloadItem* download =
|
DownloadItem* download =
|
||||||
download_manager_->GetActiveDownloadItem(download_id);
|
download_manager_->GetActiveDownloadItem(download_id);
|
||||||
DownloadStateInfo state = download->GetStateInfo();
|
|
||||||
|
|
||||||
if (!state.force_file_name.empty())
|
if (!download->GetForcedFilePath().empty()) {
|
||||||
|
download->OnTargetPathDetermined(
|
||||||
|
download->GetForcedFilePath(),
|
||||||
|
DownloadItem::TARGET_DISPOSITION_OVERWRITE,
|
||||||
|
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
FilePath generated_name = net::GenerateFileName(
|
FilePath generated_name = net::GenerateFileName(
|
||||||
download->GetURL(),
|
download->GetURL(),
|
||||||
@ -58,15 +62,12 @@ bool CefDownloadManagerDelegate::ShouldStartDownload(int32 download_id) {
|
|||||||
download->GetMimeType(),
|
download->GetMimeType(),
|
||||||
"download");
|
"download");
|
||||||
|
|
||||||
// Since we have no download UI, show the user a dialog always.
|
|
||||||
state.prompt_user_for_save_location = true;
|
|
||||||
|
|
||||||
BrowserThread::PostTask(
|
BrowserThread::PostTask(
|
||||||
BrowserThread::FILE,
|
BrowserThread::FILE,
|
||||||
FROM_HERE,
|
FROM_HERE,
|
||||||
base::Bind(
|
base::Bind(
|
||||||
&CefDownloadManagerDelegate::GenerateFilename,
|
&CefDownloadManagerDelegate::GenerateFilename,
|
||||||
this, download_id, state, generated_name));
|
this, download_id, generated_name));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ void CefDownloadManagerDelegate::ChooseDownloadPath(
|
|||||||
const FilePath& suggested_path,
|
const FilePath& suggested_path,
|
||||||
int32 download_id) {
|
int32 download_id) {
|
||||||
FilePath result;
|
FilePath result;
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN) && !defined(USE_AURA)
|
||||||
std::wstring file_part = FilePath(suggested_path).BaseName().value();
|
std::wstring file_part = FilePath(suggested_path).BaseName().value();
|
||||||
wchar_t file_name[MAX_PATH];
|
wchar_t file_name[MAX_PATH];
|
||||||
base::wcslcpy(file_name, file_part.c_str(), arraysize(file_name));
|
base::wcslcpy(file_name, file_part.c_str(), arraysize(file_name));
|
||||||
@ -109,32 +110,32 @@ void CefDownloadManagerDelegate::ChooseDownloadPath(
|
|||||||
|
|
||||||
void CefDownloadManagerDelegate::GenerateFilename(
|
void CefDownloadManagerDelegate::GenerateFilename(
|
||||||
int32 download_id,
|
int32 download_id,
|
||||||
DownloadStateInfo state,
|
|
||||||
const FilePath& generated_name) {
|
const FilePath& generated_name) {
|
||||||
if (state.suggested_path.empty()) {
|
FilePath suggested_path = download_manager_->GetBrowserContext()->GetPath().
|
||||||
state.suggested_path = download_manager_->GetBrowserContext()->GetPath().
|
Append(FILE_PATH_LITERAL("Downloads"));
|
||||||
Append(FILE_PATH_LITERAL("Downloads"));
|
if (!file_util::PathExists(suggested_path))
|
||||||
if (!file_util::PathExists(state.suggested_path))
|
file_util::CreateDirectory(suggested_path);
|
||||||
file_util::CreateDirectory(state.suggested_path);
|
|
||||||
}
|
|
||||||
|
|
||||||
state.suggested_path = state.suggested_path.Append(generated_name);
|
|
||||||
|
|
||||||
|
suggested_path = suggested_path.Append(generated_name);
|
||||||
BrowserThread::PostTask(
|
BrowserThread::PostTask(
|
||||||
BrowserThread::UI,
|
BrowserThread::UI,
|
||||||
FROM_HERE,
|
FROM_HERE,
|
||||||
base::Bind(
|
base::Bind(
|
||||||
&CefDownloadManagerDelegate::RestartDownload,
|
&CefDownloadManagerDelegate::RestartDownload,
|
||||||
this, download_id, state));
|
this, download_id, suggested_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefDownloadManagerDelegate::RestartDownload(
|
void CefDownloadManagerDelegate::RestartDownload(
|
||||||
int32 download_id,
|
int32 download_id,
|
||||||
DownloadStateInfo state) {
|
const FilePath& suggested_path) {
|
||||||
DownloadItem* download =
|
DownloadItem* download =
|
||||||
download_manager_->GetActiveDownloadItem(download_id);
|
download_manager_->GetActiveDownloadItem(download_id);
|
||||||
if (!download)
|
if (!download)
|
||||||
return;
|
return;
|
||||||
download->SetFileCheckResults(state);
|
|
||||||
|
// Since we have no download UI, show the user a dialog always.
|
||||||
|
download->OnTargetPathDetermined(suggested_path,
|
||||||
|
DownloadItem::TARGET_DISPOSITION_PROMPT,
|
||||||
|
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS);
|
||||||
download_manager_->RestartDownload(download_id);
|
download_manager_->RestartDownload(download_id);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2011 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.
|
||||||
|
|
||||||
@ -37,10 +37,9 @@ class CefDownloadManagerDelegate
|
|||||||
virtual ~CefDownloadManagerDelegate();
|
virtual ~CefDownloadManagerDelegate();
|
||||||
|
|
||||||
void GenerateFilename(int32 download_id,
|
void GenerateFilename(int32 download_id,
|
||||||
DownloadStateInfo state,
|
|
||||||
const FilePath& generated_name);
|
const FilePath& generated_name);
|
||||||
void RestartDownload(int32 download_id,
|
void RestartDownload(int32 download_id,
|
||||||
DownloadStateInfo state);
|
const FilePath& suggested_path);
|
||||||
|
|
||||||
content::DownloadManager* download_manager_;
|
content::DownloadManager* download_manager_;
|
||||||
|
|
||||||
|
@ -32,20 +32,6 @@ CefContentClient* CefContentClient::Get() {
|
|||||||
return static_cast<CefContentClient*>(content::GetContentClient());
|
return static_cast<CefContentClient*>(content::GetContentClient());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CefContentClient::SetActiveURL(const GURL& url) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefContentClient::SetGpuInfo(const content::GPUInfo& gpu_info) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefContentClient::AddPepperPlugins(
|
|
||||||
std::vector<content::PepperPluginInfo>* plugins) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefContentClient::AddNPAPIPlugins(
|
|
||||||
webkit::npapi::PluginList* plugin_list) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void CefContentClient::AddAdditionalSchemes(
|
void CefContentClient::AddAdditionalSchemes(
|
||||||
std::vector<std::string>* standard_schemes,
|
std::vector<std::string>* standard_schemes,
|
||||||
std::vector<std::string>* savable_schemes) {
|
std::vector<std::string>* savable_schemes) {
|
||||||
@ -68,15 +54,6 @@ void CefContentClient::AddAdditionalSchemes(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CefContentClient::HasWebUIScheme(const GURL& url) const {
|
|
||||||
// There are no WebUI URLs in CEF.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CefContentClient::CanHandleWhileSwappedOut(const IPC::Message& msg) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CefContentClient::GetUserAgent() const {
|
std::string CefContentClient::GetUserAgent() const {
|
||||||
std::string product_version;
|
std::string product_version;
|
||||||
|
|
||||||
@ -114,21 +91,6 @@ base::StringPiece CefContentClient::GetDataResource(
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
bool CefContentClient::SandboxPlugin(CommandLine* command_line,
|
|
||||||
sandbox::TargetPolicy* policy) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
|
||||||
bool CefContentClient::GetSandboxProfileForSandboxType(
|
|
||||||
int sandbox_type,
|
|
||||||
int* sandbox_profile_resource_id) const {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
FilePath CefContentClient::GetPathForResourcePack(
|
FilePath CefContentClient::GetPathForResourcePack(
|
||||||
const FilePath& pack_path,
|
const FilePath& pack_path,
|
||||||
ui::ScaleFactor scale_factor) {
|
ui::ScaleFactor scale_factor) {
|
||||||
|
@ -25,34 +25,15 @@ class CefContentClient : public content::ContentClient,
|
|||||||
static CefContentClient* Get();
|
static CefContentClient* Get();
|
||||||
|
|
||||||
// content::ContentClient methods.
|
// content::ContentClient methods.
|
||||||
virtual void SetActiveURL(const GURL& url) OVERRIDE;
|
|
||||||
virtual void SetGpuInfo(const content::GPUInfo& gpu_info) OVERRIDE;
|
|
||||||
virtual void AddPepperPlugins(
|
|
||||||
std::vector<content::PepperPluginInfo>* plugins) OVERRIDE;
|
|
||||||
virtual void AddNPAPIPlugins(
|
|
||||||
webkit::npapi::PluginList* plugin_list) OVERRIDE;
|
|
||||||
virtual void AddAdditionalSchemes(
|
virtual void AddAdditionalSchemes(
|
||||||
std::vector<std::string>* standard_schemes,
|
std::vector<std::string>* standard_schemes,
|
||||||
std::vector<std::string>* savable_schemes) OVERRIDE;
|
std::vector<std::string>* savable_schemes) OVERRIDE;
|
||||||
virtual bool HasWebUIScheme(const GURL& url) const OVERRIDE;
|
|
||||||
virtual bool CanHandleWhileSwappedOut(const IPC::Message& msg) OVERRIDE;
|
|
||||||
virtual std::string GetUserAgent() const OVERRIDE;
|
virtual std::string GetUserAgent() const OVERRIDE;
|
||||||
virtual string16 GetLocalizedString(int message_id) const OVERRIDE;
|
virtual string16 GetLocalizedString(int message_id) const OVERRIDE;
|
||||||
virtual base::StringPiece GetDataResource(
|
virtual base::StringPiece GetDataResource(
|
||||||
int resource_id,
|
int resource_id,
|
||||||
ui::ScaleFactor scale_factor) const OVERRIDE;
|
ui::ScaleFactor scale_factor) const OVERRIDE;
|
||||||
|
|
||||||
#if defined(OS_WIN)
|
|
||||||
virtual bool SandboxPlugin(CommandLine* command_line,
|
|
||||||
sandbox::TargetPolicy* policy) OVERRIDE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
|
||||||
virtual bool GetSandboxProfileForSandboxType(
|
|
||||||
int sandbox_type,
|
|
||||||
int* sandbox_profile_resource_id) const OVERRIDE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CefRefPtr<CefApp> application() const { return application_; }
|
CefRefPtr<CefApp> application() const { return application_; }
|
||||||
|
|
||||||
void set_pack_loading_disabled(bool val) { pack_loading_disabled_ = val; }
|
void set_pack_loading_disabled(bool val) { pack_loading_disabled_ = val; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user