summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-26 00:23:25 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-26 00:23:25 +0000
commit19c9ba1ecb5f3dc1129db003f8cfa27393b1ce61 (patch)
tree56d11eec0b529dd039d47d6905cb6cbf09b0f18b
parent6b07d04a0058c932e1e3cb3f31c04d6021de3a5b (diff)
downloadchromium_src-19c9ba1ecb5f3dc1129db003f8cfa27393b1ce61.zip
chromium_src-19c9ba1ecb5f3dc1129db003f8cfa27393b1ce61.tar.gz
chromium_src-19c9ba1ecb5f3dc1129db003f8cfa27393b1ce61.tar.bz2
Updates the message of HDCP verification dialog.
Based on an email discussion, we will update the message of the dialog. Especially, the message (and decline button) will contain the domain name. Please have a look. BUG=None R=dkrahn@chromium.org TBR=pastarmovj@chromium.org TEST=manually Review URL: https://codereview.chromium.org/33353006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231162 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/chromeos_strings.grdp4
-rw-r--r--chrome/browser/chromeos/attestation/platform_verification_dialog.cc30
-rw-r--r--chrome/browser/chromeos/attestation/platform_verification_dialog.h4
3 files changed, 22 insertions, 16 deletions
diff --git a/chrome/app/chromeos_strings.grdp b/chrome/app/chromeos_strings.grdp
index fca6182..7fea1bd 100644
--- a/chrome/app/chromeos_strings.grdp
+++ b/chrome/app/chromeos_strings.grdp
@@ -3830,13 +3830,13 @@ Battery full
<!-- HDCP verification UI -->
<message name="IDS_PLATFORM_VERIFICATION_DIALOG_HEADLINE" desc="The label to describe what the dialog wants to confirm.">
- Google needs to uniquely identify your device to authorize the playback of HD content. <ph name="LEARN_MORE">$1<ex>Learn more</ex></ph>.
+ <ph name="DOMAIN">$1<ex>example.com</ex></ph> requires unique identification of your device, by Google, to play HD content. <ph name="LEARN_MORE">$2<ex>Learn more</ex></ph>.
</message>
<message name="IDS_PLATFORM_VERIFICATION_DIALOG_ALLOW" desc="The button label to allow access of HD playback.">
Okay, got it
</message>
<message name="IDS_PLATFORM_VERIFICATION_DIALOG_DENY" desc="The button label to deny access of HD playback.">
- No, disable HD
+ Disable HD on <ph name="DOMAIN">$1<ex>example.com</ex></ph>
</message>
</grit-part>
diff --git a/chrome/browser/chromeos/attestation/platform_verification_dialog.cc b/chrome/browser/chromeos/attestation/platform_verification_dialog.cc
index 2342616..24ad09c 100644
--- a/chrome/browser/chromeos/attestation/platform_verification_dialog.cc
+++ b/chrome/browser/chromeos/attestation/platform_verification_dialog.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/attestation/platform_verification_dialog.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/singleton_tabs.h"
@@ -35,8 +36,12 @@ const int kDialogMaxWidthInPixel = 400;
void PlatformVerificationDialog::ShowDialog(
content::WebContents* web_contents,
const PlatformVerificationFlow::Delegate::ConsentCallback& callback) {
+ std::string origin = web_contents->GetLastCommittedURL().GetOrigin().spec();
+
PlatformVerificationDialog* dialog = new PlatformVerificationDialog(
- chrome::FindBrowserWithWebContents(web_contents), callback);
+ chrome::FindBrowserWithWebContents(web_contents),
+ UTF8ToUTF16(origin),
+ callback);
// Sets up the dialog widget and shows it.
web_modal::WebContentsModalDialogManager* web_contents_modal_dialog_manager =
@@ -55,19 +60,21 @@ PlatformVerificationDialog::~PlatformVerificationDialog() {
PlatformVerificationDialog::PlatformVerificationDialog(
Browser* browser,
+ const base::string16& domain,
const PlatformVerificationFlow::Delegate::ConsentCallback& callback)
- : callback_(callback),
- browser_(browser) {
+ : browser_(browser),
+ domain_(domain),
+ callback_(callback) {
SetLayoutManager(new views::FillLayout());
set_border(views::Border::CreateEmptyBorder(
0, views::kButtonHEdgeMarginNew, 0, views::kButtonHEdgeMarginNew));
const base::string16 learn_more = l10n_util::GetStringUTF16(IDS_LEARN_MORE);
- size_t offset = 0;
+ std::vector<size_t> offsets;
base::string16 headline = l10n_util::GetStringFUTF16(
- IDS_PLATFORM_VERIFICATION_DIALOG_HEADLINE, learn_more, &offset);
+ IDS_PLATFORM_VERIFICATION_DIALOG_HEADLINE, domain_, learn_more, &offsets);
views::StyledLabel* headline_label = new views::StyledLabel(headline, this);
headline_label->AddStyleRange(
- gfx::Range(offset, offset + learn_more.size()),
+ gfx::Range(offsets[1], offsets[1] + learn_more.size()),
views::StyledLabel::RangeStyleInfo::CreateForLink());
AddChildView(headline_label);
}
@@ -84,19 +91,16 @@ bool PlatformVerificationDialog::Accept() {
base::string16 PlatformVerificationDialog::GetDialogButtonLabel(
ui::DialogButton button) const {
- int message_id = -1;
switch (button) {
case ui::DIALOG_BUTTON_OK:
- message_id = IDS_PLATFORM_VERIFICATION_DIALOG_ALLOW;
- break;
+ return l10n_util::GetStringUTF16(IDS_PLATFORM_VERIFICATION_DIALOG_ALLOW);
case ui::DIALOG_BUTTON_CANCEL:
- message_id = IDS_PLATFORM_VERIFICATION_DIALOG_DENY;
- break;
+ return l10n_util::GetStringFUTF16(
+ IDS_PLATFORM_VERIFICATION_DIALOG_DENY, domain_);
default:
NOTREACHED();
- return base::string16();
}
- return l10n_util::GetStringUTF16(message_id);
+ return base::string16();
}
ui::ModalType PlatformVerificationDialog::GetModalType() const {
diff --git a/chrome/browser/chromeos/attestation/platform_verification_dialog.h b/chrome/browser/chromeos/attestation/platform_verification_dialog.h
index bff9474..cff19ae 100644
--- a/chrome/browser/chromeos/attestation/platform_verification_dialog.h
+++ b/chrome/browser/chromeos/attestation/platform_verification_dialog.h
@@ -36,6 +36,7 @@ class PlatformVerificationDialog : public views::DialogDelegateView,
private:
PlatformVerificationDialog(
Browser* browser,
+ const base::string16& domain,
const PlatformVerificationFlow::Delegate::ConsentCallback& callback);
// Overridden from views::DialogDelegate:
@@ -54,8 +55,9 @@ class PlatformVerificationDialog : public views::DialogDelegateView,
virtual void StyledLabelLinkClicked(const gfx::Range& range,
int event_flags) OVERRIDE;
- PlatformVerificationFlow::Delegate::ConsentCallback callback_;
Browser* browser_;
+ base::string16 domain_;
+ PlatformVerificationFlow::Delegate::ConsentCallback callback_;
DISALLOW_COPY_AND_ASSIGN(PlatformVerificationDialog);
};