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/browser/ui/browser_init.cc | |
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/browser/ui/browser_init.cc')
-rw-r--r-- | chrome/browser/ui/browser_init.cc | 47 |
1 files changed, 47 insertions, 0 deletions
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 |