Index: chrome/browser/ui/startup/chromedriver_infobar_delegate.cc |
diff --git a/chrome/browser/ui/startup/chromedriver_infobar_delegate.cc b/chrome/browser/ui/startup/chromedriver_infobar_delegate.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a436a8440245a04085d754ba53822eb6a432c595 |
--- /dev/null |
+++ b/chrome/browser/ui/startup/chromedriver_infobar_delegate.cc |
@@ -0,0 +1,61 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
Devlin
2017/02/01 23:05:00
no longer 2016 :)
samuong
2017/02/04 00:11:03
Done.
|
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/ui/startup/chromedriver_infobar_delegate.h" |
+ |
+#include "chrome/browser/infobars/infobar_service.h" |
+#include "chrome/browser/profiles/profile.h" |
Devlin
2017/02/01 23:05:00
Not all of these includes seem needed. :)
samuong
2017/02/04 00:11:03
Done.
|
+#include "chrome/browser/ui/browser.h" |
+#include "chrome/browser/ui/tabs/tab_strip_model.h" |
+#include "chrome/grit/chromium_strings.h" |
+#include "components/infobars/core/infobar.h" |
+#include "components/strings/grit/components_strings.h" |
+#include "content/public/browser/web_contents.h" |
+#include "google_apis/google_api_keys.h" |
+#include "ui/base/l10n/l10n_util.h" |
+ |
Devlin
2017/02/01 23:05:00
extra newline
samuong
2017/02/04 00:11:03
Done.
|
+ |
+// static |
+void ChromeDriverInfoBarDelegate::Create(Browser* browser) { |
+ content::WebContents* web_contents = |
+ browser->tab_strip_model()->GetActiveWebContents(); |
+ InfoBarService* infobar_service = |
+ InfoBarService::FromWebContents(web_contents); |
+ infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( |
+ std::unique_ptr<ConfirmInfoBarDelegate>( |
+ new ChromeDriverInfoBarDelegate()))); |
+} |
+ |
+ChromeDriverInfoBarDelegate::ChromeDriverInfoBarDelegate() |
+ : ConfirmInfoBarDelegate() { |
+} |
+ |
+ChromeDriverInfoBarDelegate::~ChromeDriverInfoBarDelegate() { |
+} |
+ |
+infobars::InfoBarDelegate::InfoBarIdentifier |
+ChromeDriverInfoBarDelegate::GetIdentifier() const { |
+ return CHROMEDRIVER_INFOBAR_DELEGATE; |
+} |
+ |
+base::string16 ChromeDriverInfoBarDelegate::GetMessageText() const { |
+ return l10n_util::GetStringUTF16(IDS_CONTROLLED_BY_CHROMEDRIVER); |
+} |
+ |
+int ChromeDriverInfoBarDelegate::GetButtons() const { |
+ return BUTTON_NONE; |
+} |
+ |
+base::string16 ChromeDriverInfoBarDelegate::GetLinkText() const { |
+ return l10n_util::GetStringUTF16(IDS_LEARN_MORE); |
+} |
+ |
+GURL ChromeDriverInfoBarDelegate::GetLinkURL() const { |
+ return GURL("http://chromedriver.chromium.org/"); |
+} |
+ |
+bool ChromeDriverInfoBarDelegate::ShouldExpire( |
+ const NavigationDetails& details) const { |
+ return false; |
+} |