| Index: chrome/browser/web_resource/plugins_resource_service.cc
|
| diff --git a/chrome/browser/web_resource/plugins_resource_service.cc b/chrome/browser/web_resource/plugins_resource_service.cc
|
| deleted file mode 100644
|
| index e6df0fd8dbd0419a39cd9d591480ef6beb13a02c..0000000000000000000000000000000000000000
|
| --- a/chrome/browser/web_resource/plugins_resource_service.cc
|
| +++ /dev/null
|
| @@ -1,78 +0,0 @@
|
| -// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -#include "chrome/browser/web_resource/plugins_resource_service.h"
|
| -
|
| -#include "base/command_line.h"
|
| -#include "chrome/browser/plugins/plugin_finder.h"
|
| -#include "chrome/browser/prefs/pref_registry_simple.h"
|
| -#include "chrome/browser/prefs/pref_service.h"
|
| -#include "chrome/common/chrome_switches.h"
|
| -#include "chrome/common/pref_names.h"
|
| -#include "googleurl/src/gurl.h"
|
| -
|
| -namespace {
|
| -
|
| -// Delay on first fetch so we don't interfere with startup.
|
| -const int kStartResourceFetchDelayMs = 60 * 1000;
|
| -
|
| -// Delay between calls to update the cache 1 day and 2 minutes in testing mode.
|
| -const int kCacheUpdateDelayMs = 24 * 60 * 60 * 1000;
|
| -const int kTestCacheUpdateDelayMs = 2 * 60 * 1000;
|
| -
|
| -const char kPluginsServerUrl[] =
|
| - "https://www.gstatic.com/chrome/config/plugins_2/";
|
| -
|
| -bool IsTest() {
|
| - return CommandLine::ForCurrentProcess()->HasSwitch(
|
| - switches::kPluginsMetadataServerURL);
|
| -}
|
| -
|
| -GURL GetPluginsServerURL() {
|
| - std::string filename;
|
| -#if defined(OS_WIN)
|
| - filename = "plugins_win.json";
|
| -#elif defined(OS_LINUX)
|
| - filename = "plugins_linux.json";
|
| -#elif defined(OS_MACOSX)
|
| - filename = "plugins_mac.json";
|
| -#else
|
| - NOTREACHED();
|
| -#endif
|
| -
|
| - std::string test_url =
|
| - CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
| - switches::kPluginsMetadataServerURL);
|
| - return GURL(IsTest() ? test_url : kPluginsServerUrl + filename);
|
| -}
|
| -
|
| -int GetCacheUpdateDelay() {
|
| - return IsTest() ? kTestCacheUpdateDelayMs : kCacheUpdateDelayMs;
|
| -}
|
| -
|
| -} // namespace
|
| -
|
| -PluginsResourceService::PluginsResourceService(PrefService* local_state)
|
| - : WebResourceService(local_state,
|
| - GetPluginsServerURL(),
|
| - false,
|
| - prefs::kPluginsResourceCacheUpdate,
|
| - kStartResourceFetchDelayMs,
|
| - GetCacheUpdateDelay()) {
|
| -}
|
| -
|
| -PluginsResourceService::~PluginsResourceService() {
|
| -}
|
| -
|
| -// static
|
| -void PluginsResourceService::RegisterPrefs(PrefRegistrySimple* registry) {
|
| - registry->RegisterDictionaryPref(prefs::kPluginsMetadata,
|
| - new base::DictionaryValue());
|
| - registry->RegisterStringPref(prefs::kPluginsResourceCacheUpdate, "0");
|
| -}
|
| -
|
| -void PluginsResourceService::Unpack(const DictionaryValue& parsed_json) {
|
| - prefs_->Set(prefs::kPluginsMetadata, parsed_json);
|
| - PluginFinder::GetInstance()->ReinitializePlugins(parsed_json);
|
| -}
|
|
|