Commit 5d43d980 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Extensions Click-to-Script] Add help article in chrome://extensions

Add a link to the help article for runtime host permissions in
the chrome://extensions page.

Note: the article that lives at this page is currently a placeholder,
and will be updated on the server.

Bug: 877664

Change-Id: Idc46b063d502b99458457679f279fa8d10e8e131
Reviewed-on: https://chromium-review.googlesource.com/1220473Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591530}
parent 40eae224
...@@ -91,6 +91,9 @@ ...@@ -91,6 +91,9 @@
<message name="IDS_MD_EXTENSIONS_HOST_PERMISSIONS_EDIT" desc="The label of the button used to edit an extension's access to a given website."> <message name="IDS_MD_EXTENSIONS_HOST_PERMISSIONS_EDIT" desc="The label of the button used to edit an extension's access to a given website.">
Edit Edit
</message> </message>
<message name="IDS_MD_EXTENSIONS_HOST_PERMISSIONS_LEARN_MORE" desc="The caption containing the link at which the user can learn more about extension host access">
Learn more about <ph name="BEGIN_LINK">&lt;a target="_blank" href="$1"&gt;</ph>site access<ph name="END_LINK">&lt;/a&gt;</ph>
</message>
<message name="IDS_MD_EXTENSIONS_ITEM_ERRORS" desc="The label of the button to bring the user to the page showing an extension's errors."> <message name="IDS_MD_EXTENSIONS_ITEM_ERRORS" desc="The label of the button to bring the user to the page showing an extension's errors.">
Errors Errors
</message> </message>
......
...@@ -472,6 +472,8 @@ jumbo_static_library("extensions") { ...@@ -472,6 +472,8 @@ jumbo_static_library("extensions") {
"chrome_content_verifier_delegate.h", "chrome_content_verifier_delegate.h",
"chrome_extension_api_frame_id_map_helper.cc", "chrome_extension_api_frame_id_map_helper.cc",
"chrome_extension_api_frame_id_map_helper.h", "chrome_extension_api_frame_id_map_helper.h",
"chrome_extension_browser_constants.cc",
"chrome_extension_browser_constants.h",
"chrome_extension_chooser_dialog.h", "chrome_extension_chooser_dialog.h",
"chrome_extension_function.cc", "chrome_extension_function.cc",
"chrome_extension_function.h", "chrome_extension_function.h",
......
// Copyright 2018 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/extensions/chrome_extension_browser_constants.h"
namespace chrome_extension_constants {
// The link to the help article for runtime host permissions.
const char kRuntimeHostPermissionsHelpURL[] =
"https://support.google.com/chrome?p=enable_extensions";
} // namespace chrome_extension_constants
// Copyright 2018 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_EXTENSIONS_CHROME_EXTENSION_BROWSER_CONSTANTS_H_
#define CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_BROWSER_CONSTANTS_H_
// Constants that are only needed by the //chrome/browser layer, and thus
// don't need to be in //extensions/common.
namespace chrome_extension_constants {
extern const char kRuntimeHostPermissionsHelpURL[];
} // namespace chrome_extension_constants
#endif // CHROME_BROWSER_EXTENSIONS_CHROME_EXTENSION_BROWSER_CONSTANTS_H_
...@@ -37,10 +37,20 @@ ...@@ -37,10 +37,20 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
a[href] {
color: var(--google-blue-700);
text-decoration: none;
}
</style> </style>
<div id="permissions-mode"> <div id="permissions-mode">
<div class="mid-section-header"> <div>
$i18n{hostPermissionsHeading} <div class="mid-section-header">
$i18n{hostPermissionsHeading}
</div>
<div>
$i18nRaw{hostPermissionsLearnMoreLink}
</div>
</div> </div>
<select id="host-access" class="md-select" <select id="host-access" class="md-select"
value="[[permissions.hostAccess]]" value="[[permissions.hostAccess]]"
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "base/timer/elapsed_timer.h" #include "base/timer/elapsed_timer.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/chrome_extension_browser_constants.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/metrics_handler.h" #include "chrome/browser/ui/webui/metrics_handler.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
...@@ -30,8 +31,8 @@ ...@@ -30,8 +31,8 @@
#include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
#include "content/public/common/content_features.h" #include "content/public/common/content_features.h"
#include "extensions/common/extension_urls.h" #include "extensions/common/extension_urls.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -307,6 +308,12 @@ content::WebUIDataSource* CreateMdExtensionsSource(bool in_dev_mode) { ...@@ -307,6 +308,12 @@ content::WebUIDataSource* CreateMdExtensionsSource(bool in_dev_mode) {
GURL(extension_urls::GetWebstoreExtensionsCategoryURL()), GURL(extension_urls::GetWebstoreExtensionsCategoryURL()),
g_browser_process->GetApplicationLocale()) g_browser_process->GetApplicationLocale())
.spec())); .spec()));
source->AddString(
"hostPermissionsLearnMoreLink",
l10n_util::GetStringFUTF16(
IDS_MD_EXTENSIONS_HOST_PERMISSIONS_LEARN_MORE,
base::ASCIIToUTF16(
chrome_extension_constants::kRuntimeHostPermissionsHelpURL)));
source->AddBoolean(kInDevModeKey, in_dev_mode); source->AddBoolean(kInDevModeKey, in_dev_mode);
source->AddString(kLoadTimeClassesKey, GetLoadTimeClasses(in_dev_mode)); source->AddString(kLoadTimeClassesKey, GetLoadTimeClasses(in_dev_mode));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment