summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authoryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-26 00:01:31 +0000
committeryoz@chromium.org <yoz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-26 00:01:31 +0000
commit8f4b69e5058bad5559e07b33c258ec0e5adff1b1 (patch)
treeb7e7444fb54b28d562724517d3148291e2d4b048 /apps
parent3a4bd5dc9d0f9c5258dfcf5399ee876e263ae3a3 (diff)
downloadchromium_src-8f4b69e5058bad5559e07b33c258ec0e5adff1b1.zip
chromium_src-8f4b69e5058bad5559e07b33c258ec0e5adff1b1.tar.gz
chromium_src-8f4b69e5058bad5559e07b33c258ec0e5adff1b1.tar.bz2
Move OmahaQueryParams to a component and add a delegate interface.
BUG=376554 Review URL: https://codereview.chromium.org/333353005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279867 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps')
-rw-r--r--apps/shell/app_shell.gyp3
-rw-r--r--apps/shell/browser/DEPS1
-rw-r--r--apps/shell/browser/shell_browser_main_parts.cc7
-rw-r--r--apps/shell/browser/shell_browser_main_parts.h5
-rw-r--r--apps/shell/browser/shell_omaha_query_params_delegate.cc22
-rw-r--r--apps/shell/browser/shell_omaha_query_params_delegate.h26
6 files changed, 62 insertions, 2 deletions
diff --git a/apps/shell/app_shell.gyp b/apps/shell/app_shell.gyp
index 5d69de0..bad66c7 100644
--- a/apps/shell/app_shell.gyp
+++ b/apps/shell/app_shell.gyp
@@ -74,6 +74,7 @@
'<(DEPTH)/apps/shell/common/api/api.gyp:shell_api',
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/base.gyp:base_prefs_test_support',
+ '<(DEPTH)/components/components.gyp:omaha_query_params',
'<(DEPTH)/components/components.gyp:pref_registry',
'<(DEPTH)/components/components.gyp:user_prefs',
'<(DEPTH)/content/content.gyp:content',
@@ -129,6 +130,8 @@
'browser/shell_extensions_browser_client.h',
'browser/shell_network_controller_chromeos.cc',
'browser/shell_network_controller_chromeos.h',
+ 'browser/shell_omaha_query_params_delegate.cc',
+ 'browser/shell_omaha_query_params_delegate.h',
'browser/shell_runtime_api_delegate.cc',
'browser/shell_runtime_api_delegate.h',
'common/shell_content_client.cc',
diff --git a/apps/shell/browser/DEPS b/apps/shell/browser/DEPS
index a803ec5..235b403 100644
--- a/apps/shell/browser/DEPS
+++ b/apps/shell/browser/DEPS
@@ -1,5 +1,6 @@
include_rules = [
"+chromeos",
+ "+components/omaha_query_params",
"+components/pref_registry",
"+components/user_prefs",
"+third_party/cros_system_api",
diff --git a/apps/shell/browser/shell_browser_main_parts.cc b/apps/shell/browser/shell_browser_main_parts.cc
index 7c1d293..b438021 100644
--- a/apps/shell/browser/shell_browser_main_parts.cc
+++ b/apps/shell/browser/shell_browser_main_parts.cc
@@ -10,9 +10,11 @@
#include "apps/shell/browser/shell_extension_system.h"
#include "apps/shell/browser/shell_extension_system_factory.h"
#include "apps/shell/browser/shell_extensions_browser_client.h"
+#include "apps/shell/browser/shell_omaha_query_params_delegate.h"
#include "apps/shell/common/shell_extensions_client.h"
#include "base/run_loop.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
+#include "components/omaha_query_params/omaha_query_params.h"
#include "content/public/common/result_codes.h"
#include "content/shell/browser/shell_devtools_delegate.h"
#include "content/shell/browser/shell_net_log.h"
@@ -99,6 +101,11 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() {
new extensions::ShellExtensionsBrowserClient(browser_context_.get()));
extensions::ExtensionsBrowserClient::Set(extensions_browser_client_.get());
+ omaha_query_params_delegate_.reset(
+ new extensions::ShellOmahaQueryParamsDelegate);
+ omaha_query_params::OmahaQueryParams::SetDelegate(
+ omaha_query_params_delegate_.get());
+
// Create our custom ExtensionSystem first because other
// KeyedServices depend on it.
// TODO(yoz): Move this after EnsureBrowserContextKeyedServiceFactoriesBuilt.
diff --git a/apps/shell/browser/shell_browser_main_parts.h b/apps/shell/browser/shell_browser_main_parts.h
index e9e1491..e9b8bf3 100644
--- a/apps/shell/browser/shell_browser_main_parts.h
+++ b/apps/shell/browser/shell_browser_main_parts.h
@@ -13,7 +13,6 @@
#include "ui/aura/window_tree_host_observer.h"
namespace content {
-class ShellBrowserContext;
class ShellDevToolsDelegate;
struct MainFunctionParams;
}
@@ -21,6 +20,7 @@ struct MainFunctionParams;
namespace extensions {
class ShellExtensionsBrowserClient;
class ShellExtensionSystem;
+class ShellOmahaQueryParamsDelegate;
}
namespace views {
@@ -80,8 +80,9 @@ class ShellBrowserMainParts : public content::BrowserMainParts {
scoped_ptr<extensions::ShellExtensionsBrowserClient>
extensions_browser_client_;
scoped_ptr<net::NetLog> net_log_;
-
scoped_ptr<content::ShellDevToolsDelegate> devtools_delegate_;
+ scoped_ptr<extensions::ShellOmahaQueryParamsDelegate>
+ omaha_query_params_delegate_;
// Owned by the KeyedService system.
extensions::ShellExtensionSystem* extension_system_;
diff --git a/apps/shell/browser/shell_omaha_query_params_delegate.cc b/apps/shell/browser/shell_omaha_query_params_delegate.cc
new file mode 100644
index 0000000..fa949d1
--- /dev/null
+++ b/apps/shell/browser/shell_omaha_query_params_delegate.cc
@@ -0,0 +1,22 @@
+// Copyright 2014 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 "apps/shell/browser/shell_omaha_query_params_delegate.h"
+
+namespace extensions {
+
+ShellOmahaQueryParamsDelegate::ShellOmahaQueryParamsDelegate() {
+}
+
+ShellOmahaQueryParamsDelegate::~ShellOmahaQueryParamsDelegate() {
+}
+
+std::string ShellOmahaQueryParamsDelegate::GetExtraParams() {
+ // This version number is high enough to be supported by Omaha
+ // (below 31 is unsupported), but it's fake enough to be obviously
+ // not a Chrome release.
+ return "&prodversion=38.1234.5678.9";
+}
+
+} // namespace extensions
diff --git a/apps/shell/browser/shell_omaha_query_params_delegate.h b/apps/shell/browser/shell_omaha_query_params_delegate.h
new file mode 100644
index 0000000..fc30292
--- /dev/null
+++ b/apps/shell/browser/shell_omaha_query_params_delegate.h
@@ -0,0 +1,26 @@
+// Copyright 2014 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.
+
+#ifndef APPS_SHELL_BROWSER_SHELL_OMAHA_QUERY_PARAMS_DELEGATE_H_
+#define APPS_SHELL_BROWSER_SHELL_OMAHA_QUERY_PARAMS_DELEGATE_H_
+
+#include "components/omaha_query_params/omaha_query_params_delegate.h"
+
+namespace extensions {
+
+class ShellOmahaQueryParamsDelegate
+ : public omaha_query_params::OmahaQueryParamsDelegate {
+ public:
+ ShellOmahaQueryParamsDelegate();
+ virtual ~ShellOmahaQueryParamsDelegate();
+
+ virtual std::string GetExtraParams() OVERRIDE;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ShellOmahaQueryParamsDelegate);
+};
+
+} // namespace extensions
+
+#endif // APPS_SHELL_BROWSER_SHELL_OMAHA_QUERY_PARAMS_DELEGATE_H_