summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidyu@chromium.org <davidyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-13 08:55:31 +0000
committerdavidyu@chromium.org <davidyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-13 08:55:31 +0000
commitb6b14a8f0f961349836e838b1fbb98c4f5e85fb1 (patch)
treedb9f10aeed34b74e6f269f951761383a0ca33a1a
parentcd150860584a9e8d3f650e1173a0da2fb356af0c (diff)
downloadchromium_src-b6b14a8f0f961349836e838b1fbb98c4f5e85fb1.zip
chromium_src-b6b14a8f0f961349836e838b1fbb98c4f5e85fb1.tar.gz
chromium_src-b6b14a8f0f961349836e838b1fbb98c4f5e85fb1.tar.bz2
Add a new component app Guide to Chrome (code name GeniusApp) to replace HelpApp. Add a command line switch so that we can easily fall back to the old one if necessary.
BUG=chromium:281234 TEST=manual Review URL: https://chromiumcodereview.appspot.com/23548023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223006 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser_resources.grd1
-rw-r--r--chrome/browser/chromeos/genius_app/app_id.h15
-rw-r--r--chrome/browser/extensions/component_loader.cc7
-rw-r--r--chrome/browser/resources/chromeos/genius_app/OWNERS3
-rw-r--r--chrome/browser/resources/chromeos/genius_app/manifest.json28
-rw-r--r--chrome/browser/ui/chrome_pages.cc19
-rw-r--r--chrome/chrome_browser_chromeos.gypi1
-rw-r--r--chromeos/chromeos_switches.cc3
-rw-r--r--chromeos/chromeos_switches.h1
9 files changed, 78 insertions, 0 deletions
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
index 2b44bb7..8a1e839 100644
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -342,6 +342,7 @@
<include name="IDR_TAB_MODAL_CONFIRM_DIALOG_HTML" file="resources\tab_modal_confirm_dialog.html" flattenhtml="true" type="BINDATA" />
</if>
<if expr="pp_ifdef('chromeos') and pp_ifdef('_google_chrome')">
+ <include name="IDR_GENIUS_APP_MANIFEST" file="resources\chromeos\genius_app\manifest.json" type="BINDATA" />
<include name="IDR_HELP_MANIFEST" file="resources\help_app\manifest.json" type="BINDATA" />
<include name="IDR_QUICKOFFICE_VIEWING_MANIFEST" file="resources\quick_office\manifest_viewing.json" type="BINDATA" />
<include name="IDR_QUICKOFFICE_EDITOR_MANIFEST" file="resources\quick_office\manifest_editor.json" type="BINDATA" />
diff --git a/chrome/browser/chromeos/genius_app/app_id.h b/chrome/browser/chromeos/genius_app/app_id.h
new file mode 100644
index 0000000..f81717a
--- /dev/null
+++ b/chrome/browser/chromeos/genius_app/app_id.h
@@ -0,0 +1,15 @@
+// Copyright 2013 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 CHROME_BROWSER_CHROMEOS_GENIUS_APP_APP_ID_H_
+#define CHROME_BROWSER_CHROMEOS_GENIUS_APP_APP_ID_H_
+
+namespace genius_app {
+
+// The genius app ID.
+const char kGeniusAppId[] = "ljoammodoonkhnehlncldjelhidljdpi";
+
+} // namespace genius_app
+
+#endif // CHROME_BROWSER_CHROMEOS_GENIUS_APP_APP_ID_H_
diff --git a/chrome/browser/extensions/component_loader.cc b/chrome/browser/extensions/component_loader.cc
index f4cc777..ed41f82 100644
--- a/chrome/browser/extensions/component_loader.cc
+++ b/chrome/browser/extensions/component_loader.cc
@@ -355,6 +355,13 @@ void ComponentLoader::AddDefaultComponentExtensions(
base::FilePath(FILE_PATH_LITERAL("/usr/share/chromeos-assets/mobile")));
#if defined(GOOGLE_CHROME_BUILD)
+ {
+ const CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (!command_line->HasSwitch(chromeos::switches::kDisableGeniusApp)) {
+ Add(IDR_GENIUS_APP_MANIFEST, base::FilePath(FILE_PATH_LITERAL(
+ "/usr/share/chromeos-assets/genius_app")));
+ }
+ }
if (browser_defaults::enable_help_app) {
Add(IDR_HELP_MANIFEST, base::FilePath(FILE_PATH_LITERAL(
"/usr/share/chromeos-assets/helpapp")));
diff --git a/chrome/browser/resources/chromeos/genius_app/OWNERS b/chrome/browser/resources/chromeos/genius_app/OWNERS
new file mode 100644
index 0000000..3aa8a1c
--- /dev/null
+++ b/chrome/browser/resources/chromeos/genius_app/OWNERS
@@ -0,0 +1,3 @@
+cnwan@chromium.org
+cylee@chromium.org
+davidyu@chromium.org
diff --git a/chrome/browser/resources/chromeos/genius_app/manifest.json b/chrome/browser/resources/chromeos/genius_app/manifest.json
new file mode 100644
index 0000000..8f5b15e
--- /dev/null
+++ b/chrome/browser/resources/chromeos/genius_app/manifest.json
@@ -0,0 +1,28 @@
+{
+ "key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNAtiHknM7LHSwE9YKiFFvYvsp0TkfIriWfrjz53odJD0jEbOtyNhVXqdBOdtcenbSraxt7oJ9GlIfUkvBMP5iOpcrJkYfuNJv8ANHTKC79TjGXRg76TjiqpNI+R2NiVav1pXlzYZpu0ToaiaOcr3IgoGsvIUPcC6pd1U5AjdrCQIDAQAB",
+ "manifest_version": 2,
+ "name": "__MSG_app_name__",
+ "description": "__MSG_app_description__",
+ "version": "0.2",
+ "minimum_chrome_version": "28",
+ "default_locale": "en",
+ "icons": {
+ "16": "icon/16.png",
+ "256": "icon/256.png"
+ },
+ "app": {
+ "background": {
+ "persistent": false,
+ "page": "background.html"
+ }
+ },
+ "permissions": [
+ "chromeosInfoPrivate",
+ "webview",
+ "unlimitedStorage",
+ "https://commondatastorage.googleapis.com/*",
+ "https://storage.googleapis.com/*",
+ "https://www-googleapis-test.sandbox.google.com/*",
+ "https://www.googleapis.com/*"
+ ]
+}
diff --git a/chrome/browser/ui/chrome_pages.cc b/chrome/browser/ui/chrome_pages.cc
index 34d9b6b..a42b5e2 100644
--- a/chrome/browser/ui/chrome_pages.cc
+++ b/chrome/browser/ui/chrome_pages.cc
@@ -4,17 +4,21 @@
#include "chrome/browser/ui/chrome_pages.h"
+#include "base/command_line.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/download/download_shelf.h"
+#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/signin/signin_manager.h"
#include "chrome/browser/signin/signin_manager_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/singleton_tabs.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/webui/options/content_settings_handler.h"
@@ -28,6 +32,11 @@
#include "chrome/browser/enumerate_modules_model_win.h"
#endif
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/genius_app/app_id.h"
+#include "chromeos/chromeos_switches.h"
+#endif
+
using content::UserMetricsAction;
namespace chrome {
@@ -126,6 +135,16 @@ void ShowConflicts(Browser* browser) {
void ShowHelp(Browser* browser, HelpSource source) {
content::RecordAction(UserMetricsAction("ShowHelpTab"));
+#if defined(OS_CHROMEOS) && defined(OFFICIAL_BUILD)
+ const CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (!command_line->HasSwitch(chromeos::switches::kDisableGeniusApp)) {
+ Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord();
+ const extensions::Extension* extension = profile->GetExtensionService()->
+ GetInstalledExtension(genius_app::kGeniusAppId);
+ OpenApplication(AppLaunchParams(profile, extension, 0));
+ return;
+ }
+#endif
GURL url;
switch (source) {
case HELP_SOURCE_KEYBOARD:
diff --git a/chrome/chrome_browser_chromeos.gypi b/chrome/chrome_browser_chromeos.gypi
index 18fe9bc..1298129 100644
--- a/chrome/chrome_browser_chromeos.gypi
+++ b/chrome/chrome_browser_chromeos.gypi
@@ -360,6 +360,7 @@
'browser/chromeos/first_run/first_run_controller.h',
'browser/chromeos/first_run/first_run_view.cc',
'browser/chromeos/first_run/first_run_view.h',
+ 'browser/chromeos/genius_app/app_id.h',
'browser/chromeos/imageburner/burn_controller.cc',
'browser/chromeos/imageburner/burn_controller.h',
'browser/chromeos/imageburner/burn_device_handler.cc',
diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc
index 54f5b70..3919a5e 100644
--- a/chromeos/chromeos_switches.cc
+++ b/chromeos/chromeos_switches.cc
@@ -38,6 +38,9 @@ const char kDisableChromeCaptivePortalDetector[] =
// Disables Google Drive integration.
const char kDisableDrive[] = "disable-drive";
+// Disable Genius App and use the original Help App instead.
+const char kDisableGeniusApp[] = "disable-genius-app";
+
// Disable policy-configured local accounts.
const char kDisableLocalAccounts[] = "disable-local-accounts";
diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h
index 603d7db..598aade 100644
--- a/chromeos/chromeos_switches.h
+++ b/chromeos/chromeos_switches.h
@@ -29,6 +29,7 @@ CHROMEOS_EXPORT extern const char kDefaultStubNetworkStateIdle[];
CHROMEOS_EXPORT extern const char kDisableBootAnimation[];
CHROMEOS_EXPORT extern const char kDisableChromeCaptivePortalDetector[];
CHROMEOS_EXPORT extern const char kDisableDrive[];
+CHROMEOS_EXPORT extern const char kDisableGeniusApp[];
CHROMEOS_EXPORT extern const char kDisableLocalAccounts[];
CHROMEOS_EXPORT extern const char kDisableLoginAnimations[];
CHROMEOS_EXPORT extern const char kDisableNewChannelSwitcherUI[];