#include "content/public/common/content_switches.h"
#include "content/public/common/pepper_plugin_info.h"
#include "content/public/common/url_constants.h"
+#include "content/public/common/user_agent.h"
#include "extensions/common/constants.h"
#include "gpu/config/gpu_info.h"
#include "grit/common_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
-#include "webkit/common/user_agent/user_agent_util.h"
#include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR.
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
std::vector<std::string> codecs;
codecs.push_back(kCdmSupportedCodecVorbis);
codecs.push_back(kCdmSupportedCodecVp8);
+ // TODO(xhwang): Add VP9 when it's supported by Widevine CDM.
+ // See http://crbug.com/361318
#if defined(USE_PROPRIETARY_CODECS)
// TODO(ddorwin): Rename these macros to reflect their real meaning: whether the
// CDM Chrome was built [and shipped] with support these types.
const std::string& version) {
content::PepperPluginInfo plugin;
- // Flash being out of process is handled separately than general plugins
- // for testing purposes.
- plugin.is_out_of_process = !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kPpapiFlashInProcess);
+ plugin.is_out_of_process = true;
plugin.name = content::kFlashPluginName;
plugin.path = path;
plugin.permissions = kPepperFlashPermissions;
#endif // FLAPPER_AVAILABLE
}
+std::string GetProduct() {
+ chrome::VersionInfo version_info;
+ return version_info.is_valid() ?
+ version_info.ProductNameAndVersionForUserAgent() : std::string();
+}
+
} // namespace
+std::string GetUserAgent() {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kUserAgent))
+ return command_line->GetSwitchValueASCII(switches::kUserAgent);
+
+ std::string product = GetProduct();
+#if defined(OS_ANDROID)
+ if (command_line->HasSwitch(switches::kUseMobileUserAgent))
+ product += " Mobile";
+#endif
+ return content::BuildUserAgentFromProduct(product);
+}
+
void ChromeContentClient::SetActiveURL(const GURL& url) {
base::debug::SetCrashKeyValue(crash_keys::kActiveURL,
url.possibly_invalid_spec());
std::vector<std::string>* savable_schemes) {
standard_schemes->push_back(extensions::kExtensionScheme);
savable_schemes->push_back(extensions::kExtensionScheme);
+ standard_schemes->push_back(chrome::kChromeNativeScheme);
standard_schemes->push_back(extensions::kExtensionResourceScheme);
savable_schemes->push_back(extensions::kExtensionResourceScheme);
standard_schemes->push_back(chrome::kChromeSearchScheme);
#endif
}
-bool ChromeContentClient::CanHandleWhileSwappedOut(
- const IPC::Message& msg) {
- // Any Chrome-specific messages (apart from those listed in
- // CanSendWhileSwappedOut) that must be handled by the browser when sent from
- // swapped out renderers.
- return false;
-}
-
std::string ChromeContentClient::GetProduct() const {
- chrome::VersionInfo version_info;
- return version_info.is_valid() ?
- version_info.ProductNameAndVersionForUserAgent() : std::string();
+ return ::GetProduct();
}
std::string ChromeContentClient::GetUserAgent() const {
- std::string product = GetProduct();
-#if defined(OS_ANDROID)
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kUseMobileUserAgent))
- product += " Mobile";
-#endif
- return webkit_glue::BuildUserAgentFromProduct(product);
+ return ::GetUserAgent();
}
base::string16 ChromeContentClient::GetLocalizedString(int message_id) const {