Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6017)

Unified Diff: chrome/browser/ui/startup/chromedriver_infobar_delegate.cc

Issue 2564973002: Add an infobar if a session is being controlled by an automated test. (Closed)
Patch Set: change wording of infobar message to match suggestion from ux team Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5f340188cb2917a851fd6118ceaf373d33b282b7
--- /dev/null
+++ b/chrome/browser/ui/startup/chromedriver_infobar_delegate.cc
@@ -0,0 +1,58 @@
+// Copyright 2017 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/ui/startup/chromedriver_infobar_delegate.h"
+
+#include "chrome/browser/devtools/global_confirm_info_bar.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/grit/generated_resources.h"
+#include "components/infobars/core/infobar.h"
+#include "components/strings/grit/components_strings.h"
+#include "ui/base/l10n/l10n_util.h"
+
+// static
+void ChromeDriverInfoBarDelegate::CreateAndShow(Browser* browser) {
+ std::unique_ptr<ChromeDriverInfoBarDelegate> delegate(
+ new ChromeDriverInfoBarDelegate());
+ GlobalConfirmInfoBar::Show(std::move(delegate));
+}
+
+ChromeDriverInfoBarDelegate::ChromeDriverInfoBarDelegate() {}
+
+ChromeDriverInfoBarDelegate::~ChromeDriverInfoBarDelegate() {}
+
+infobars::InfoBarDelegate::InfoBarIdentifier
+ChromeDriverInfoBarDelegate::GetIdentifier() const {
+ return CHROMEDRIVER_INFOBAR_DELEGATE;
+}
+
+infobars::InfoBarDelegate::Type
+ChromeDriverInfoBarDelegate::GetInfoBarType() const {
+ return PAGE_ACTION_TYPE;
+}
+
+gfx::VectorIconId ChromeDriverInfoBarDelegate::GetVectorIconId() const {
+ return gfx::VectorIconId::PRODUCT;
+}
+
+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;
+}

Powered by Google App Engine
This is Rietveld 408576698