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_revision': '136953',
'chromium_revision': '137849',
}

View File

@ -641,7 +641,7 @@
'conditions': [
['OS != "mac"', {
'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': [
['OS != "mac"', {
'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': [
['OS != "mac"', {
'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,
bool is_main_frame,
const GURL& url,
content::PageTransition transition_type) {
content::PageTransition transition_type,
content::RenderViewHost* render_view_host) {
CefRefPtr<CefFrame> frame = GetOrCreateFrame(frame_id,
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(), url);
OnLoadStart(frame, url, transition_type);
@ -915,7 +916,8 @@ void CefBrowserHostImpl::DidFailProvisionalLoad(
bool is_main_frame,
const GURL& validated_url,
int error_code,
const string16& error_description) {
const string16& error_description,
content::RenderViewHost* render_view_host) {
CefRefPtr<CefFrame> frame = GetOrCreateFrame(frame_id,
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(),
validated_url);

View File

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

View File

@ -3,6 +3,9 @@
// found in the LICENSE file.
#include "libcef/browser/browser_main.h"
#include <string>
#include "libcef/browser/browser_context.h"
#include "libcef/browser/browser_message_loop.h"
#include "libcef/browser/content_browser_client.h"
@ -31,7 +34,7 @@ base::StringPiece ResourceProvider(int resource_id) {
return content::GetContentClient()->GetDataResource(resource_id);
}
}
} // namespace
CefBrowserMainParts::CefBrowserMainParts(
const content::MainFunctionParams& parameters)

View File

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

View File

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

View File

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

View File

@ -230,7 +230,7 @@ bool CefCookieManagerImpl::SetStoragePath(const CefString& path) {
if (!new_path.empty()) {
// TODO(cef): Move directory creation to the blocking pool instead of
// allowing file IO on this thread.
base::ThreadRestrictions::SetIOAllowed(true);
base::ThreadRestrictions::ScopedAllowIO allow_io;
if (file_util::CreateDirectory(new_path)) {
const FilePath& cookie_path = new_path.AppendASCII("Cookies");
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";
storage_path_.clear();
}
base::ThreadRestrictions::SetIOAllowed(false);
}
// 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 "base/memory/scoped_ptr.h"
#include "base/threading/platform_thread.h"
#include "ui/base/models/menu_model.h"

View File

@ -299,14 +299,13 @@ void CefURLRequestContextGetter::SetCookieStoragePath(const FilePath& path) {
if (!path.empty()) {
// TODO(cef): Move directory creation to the blocking pool instead of
// allowing file IO on this thread.
base::ThreadRestrictions::SetIOAllowed(true);
base::ThreadRestrictions::ScopedAllowIO allow_io;
if (file_util::CreateDirectory(path)) {
const FilePath& cookie_path = path.AppendASCII("Cookies");
persistent_store = new SQLitePersistentCookieStore(cookie_path, false);
} else {
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

View File

@ -239,7 +239,7 @@ void CefMainDelegate::PreSandboxStartup() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kPackLoadingDisabled))
content_client_.set_pack_loading_disabled(true);
else
InitializeResourceBundle();
}
@ -280,7 +280,6 @@ int CefMainDelegate::RunProcess(
}
void CefMainDelegate::ProcessExiting(const std::string& process_type) {
if (!content_client_.pack_loading_disabled())
ResourceBundle::CleanupSharedInstance();
}
@ -351,9 +350,9 @@ void CefMainDelegate::InitializeContentClient(
void CefMainDelegate::InitializeResourceBundle() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
FilePath pak_file, locales_dir;
if (!content_client_.pack_loading_disabled()) {
if (command_line.HasSwitch(switches::kPackFilePath))
pak_file = command_line.GetSwitchValuePath(switches::kPackFilePath);
@ -365,19 +364,25 @@ void CefMainDelegate::InitializeResourceBundle() {
if (!locales_dir.empty())
PathService::Override(ui::DIR_LOCALES, locales_dir);
}
std::string locale = command_line.GetSwitchValueASCII(switches::kLocale);
if (locale.empty())
locale = "en-US";
const std::string loaded_locale =
ui::ResourceBundle::InitSharedInstanceWithLocaleCef(locale);
ui::ResourceBundle::InitSharedInstanceWithLocale(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)) {
content_client_.set_allow_pack_file_load(true);
ResourceBundle::GetSharedInstance().AddDataPack(
pak_file, ui::ResourceHandle::kScaleFactor100x);
content_client_.set_allow_pack_file_load(false);
} else {
NOTREACHED() << "Could not load cef.pak";
}
}
}