diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-07 17:49:29 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-07 17:49:29 +0000 |
commit | 9f90a085c44812754e2be9a0a6be9f020ebb8767 (patch) | |
tree | 733b810ff361ab17b6fcf826d70c74f9a436c28c /chrome | |
parent | 14809d192b59c34aaa04a7ba0600a25b2a5174c0 (diff) | |
download | chromium_src-9f90a085c44812754e2be9a0a6be9f020ebb8767.zip chromium_src-9f90a085c44812754e2be9a0a6be9f020ebb8767.tar.gz chromium_src-9f90a085c44812754e2be9a0a6be9f020ebb8767.tar.bz2 |
Add startup infobar for Monoscope.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6488029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/generated_resources.grd | 5 | ||||
-rw-r--r-- | chrome/browser/ui/browser_init.cc | 47 | ||||
-rw-r--r-- | chrome/browser/ui/browser_init.h | 5 |
3 files changed, 57 insertions, 0 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index ebafb03..734a0f7 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -4323,6 +4323,11 @@ Keep your key file in a safe place. You will need it to create new versions of y You are using an unsupported command-line flag: <ph name="BAD_FLAG">$1<ex>--no-sandbox</ex></ph>. Stability and security will suffer. </message> + <!-- Monoscope warning info bar --> + <message name="IDS_DNS_CERT_PROVENANCE_CHECKING_WARNING_MESSAGE" desc="Message shown when the user has DNS certificate provenance checking enabled. This message is followed by a 'Learn more' button."> + You have DNS certificate provenance checking enabled. This may result in private information being sent to Google. + </message> + <!-- Locale Change Notification--> <if expr="pp_ifdef('chromeos')"> <message name="IDS_LOCALE_CHANGE_MESSAGE" desc="Message shown when locale was changed based on profile content."> diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index 5d84c4d..2350b178 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -1025,6 +1025,7 @@ void BrowserInit::LaunchWithProfile::AddInfoBarsIfNecessary(Browser* browser) { TabContents* tab_contents = browser->GetSelectedTabContents(); AddCrashedInfoBarIfNecessary(tab_contents); AddBadFlagsInfoBarIfNecessary(tab_contents); + AddDNSCertProvenanceCheckingWarningInfoBarIfNecessary(tab_contents); } void BrowserInit::LaunchWithProfile::AddCrashedInfoBarIfNecessary( @@ -1071,6 +1072,52 @@ void BrowserInit::LaunchWithProfile::AddBadFlagsInfoBarIfNecessary( } } +class DNSCertProvenanceCheckingInfoBar : public ConfirmInfoBarDelegate { + public: + explicit DNSCertProvenanceCheckingInfoBar(TabContents* tab_contents) + : ConfirmInfoBarDelegate(tab_contents), + tab_contents_(tab_contents) { + } + + virtual string16 GetMessageText() const { + return l10n_util::GetStringUTF16( + IDS_DNS_CERT_PROVENANCE_CHECKING_WARNING_MESSAGE); + } + + virtual int GetButtons() const { + return BUTTON_OK; + } + + virtual string16 GetButtonLabel(InfoBarButton button) const { + return l10n_util::GetStringUTF16(IDS_OPTIONS_LEARN_MORE_LABEL); + } + + virtual bool Accept() { + tab_contents_->OpenURL(GURL(kLearnMoreURL), GURL(), NEW_FOREGROUND_TAB, + PageTransition::AUTO_BOOKMARK); + return true; + } + + private: + DISALLOW_COPY_AND_ASSIGN(DNSCertProvenanceCheckingInfoBar); + + static const char kLearnMoreURL[]; + TabContents* const tab_contents_; +}; + +// This is the page which provides information on DNS certificate provenance +// checking. +const char DNSCertProvenanceCheckingInfoBar::kLearnMoreURL[] = + "http://dev.chromium.org/dnscertprovenancechecking"; + +void BrowserInit::LaunchWithProfile:: + AddDNSCertProvenanceCheckingWarningInfoBarIfNecessary(TabContents* tab) { + if (!command_line_.HasSwitch(switches::kEnableDNSCertProvenanceChecking)) + return; + + tab->AddInfoBar(new DNSCertProvenanceCheckingInfoBar(tab)); +} + void BrowserInit::LaunchWithProfile::AddStartupURLs( std::vector<GURL>* startup_urls) const { // If we have urls specified beforehand (i.e. from command line) use them diff --git a/chrome/browser/ui/browser_init.h b/chrome/browser/ui/browser_init.h index 323b0626..61fcbc7 100644 --- a/chrome/browser/ui/browser_init.h +++ b/chrome/browser/ui/browser_init.h @@ -176,6 +176,11 @@ class BrowserInit { // politely nag the user about it. void AddBadFlagsInfoBarIfNecessary(TabContents* tab); + // If DNS based certificate checking has been enabled then we show a + // warning infobar. + void AddDNSCertProvenanceCheckingWarningInfoBarIfNecessary( + TabContents* tab); + // Adds additional startup URLs to the specified vector. void AddStartupURLs(std::vector<GURL>* startup_urls) const; |