Commit 6f922731 authored by Marshall Greenblatt's avatar Marshall Greenblatt

Update to Chromium revision 181864.

- Adds support for chrome://view-http-cache/*, chrome://appcache-internals/, chrome://blob-internals/, chrome://tcmalloc/ and chrome://histograms/

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1106 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
parent fd97bbf2
......@@ -17,5 +17,5 @@
{
'chromium_url': 'http://src.chromium.org/svn/trunk/src',
'chromium_revision': '176706',
'chromium_revision': '181864',
}
......@@ -7,6 +7,7 @@
'pkg-config': 'pkg-config',
'chromium_code': 1,
'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/cef',
'about_credits_file': '<(SHARED_INTERMEDIATE_DIR)/about_credits.html',
'revision': '<!(python tools/revision.py)',
# Need to be creative to match dylib version formatting requirements.
'version_mac_dylib':
......@@ -632,15 +633,47 @@
}],
],
},
{
'target_name': 'about_credits',
'type': 'none',
'actions': [
{
'variables': {
'generator_path': '../tools/licenses.py',
},
'action_name': 'generate_about_credits',
'inputs': [
# TODO(phajdan.jr): make licenses.py print inputs too.
'<(generator_path)',
],
'outputs': [
'<(about_credits_file)',
],
'hard_dependency': 1,
'action': ['python',
'<(generator_path)',
'credits',
'<(about_credits_file)',
],
'message': 'Generating about:credits.',
},
],
},
{
# Create the pack file for CEF resources.
'target_name': 'cef_resources',
'type': 'none',
'dependencies': [
'about_credits',
],
'actions': [
{
'action_name': 'cef_resources',
'variables': {
'grit_grd_file': 'libcef/resources/cef_resources.grd',
'grit_additional_defines': [
'-E', 'about_credits_file=<(about_credits_file)',
],
},
'includes': [ '../build/grit_action.gypi' ],
},
......@@ -838,8 +871,8 @@
'libcef/browser/internal_scheme_handler.cc',
'libcef/browser/internal_scheme_handler.h',
'libcef/browser/javascript_dialog.h',
'libcef/browser/javascript_dialog_creator.cc',
'libcef/browser/javascript_dialog_creator.h',
'libcef/browser/javascript_dialog_manager.cc',
'libcef/browser/javascript_dialog_manager.h',
'libcef/browser/menu_creator.cc',
'libcef/browser/menu_creator.h',
'libcef/browser/menu_model_impl.cc',
......@@ -851,8 +884,6 @@
'libcef/browser/path_util_impl.cc',
'libcef/browser/process_util_impl.cc',
'libcef/browser/proxy_stubs.cc',
'libcef/browser/resource_context.cc',
'libcef/browser/resource_context.h',
'libcef/browser/resource_dispatcher_host_delegate.cc',
'libcef/browser/resource_dispatcher_host_delegate.h',
'libcef/browser/resource_request_job.cc',
......@@ -965,16 +996,6 @@
'<(DEPTH)/chrome/browser/net/proxy_service_factory.h',
'<(DEPTH)/chrome/browser/prefs/command_line_pref_store.cc',
'<(DEPTH)/chrome/browser/prefs/command_line_pref_store.h',
'<(DEPTH)/chrome/browser/prefs/pref_notifier_impl.cc',
'<(DEPTH)/chrome/browser/prefs/pref_notifier_impl.h',
'<(DEPTH)/chrome/browser/prefs/pref_service.cc',
'<(DEPTH)/chrome/browser/prefs/pref_service.h',
'<(DEPTH)/chrome/browser/prefs/pref_service_builder.cc',
'<(DEPTH)/chrome/browser/prefs/pref_service_builder.h',
'<(DEPTH)/chrome/browser/prefs/pref_service_simple.cc',
'<(DEPTH)/chrome/browser/prefs/pref_service_simple.h',
'<(DEPTH)/chrome/browser/prefs/pref_value_store.cc',
'<(DEPTH)/chrome/browser/prefs/pref_value_store.h',
'<(DEPTH)/chrome/browser/prefs/proxy_config_dictionary.cc',
'<(DEPTH)/chrome/browser/prefs/proxy_config_dictionary.h',
'<(DEPTH)/chrome/browser/prefs/proxy_prefs.cc',
......
......@@ -9,7 +9,6 @@
#include "libcef/browser/browser_host_impl.h"
#include "libcef/browser/context.h"
#include "libcef/browser/download_manager_delegate.h"
#include "libcef/browser/resource_context.h"
#include "libcef/browser/thread_util.h"
#include "libcef/browser/url_request_context_getter.h"
......@@ -19,7 +18,9 @@
#include "content/public/browser/download_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/geolocation_permission_context.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/speech_recognition_preferences.h"
#include "content/public/browser/storage_partition.h"
using content::BrowserThread;
......@@ -172,12 +173,34 @@ class CefSpeechRecognitionPreferences
} // namespace
class CefBrowserContext::CefResourceContext : public content::ResourceContext {
public:
CefResourceContext() : getter_(NULL) {}
virtual ~CefResourceContext() {}
// ResourceContext implementation:
virtual net::HostResolver* GetHostResolver() OVERRIDE {
CHECK(getter_);
return getter_->host_resolver();
}
virtual net::URLRequestContext* GetRequestContext() OVERRIDE {
CHECK(getter_);
return getter_->GetURLRequestContext();
}
void set_url_request_context_getter(CefURLRequestContextGetter* getter) {
getter_ = getter;
}
private:
CefURLRequestContextGetter* getter_;
DISALLOW_COPY_AND_ASSIGN(CefResourceContext);
};
CefBrowserContext::CefBrowserContext()
: use_osr_next_contents_view_(false) {
// Initialize the request context getter.
url_request_getter_ = new CefURLRequestContextGetter(
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE));
: use_osr_next_contents_view_(false),
resource_context_(new CefResourceContext) {
}
CefBrowserContext::~CefBrowserContext() {
......@@ -192,7 +215,7 @@ CefBrowserContext::~CefBrowserContext() {
}
}
FilePath CefBrowserContext::GetPath() {
base::FilePath CefBrowserContext::GetPath() {
return _Context->cache_path();
}
......@@ -210,7 +233,8 @@ content::DownloadManagerDelegate*
}
net::URLRequestContextGetter* CefBrowserContext::GetRequestContext() {
return url_request_getter_;
CEF_REQUIRE_UIT();
return GetDefaultStoragePartition(this)->GetURLRequestContext();
}
net::URLRequestContextGetter*
......@@ -236,23 +260,12 @@ net::URLRequestContextGetter*
net::URLRequestContextGetter*
CefBrowserContext::GetMediaRequestContextForStoragePartition(
const FilePath& partition_path,
const base::FilePath& partition_path,
bool in_memory) {
return GetRequestContext();
}
net::URLRequestContextGetter*
CefBrowserContext::GetRequestContextForStoragePartition(
const FilePath& partition_path,
bool in_memory) {
return NULL;
}
content::ResourceContext* CefBrowserContext::GetResourceContext() {
if (!resource_context_.get()) {
resource_context_.reset(new CefResourceContext(
static_cast<CefURLRequestContextGetter*>(GetRequestContext())));
}
return resource_context_.get();
}
......@@ -276,6 +289,48 @@ quota::SpecialStoragePolicy* CefBrowserContext::GetSpecialStoragePolicy() {
return NULL;
}
net::URLRequestContextGetter* CefBrowserContext::CreateRequestContext(
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
blob_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
file_system_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
developer_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_devtools_protocol_handler) {
DCHECK(!url_request_getter_);
// CEF doesn't use URLDataManager for serving chrome internal protocols.
// |chrome_protocol_handler| and |chrome_devtools_protocol_handler| are
// ignored so as not to conflict with CEF's protocol implementation.
url_request_getter_ = new CefURLRequestContextGetter(
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO),
BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::FILE),
blob_protocol_handler.Pass(),
file_system_protocol_handler.Pass(),
developer_protocol_handler.Pass());
resource_context_->set_url_request_context_getter(url_request_getter_.get());
return url_request_getter_.get();
}
net::URLRequestContextGetter*
CefBrowserContext::CreateRequestContextForStoragePartition(
const base::FilePath& partition_path,
bool in_memory,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
blob_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
file_system_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
developer_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_devtools_protocol_handler) {
return NULL;
}
bool CefBrowserContext::use_osr_next_contents_view() const {
return use_osr_next_contents_view_;
}
......
......@@ -11,6 +11,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/browser_context.h"
#include "net/url_request/url_request_job_factory.h"
namespace content {
class DownloadManagerDelegate;
......@@ -18,7 +19,7 @@ class SpeechRecognitionPreferences;
}
class CefDownloadManagerDelegate;
class CefResourceContext;
class CefURLRequestContextGetter;
class CefBrowserContext : public content::BrowserContext {
public:
......@@ -26,7 +27,7 @@ class CefBrowserContext : public content::BrowserContext {
virtual ~CefBrowserContext();
// BrowserContext methods.
virtual FilePath GetPath() OVERRIDE;
virtual base::FilePath GetPath() OVERRIDE;
virtual bool IsOffTheRecord() const OVERRIDE;
virtual content::DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE;
virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
......@@ -37,11 +38,8 @@ class CefBrowserContext : public content::BrowserContext {
int renderer_child_id) OVERRIDE;
virtual net::URLRequestContextGetter*
GetMediaRequestContextForStoragePartition(
const FilePath& partition_path,
const base::FilePath& partition_path,
bool in_memory) OVERRIDE;
virtual net::URLRequestContextGetter* GetRequestContextForStoragePartition(
const FilePath& partition_path,
bool in_memory) OVERRIDE;
virtual content::ResourceContext* GetResourceContext() OVERRIDE;
virtual content::GeolocationPermissionContext*
GetGeolocationPermissionContext() OVERRIDE;
......@@ -49,6 +47,31 @@ class CefBrowserContext : public content::BrowserContext {
GetSpeechRecognitionPreferences() OVERRIDE;
virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
net::URLRequestContextGetter* CreateRequestContext(
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
blob_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
file_system_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
developer_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_devtools_protocol_handler);
net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
const FilePath& partition_path,
bool in_memory,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
blob_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
file_system_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
developer_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_protocol_handler,
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
chrome_devtools_protocol_handler);
// To disable window rendering call this function with |override|=true
// just before calling WebContents::Create. This will cause
// CefContentBrowserClient::OverrideCreateWebContentsView to create
......@@ -57,10 +80,11 @@ class CefBrowserContext : public content::BrowserContext {
bool use_osr_next_contents_view() const;
private:
class CefResourceContext;
scoped_ptr<CefResourceContext> resource_context_;
scoped_ptr<CefDownloadManagerDelegate> download_manager_delegate_;
scoped_refptr<net::URLRequestContextGetter> url_request_getter_;
scoped_refptr<CefURLRequestContextGetter> url_request_getter_;
scoped_refptr<content::GeolocationPermissionContext>
geolocation_permission_context_;
scoped_refptr<content::SpeechRecognitionPreferences>
......
......@@ -39,7 +39,7 @@
#include "content/public/browser/notification_types.h"
#include "content/public/browser/resource_request_info.h"
#include "content/public/common/file_chooser_params.h"
#include "ui/base/dialogs/selected_file_info.h"
#include "ui/shell_dialogs/selected_file_info.h"
#if defined(OS_WIN)
#include "libcef/browser/render_widget_host_view_osr.h"
......@@ -133,11 +133,11 @@ class CefFileDialogCallbackImpl : public CefFileDialogCallback {
virtual void Continue(const std::vector<CefString>& file_paths) OVERRIDE {
if (CEF_CURRENTLY_ON_UIT()) {
if (!callback_.is_null()) {
std::vector<FilePath> vec;
std::vector<base::FilePath> vec;
if (!file_paths.empty()) {
std::vector<CefString>::const_iterator it = file_paths.begin();
for (; it != file_paths.end(); ++it)
vec.push_back(FilePath(*it));
vec.push_back(base::FilePath(*it));
}
callback_.Run(vec);
callback_.Reset();
......@@ -172,7 +172,7 @@ class CefFileDialogCallbackImpl : public CefFileDialogCallback {
static void CancelNow(
const CefBrowserHostImpl::RunFileChooserCallback& callback) {
CEF_REQUIRE_UIT();
std::vector<FilePath> file_paths;
std::vector<base::FilePath> file_paths;
callback.Run(file_paths);
}
......@@ -190,7 +190,7 @@ class CefRunFileDialogCallbackWrapper
callback_(callback) {
}
void Callback(const std::vector<FilePath>& file_paths) {
void Callback(const std::vector<base::FilePath>& file_paths) {
std::vector<CefString> paths;
if (file_paths.size() > 0) {
for (size_t i = 0; i < file_paths.size(); ++i)
......@@ -544,7 +544,7 @@ void CefBrowserHostImpl::RunFileDialog(
}
params.title = title;
if (!default_file_name.empty())
params.default_file_name = FilePath(default_file_name);
params.default_file_name = base::FilePath(default_file_name);
if (!accept_types.empty()) {
std::vector<CefString>::const_iterator it = accept_types.begin();
for (; it != accept_types.end(); ++it)
......@@ -1079,7 +1079,7 @@ net::URLRequestContextGetter* CefBrowserHostImpl::GetRequestContext() {
request_context_proxy_ =
new CefURLRequestContextGetterProxy(this,
static_cast<CefURLRequestContextGetter*>(
_Context->browser_context()->GetRequestContext()));
_Context->request_context().get()));
}
return request_context_proxy_.get();
}
......@@ -1569,11 +1569,11 @@ void CefBrowserHostImpl::DidNavigateMainFramePostCommit(
has_document_ = false;
}
content::JavaScriptDialogCreator*
CefBrowserHostImpl::GetJavaScriptDialogCreator() {
if (!dialog_creator_.get())
dialog_creator_.reset(new CefJavaScriptDialogCreator(this));
return dialog_creator_.get();
content::JavaScriptDialogManager*
CefBrowserHostImpl::GetJavaScriptDialogManager() {
if (!dialog_manager_.get())
dialog_manager_.reset(new CefJavaScriptDialogManager(this));
return dialog_manager_.get();
}
void CefBrowserHostImpl::RunFileChooser(
......@@ -1730,7 +1730,7 @@ void CefBrowserHostImpl::DidFailLoad(
OnLoadEnd(frame, validated_url, error_code);
}
void CefBrowserHostImpl::PluginCrashed(const FilePath& plugin_path,
void CefBrowserHostImpl::PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) {
if (client_.get()) {
CefRefPtr<CefLoadHandler> handler = client_->GetLoadHandler();
......@@ -2092,13 +2092,13 @@ void CefBrowserHostImpl::RunFileChooserOnUIThread(
if (file_chooser_pending_) {
// Dismiss the new dialog immediately.
callback.Run(std::vector<FilePath>());
callback.Run(std::vector<base::FilePath>());
return;
}
if (params.mode == content::FileChooserParams::OpenFolder) {
NOTIMPLEMENTED();
callback.Run(std::vector<FilePath>());
callback.Run(std::vector<base::FilePath>());
return;
}
......@@ -2157,7 +2157,7 @@ void CefBrowserHostImpl::RunFileChooserOnUIThread(
void CefBrowserHostImpl::OnRunFileChooserCallback(
const RunFileChooserCallback& callback,
const std::vector<FilePath>& file_paths) {
const std::vector<base::FilePath>& file_paths) {
CEF_REQUIRE_UIT();
file_chooser_pending_ = false;
......@@ -2168,7 +2168,7 @@ void CefBrowserHostImpl::OnRunFileChooserCallback(
void CefBrowserHostImpl::OnRunFileChooserDelegateCallback(
content::WebContents* tab,
const std::vector<FilePath>& file_paths) {
const std::vector<base::FilePath>& file_paths) {
CEF_REQUIRE_UIT();
content::RenderViewHost* render_view_host = tab->GetRenderViewHost();
......@@ -2183,8 +2183,10 @@ void CefBrowserHostImpl::OnRunFileChooserDelegateCallback(
// Convert FilePath list to SelectedFileInfo list.
std::vector<ui::SelectedFileInfo> selected_files;
for (size_t i = 0; i < file_paths.size(); ++i)
selected_files.push_back(ui::SelectedFileInfo(file_paths[i], FilePath()));
for (size_t i = 0; i < file_paths.size(); ++i) {
selected_files.push_back(
ui::SelectedFileInfo(file_paths[i], base::FilePath()));
}
// Notify our RenderViewHost in all cases.
render_view_host->FilesSelectedInChooser(selected_files,
......
......@@ -16,7 +16,7 @@
#include "include/cef_client.h"
#include "include/cef_frame.h"
#include "libcef/browser/frame_host_impl.h"
#include "libcef/browser/javascript_dialog_creator.h"
#include "libcef/browser/javascript_dialog_manager.h"
#include "libcef/browser/menu_creator.h"
#include "libcef/common/response_manager.h"
......@@ -235,7 +235,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
void OnSetFocus(cef_focus_source_t source);
// The argument vector will be empty if the dialog was cancelled.
typedef base::Callback<void(const std::vector<FilePath>&)>
typedef base::Callback<void(const std::vector<base::FilePath>&)>
RunFileChooserCallback;
// Run the file chooser dialog specified by |params|. Only a single dialog may
......@@ -292,7 +292,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
content::WebContents* new_contents) OVERRIDE;
virtual void DidNavigateMainFramePostCommit(
content::WebContents* tab) OVERRIDE;
virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator()
virtual content::JavaScriptDialogManager* GetJavaScriptDialogManager()
OVERRIDE;
virtual void RunFileChooser(
content::WebContents* tab,
......@@ -331,7 +331,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
int error_code,
const string16& error_description,
content::RenderViewHost* render_view_host) OVERRIDE;
virtual void PluginCrashed(const FilePath& plugin_path,
virtual void PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// Override to provide a thread safe implementation.
......@@ -438,12 +438,12 @@ class CefBrowserHostImpl : public CefBrowserHost,
// Used with RunFileChooser to clear the |file_chooser_pending_| flag.
void OnRunFileChooserCallback(const RunFileChooserCallback& callback,
const std::vector<FilePath>& file_paths);
const std::vector<base::FilePath>& file_paths);
// Used with WebContentsDelegate::RunFileChooser to notify the WebContents.
void OnRunFileChooserDelegateCallback(
content::WebContents* tab,
const std::vector<FilePath>& file_paths);
const std::vector<base::FilePath>& file_paths);
CefWindowInfo window_info_;
CefBrowserSettings settings_;
......@@ -501,7 +501,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
scoped_ptr<CefResponseManager> response_manager_;
// Used for creating and managing JavaScript dialogs.
scoped_ptr<CefJavaScriptDialogCreator> dialog_creator_;
scoped_ptr<CefJavaScriptDialogManager> dialog_manager_;
// Used for creating and managing context menus.
scoped_ptr<CefMenuCreator> menu_creator_;
......
......@@ -75,7 +75,7 @@ void AddFiltersForAcceptTypes(GtkFileChooser* chooser,
std::string description = GetDescriptionFromMimeType(ascii_type);
bool description_from_ext = description.empty();
std::vector<FilePath::StringType> ext;
std::vector<base::FilePath::StringType> ext;
net::GetExtensionsForMimeType(ascii_type, &ext);
for (size_t x = 0; x < ext.size(); ++x) {
if (!filter)
......@@ -113,7 +113,7 @@ void AddFiltersForAcceptTypes(GtkFileChooser* chooser,
bool RunFileDialog(const content::FileChooserParams& params,
CefWindowHandle widget,
std::vector<FilePath>* files) {
std::vector<base::FilePath>* files) {
GtkFileChooserAction action;
const gchar* accept_button;
if (params.mode == content::FileChooserParams::Open ||
......@@ -129,7 +129,7 @@ bool RunFileDialog(const content::FileChooserParams& params,
}
// Consider default file name if any.
FilePath default_file_name(params.default_file_name);
base::FilePath default_file_name(params.default_file_name);
std::string base_name;
if (!default_file_name.empty())
......@@ -185,7 +185,7 @@ bool RunFileDialog(const content::FileChooserParams& params,
if (params.mode == content::FileChooserParams::Open ||
params.mode == content::FileChooserParams::Save) {
char* filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
files->push_back(FilePath(filename));
files->push_back(base::FilePath(filename));
success = true;
} else if (params.mode == content::FileChooserParams::OpenMultiple) {
GSList* filenames =
......@@ -193,7 +193,7 @@ bool RunFileDialog(const content::FileChooserParams& params,
if (filenames) {
for (GSList* iter = filenames; iter != NULL;
iter = g_slist_next(iter)) {
FilePath path(static_cast<char*>(iter->data));
base::FilePath path(static_cast<char*>(iter->data));
g_free(iter->data);
files->push_back(path);
}
......@@ -318,7 +318,7 @@ void CefBrowserHostImpl::PlatformHandleKeyboardEvent(
void CefBrowserHostImpl::PlatformRunFileChooser(
const content::FileChooserParams& params,
RunFileChooserCallback callback) {
std::vector<FilePath> files;
std::vector<base::FilePath> files;
if (params.mode == content::FileChooserParams::Open ||
params.mode == content::FileChooserParams::OpenMultiple ||
......
......@@ -82,7 +82,7 @@ NSMutableArray* GetFileTypesFromAcceptTypes(
[acceptArray addObject:base::SysUTF8ToNSString(ascii_type.substr(1))];
} else {
// Otherwise convert mime type to one or more extensions.
std::vector<FilePath::StringType> ext;
std::vector<base::FilePath::StringType> ext;
net::GetExtensionsForMimeType(ascii_type, &ext);
for (size_t x = 0; x < ext.size(); ++x)
[acceptArray addObject:base::SysUTF8ToNSString(ext[x])];
......@@ -94,7 +94,7 @@ NSMutableArray* GetFileTypesFromAcceptTypes(
void RunOpenFileDialog(const content::FileChooserParams& params,
NSView* view,
std::vector<FilePath>* files) {
std::vector<base::FilePath>* files) {
NSOpenPanel* openPanel = [NSOpenPanel openPanel];
string16 title;
......@@ -108,7 +108,7 @@ void RunOpenFileDialog(const content::FileChooserParams& params,
[openPanel setTitle:base::SysUTF16ToNSString(title)];
// Consider default file name if any.
FilePath default_file_name(params.default_file_name);
base::FilePath default_file_name(params.default_file_name);
if (!default_file_name.empty()) {
if (!default_file_name.BaseName().empty()) {
......@@ -145,7 +145,7 @@ void RunOpenFileDialog(const content::FileChooserParams& params,
for (i=0; i<count; i++) {
NSURL* url = [urls objectAtIndex:i];
if ([url isFileURL])
files->push_back(FilePath(base::SysNSStringToUTF8([url path])));
files->push_back(base::FilePath(base::SysNSStringToUTF8([url path])));
}
}
[NSApp endSheet:openPanel];
......@@ -153,7 +153,7 @@ void RunOpenFileDialog(const content::FileChooserParams& params,
bool RunSaveFileDialog(const content::FileChooserParams& params,
NSView* view,
FilePath* file) {
base::FilePath* file) {
NSSavePanel* savePanel = [NSSavePanel savePanel];
string16 title;
......@@ -164,7 +164,7 @@ bool RunSaveFileDialog(const content::FileChooserParams& params,
[savePanel setTitle:base::SysUTF16ToNSString(title)];
// Consider default file name if any.
FilePath default_file_name(params.default_file_name);
base::FilePath default_file_name(params.default_file_name);
if (!default_file_name.empty()) {
if (!default_file_name.BaseName().empty()) {
......@@ -194,7 +194,7 @@ bool RunSaveFileDialog(const content::FileChooserParams& params,
if ([savePanel runModal] == NSFileHandlingPanelOKButton) {
NSURL * url = [savePanel URL];
NSString* path = [url path];
*file = FilePath([path UTF8String]);
*file = base::FilePath([path UTF8String]);
success = true;
}
[NSApp endSheet:savePanel];
......@@ -300,13 +300,13 @@ void CefBrowserHostImpl::PlatformHandleKeyboardEvent(
void CefBrowserHostImpl::PlatformRunFileChooser(