diff --git a/CHROMIUM_BUILD_COMPATIBILITY.txt b/CHROMIUM_BUILD_COMPATIBILITY.txt index 6c9465e77..cbbb002ab 100644 --- a/CHROMIUM_BUILD_COMPATIBILITY.txt +++ b/CHROMIUM_BUILD_COMPATIBILITY.txt @@ -17,5 +17,5 @@ { 'chromium_url': 'http://src.chromium.org/svn/trunk/src', - 'chromium_revision': '136953', + 'chromium_revision': '137849', } diff --git a/cef.gyp b/cef.gyp index ed4a636d8..047868dc6 100644 --- a/cef.gyp +++ b/cef.gyp @@ -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', ], }], ], diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index 6261f64c6..bb6a62e25 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -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 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 frame = GetOrCreateFrame(frame_id, CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, string16(), validated_url); diff --git a/libcef/browser/browser_host_impl.h b/libcef/browser/browser_host_impl.h index bb75673b4..5bf0bf90c 100644 --- a/libcef/browser/browser_host_impl.h +++ b/libcef/browser/browser_host_impl.h @@ -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, diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index 01d7115b6..56d08beab 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -3,6 +3,9 @@ // found in the LICENSE file. #include "libcef/browser/browser_main.h" + +#include + #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) @@ -56,7 +59,7 @@ int CefBrowserMainParts::PreCreateThreads() { void CefBrowserMainParts::PreMainMessageLoopRun() { browser_context_.reset(new CefBrowserContext()); - + PlatformInitialize(); net::NetModule::SetResourceProvider(&ResourceProvider); diff --git a/libcef/browser/browser_settings.cc b/libcef/browser/browser_settings.cc index a1dcc743b..33feb8db9 100644 --- a/libcef/browser/browser_settings.cc +++ b/libcef/browser/browser_settings.cc @@ -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 } diff --git a/libcef/browser/content_browser_client.cc b/libcef/browser/content_browser_client.cc index 872a1a417..025e1403f 100644 --- a/libcef/browser/content_browser_client.cc +++ b/libcef/browser/content_browser_client.cc @@ -270,6 +270,7 @@ void CefContentBrowserClient::AllowCertificateError( const net::SSLInfo& ssl_info, const GURL& request_url, bool overridable, + bool strict_enforcement, const base::Callback& callback, bool* cancel_request) { } diff --git a/libcef/browser/content_browser_client.h b/libcef/browser/content_browser_client.h index 2ff3330dc..4774baff3 100644 --- a/libcef/browser/content_browser_client.h +++ b/libcef/browser/content_browser_client.h @@ -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& callback, bool* cancel_request) OVERRIDE; virtual void SelectClientCertificate( diff --git a/libcef/browser/cookie_manager_impl.cc b/libcef/browser/cookie_manager_impl.cc index acd488272..171fd29e2 100644 --- a/libcef/browser/cookie_manager_impl.cc +++ b/libcef/browser/cookie_manager_impl.cc @@ -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 diff --git a/libcef/browser/menu_model_impl.h b/libcef/browser/menu_model_impl.h index ae7034ccf..102b68d97 100644 --- a/libcef/browser/menu_model_impl.h +++ b/libcef/browser/menu_model_impl.h @@ -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" diff --git a/libcef/browser/url_request_context_getter.cc b/libcef/browser/url_request_context_getter.cc index 8b53f3523..b57b3b96f 100644 --- a/libcef/browser/url_request_context_getter.cc +++ b/libcef/browser/url_request_context_getter.cc @@ -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 diff --git a/libcef/common/main_delegate.cc b/libcef/common/main_delegate.cc index 3055655aa..ea4eb9b42 100644 --- a/libcef/common/main_delegate.cc +++ b/libcef/common/main_delegate.cc @@ -239,8 +239,8 @@ void CefMainDelegate::PreSandboxStartup() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); if (command_line.HasSwitch(switches::kPackLoadingDisabled)) content_client_.set_pack_loading_disabled(true); - else - InitializeResourceBundle(); + + InitializeResourceBundle(); } void CefMainDelegate::SandboxInitialized(const std::string& process_type) { @@ -280,8 +280,7 @@ int CefMainDelegate::RunProcess( } void CefMainDelegate::ProcessExiting(const std::string& process_type) { - if (!content_client_.pack_loading_disabled()) - ResourceBundle::CleanupSharedInstance(); + ResourceBundle::CleanupSharedInstance(); } #if defined(OS_MACOSX) @@ -351,33 +350,39 @@ void CefMainDelegate::InitializeContentClient( void CefMainDelegate::InitializeResourceBundle() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); - FilePath pak_file, locales_dir; - if (command_line.HasSwitch(switches::kPackFilePath)) - pak_file = command_line.GetSwitchValuePath(switches::kPackFilePath); + if (!content_client_.pack_loading_disabled()) { + if (command_line.HasSwitch(switches::kPackFilePath)) + pak_file = command_line.GetSwitchValuePath(switches::kPackFilePath); - if (pak_file.empty()) - pak_file = GetDefaultPackPath().Append(FILE_PATH_LITERAL("cef.pak")); + if (pak_file.empty()) + pak_file = GetDefaultPackPath().Append(FILE_PATH_LITERAL("cef.pak")); - if (command_line.HasSwitch(switches::kLocalesDirPath)) - locales_dir = command_line.GetSwitchValuePath(switches::kLocalesDirPath); + if (command_line.HasSwitch(switches::kLocalesDirPath)) + locales_dir = command_line.GetSwitchValuePath(switches::kLocalesDirPath); - if (!locales_dir.empty()) - PathService::Override(ui::DIR_LOCALES, locales_dir); + 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); - CHECK(!loaded_locale.empty()) << "Locale could not be found for " << 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)) { - ResourceBundle::GetSharedInstance().AddDataPack( - pak_file, ui::ResourceHandle::kScaleFactor100x); - } else { - NOTREACHED() << "Could not load cef.pak"; + 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"; + } } }