Update to Chromium revision 137849.

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@631 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt 2012-05-18 20:32:28 +00:00
parent 761187a673
commit 9c9711c2d8
12 changed files with 88 additions and 58 deletions

View File

@ -17,5 +17,5 @@
{ {
'chromium_url': 'http://src.chromium.org/svn/trunk/src', 'chromium_url': 'http://src.chromium.org/svn/trunk/src',
'chromium_revision': '136953', 'chromium_revision': '137849',
} }

View File

@ -641,7 +641,7 @@
'conditions': [ 'conditions': [
['OS != "mac"', { ['OS != "mac"', {
'pak_inputs': [ 'pak_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak', '<(SHARED_INTERMEDIATE_DIR)/ui/native_theme/native_theme_resources.pak',
] ]
}], }],
], ],
@ -672,7 +672,7 @@
'conditions': [ 'conditions': [
['OS != "mac"', { ['OS != "mac"', {
'header_inputs': [ 'header_inputs': [
'<(SHARED_INTERMEDIATE_DIR)/ui/gfx/grit/gfx_resources.h', '<(SHARED_INTERMEDIATE_DIR)/ui/native_theme/grit/native_theme_resources.h',
] ]
}], }],
], ],
@ -710,7 +710,7 @@
'conditions': [ 'conditions': [
['OS != "mac"', { ['OS != "mac"', {
'dependencies': [ 'dependencies': [
'<(DEPTH)/ui/ui.gyp:gfx_resources', '<(DEPTH)/ui/ui.gyp:native_theme_resources',
], ],
}], }],
], ],

View File

@ -902,7 +902,8 @@ void CefBrowserHostImpl::DidCommitProvisionalLoadForFrame(
int64 frame_id, int64 frame_id,
bool is_main_frame, bool is_main_frame,
const GURL& url, const GURL& url,
content::PageTransition transition_type) { content::PageTransition transition_type,
content::RenderViewHost* render_view_host) {
CefRefPtr<CefFrame> frame = GetOrCreateFrame(frame_id, CefRefPtr<CefFrame> frame = GetOrCreateFrame(frame_id,
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(), url); CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(), url);
OnLoadStart(frame, url, transition_type); OnLoadStart(frame, url, transition_type);
@ -915,7 +916,8 @@ void CefBrowserHostImpl::DidFailProvisionalLoad(
bool is_main_frame, bool is_main_frame,
const GURL& validated_url, const GURL& validated_url,
int error_code, int error_code,
const string16& error_description) { const string16& error_description,
content::RenderViewHost* render_view_host) {
CefRefPtr<CefFrame> frame = GetOrCreateFrame(frame_id, CefRefPtr<CefFrame> frame = GetOrCreateFrame(frame_id,
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(), CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(),
validated_url); validated_url);

View File

@ -219,13 +219,15 @@ class CefBrowserHostImpl : public CefBrowserHost,
int64 frame_id, int64 frame_id,
bool is_main_frame, bool is_main_frame,
const GURL& url, const GURL& url,
content::PageTransition transition_type) OVERRIDE; content::PageTransition transition_type,
content::RenderViewHost* render_view_host) OVERRIDE;
virtual void DidFailProvisionalLoad( virtual void DidFailProvisionalLoad(
int64 frame_id, int64 frame_id,
bool is_main_frame, bool is_main_frame,
const GURL& validated_url, const GURL& validated_url,
int error_code, int error_code,
const string16& error_description) OVERRIDE; const string16& error_description,
content::RenderViewHost* render_view_host) OVERRIDE;
virtual void DocumentAvailableInMainFrame() OVERRIDE; virtual void DocumentAvailableInMainFrame() OVERRIDE;
virtual void DidFinishLoad(int64 frame_id, virtual void DidFinishLoad(int64 frame_id,
const GURL& validated_url, const GURL& validated_url,

View File

@ -3,6 +3,9 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "libcef/browser/browser_main.h" #include "libcef/browser/browser_main.h"
#include <string>
#include "libcef/browser/browser_context.h" #include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_message_loop.h" #include "libcef/browser/browser_message_loop.h"
#include "libcef/browser/content_browser_client.h" #include "libcef/browser/content_browser_client.h"
@ -31,7 +34,7 @@ base::StringPiece ResourceProvider(int resource_id) {
return content::GetContentClient()->GetDataResource(resource_id); return content::GetContentClient()->GetDataResource(resource_id);
} }
} } // namespace
CefBrowserMainParts::CefBrowserMainParts( CefBrowserMainParts::CefBrowserMainParts(
const content::MainFunctionParams& parameters) const content::MainFunctionParams& parameters)
@ -56,7 +59,7 @@ int CefBrowserMainParts::PreCreateThreads() {
void CefBrowserMainParts::PreMainMessageLoopRun() { void CefBrowserMainParts::PreMainMessageLoopRun() {
browser_context_.reset(new CefBrowserContext()); browser_context_.reset(new CefBrowserContext());
PlatformInitialize(); PlatformInitialize();
net::NetModule::SetResourceProvider(&ResourceProvider); net::NetModule::SetResourceProvider(&ResourceProvider);

View File

@ -14,27 +14,40 @@
#include "content/public/browser/gpu_data_manager.h" #include "content/public/browser/gpu_data_manager.h"
#include "webkit/glue/webpreferences.h" #include "webkit/glue/webpreferences.h"
void BrowserToWebSettings(const CefBrowserSettings& cef, using webkit_glue::WebPreferences;
webkit_glue::WebPreferences& web) {
if (cef.standard_font_family.length > 0)
web.standard_font_family = CefString(&cef.standard_font_family);
else
web.standard_font_family = ASCIIToUTF16("Times");
if (cef.fixed_font_family.length > 0) void BrowserToWebSettings(const CefBrowserSettings& cef, WebPreferences& web) {
web.fixed_font_family = CefString(&cef.fixed_font_family); if (cef.standard_font_family.length > 0) {
else web.standard_font_family_map[WebPreferences::kCommonScript] =
web.fixed_font_family = ASCIIToUTF16("Courier"); CefString(&cef.standard_font_family);
} else {
web.standard_font_family_map[WebPreferences::kCommonScript] =
ASCIIToUTF16("Times");
}
if (cef.serif_font_family.length > 0) if (cef.fixed_font_family.length > 0) {
web.serif_font_family = CefString(&cef.serif_font_family); web.fixed_font_family_map[WebPreferences::kCommonScript] =
else CefString(&cef.fixed_font_family);
web.serif_font_family = ASCIIToUTF16("Times"); } else {
web.fixed_font_family_map[WebPreferences::kCommonScript] =
ASCIIToUTF16("Courier");
}
if (cef.sans_serif_font_family.length > 0) if (cef.serif_font_family.length > 0) {
web.sans_serif_font_family = CefString(&cef.sans_serif_font_family); web.serif_font_family_map[WebPreferences::kCommonScript] =
else CefString(&cef.serif_font_family);
web.sans_serif_font_family = ASCIIToUTF16("Helvetica"); } else {
web.serif_font_family_map[WebPreferences::kCommonScript] =
ASCIIToUTF16("Times");
}
if (cef.sans_serif_font_family.length > 0) {
web.sans_serif_font_family_map[WebPreferences::kCommonScript] =
CefString(&cef.sans_serif_font_family);
} else {
web.sans_serif_font_family_map[WebPreferences::kCommonScript] =
ASCIIToUTF16("Helvetica");
}
// These two fonts below are picked from the intersection of // These two fonts below are picked from the intersection of
// Win XP font list and Vista font list : // Win XP font list and Vista font list :
@ -48,22 +61,26 @@ void BrowserToWebSettings(const CefBrowserSettings& cef,
// as long as they're available. // as long as they're available.
if (cef.cursive_font_family.length > 0) { if (cef.cursive_font_family.length > 0) {
web.cursive_font_family = CefString(&cef.cursive_font_family); web.cursive_font_family_map[WebPreferences::kCommonScript] =
CefString(&cef.cursive_font_family);
} else { } else {
web.cursive_font_family_map[WebPreferences::kCommonScript] =
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
web.cursive_font_family = ASCIIToUTF16("Apple Chancery"); ASCIIToUTF16("Apple Chancery");
#else #else
web.cursive_font_family = ASCIIToUTF16("Comic Sans MS"); ASCIIToUTF16("Comic Sans MS");
#endif #endif
} }
if (cef.fantasy_font_family.length > 0) { if (cef.fantasy_font_family.length > 0) {
web.fantasy_font_family = CefString(&cef.fantasy_font_family); web.fantasy_font_family_map[WebPreferences::kCommonScript] =
CefString(&cef.fantasy_font_family);
} else { } else {
web.fantasy_font_family_map[WebPreferences::kCommonScript] =
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
web.fantasy_font_family = ASCIIToUTF16("Papyrus"); ASCIIToUTF16("Papyrus");
#else #else
web.fantasy_font_family = ASCIIToUTF16("Impact"); ASCIIToUTF16("Impact");
#endif #endif
} }

View File

@ -270,6 +270,7 @@ void CefContentBrowserClient::AllowCertificateError(
const net::SSLInfo& ssl_info, const net::SSLInfo& ssl_info,
const GURL& request_url, const GURL& request_url,
bool overridable, bool overridable,
bool strict_enforcement,
const base::Callback<void(bool)>& callback, const base::Callback<void(bool)>& callback,
bool* cancel_request) { bool* cancel_request) {
} }

View File

@ -112,6 +112,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
const net::SSLInfo& ssl_info, const net::SSLInfo& ssl_info,
const GURL& request_url, const GURL& request_url,
bool overridable, bool overridable,
bool strict_enforcement,
const base::Callback<void(bool)>& callback, const base::Callback<void(bool)>& callback,
bool* cancel_request) OVERRIDE; bool* cancel_request) OVERRIDE;
virtual void SelectClientCertificate( virtual void SelectClientCertificate(

View File

@ -230,7 +230,7 @@ bool CefCookieManagerImpl::SetStoragePath(const CefString& path) {
if (!new_path.empty()) { if (!new_path.empty()) {
// 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::SetIOAllowed(true); base::ThreadRestrictions::ScopedAllowIO allow_io;
if (file_util::CreateDirectory(new_path)) { if (file_util::CreateDirectory(new_path)) {
const FilePath& cookie_path = new_path.AppendASCII("Cookies"); const FilePath& cookie_path = new_path.AppendASCII("Cookies");
persistent_store = new SQLitePersistentCookieStore(cookie_path, false); persistent_store = new SQLitePersistentCookieStore(cookie_path, false);
@ -238,7 +238,6 @@ bool CefCookieManagerImpl::SetStoragePath(const CefString& path) {
NOTREACHED() << "The cookie storage directory could not be created"; NOTREACHED() << "The cookie storage directory could not be created";
storage_path_.clear(); storage_path_.clear();
} }
base::ThreadRestrictions::SetIOAllowed(false);
} }
// Set the new cookie store that will be used for all new requests. The old // Set the new cookie store that will be used for all new requests. The old

View File

@ -11,6 +11,7 @@
#include "include/cef_menu_model.h" #include "include/cef_menu_model.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "ui/base/models/menu_model.h" #include "ui/base/models/menu_model.h"

View File

@ -299,14 +299,13 @@ void CefURLRequestContextGetter::SetCookieStoragePath(const FilePath& path) {
if (!path.empty()) { if (!path.empty()) {
// 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::SetIOAllowed(true); base::ThreadRestrictions::ScopedAllowIO allow_io;
if (file_util::CreateDirectory(path)) { if (file_util::CreateDirectory(path)) {
const FilePath& cookie_path = path.AppendASCII("Cookies"); const FilePath& cookie_path = path.AppendASCII("Cookies");
persistent_store = new SQLitePersistentCookieStore(cookie_path, false); persistent_store = new SQLitePersistentCookieStore(cookie_path, false);
} else { } else {
NOTREACHED() << "The cookie storage directory could not be created"; NOTREACHED() << "The cookie storage directory could not be created";
} }
base::ThreadRestrictions::SetIOAllowed(false);
} }
// Set the new cookie store that will be used for all new requests. The old // Set the new cookie store that will be used for all new requests. The old

View File

@ -239,8 +239,8 @@ void CefMainDelegate::PreSandboxStartup() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kPackLoadingDisabled)) if (command_line.HasSwitch(switches::kPackLoadingDisabled))
content_client_.set_pack_loading_disabled(true); content_client_.set_pack_loading_disabled(true);
else
InitializeResourceBundle(); InitializeResourceBundle();
} }
void CefMainDelegate::SandboxInitialized(const std::string& process_type) { void CefMainDelegate::SandboxInitialized(const std::string& process_type) {
@ -280,8 +280,7 @@ int CefMainDelegate::RunProcess(
} }
void CefMainDelegate::ProcessExiting(const std::string& process_type) { void CefMainDelegate::ProcessExiting(const std::string& process_type) {
if (!content_client_.pack_loading_disabled()) ResourceBundle::CleanupSharedInstance();
ResourceBundle::CleanupSharedInstance();
} }
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
@ -351,33 +350,39 @@ void CefMainDelegate::InitializeContentClient(
void CefMainDelegate::InitializeResourceBundle() { void CefMainDelegate::InitializeResourceBundle() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); const CommandLine& command_line = *CommandLine::ForCurrentProcess();
FilePath pak_file, locales_dir; FilePath pak_file, locales_dir;
if (command_line.HasSwitch(switches::kPackFilePath)) if (!content_client_.pack_loading_disabled()) {
pak_file = command_line.GetSwitchValuePath(switches::kPackFilePath); if (command_line.HasSwitch(switches::kPackFilePath))
pak_file = command_line.GetSwitchValuePath(switches::kPackFilePath);
if (pak_file.empty()) if (pak_file.empty())
pak_file = GetDefaultPackPath().Append(FILE_PATH_LITERAL("cef.pak")); pak_file = GetDefaultPackPath().Append(FILE_PATH_LITERAL("cef.pak"));
if (command_line.HasSwitch(switches::kLocalesDirPath)) if (command_line.HasSwitch(switches::kLocalesDirPath))
locales_dir = command_line.GetSwitchValuePath(switches::kLocalesDirPath); locales_dir = command_line.GetSwitchValuePath(switches::kLocalesDirPath);
if (!locales_dir.empty()) if (!locales_dir.empty())
PathService::Override(ui::DIR_LOCALES, locales_dir); PathService::Override(ui::DIR_LOCALES, locales_dir);
}
std::string locale = command_line.GetSwitchValueASCII(switches::kLocale); std::string locale = command_line.GetSwitchValueASCII(switches::kLocale);
if (locale.empty()) if (locale.empty())
locale = "en-US"; locale = "en-US";
const std::string loaded_locale = const std::string loaded_locale =
ui::ResourceBundle::InitSharedInstanceWithLocaleCef(locale); ui::ResourceBundle::InitSharedInstanceWithLocale(locale,
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale; &content_client_);
if (!content_client_.pack_loading_disabled()) {
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
if (file_util::PathExists(pak_file)) { if (file_util::PathExists(pak_file)) {
ResourceBundle::GetSharedInstance().AddDataPack( content_client_.set_allow_pack_file_load(true);
pak_file, ui::ResourceHandle::kScaleFactor100x); ResourceBundle::GetSharedInstance().AddDataPack(
} else { pak_file, ui::ResourceHandle::kScaleFactor100x);
NOTREACHED() << "Could not load cef.pak"; content_client_.set_allow_pack_file_load(false);
} else {
NOTREACHED() << "Could not load cef.pak";
}
} }
} }