OLD | NEW |
---|---|
(Empty) | |
1 // 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.
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/ui/startup/chromedriver_infobar_delegate.h" | |
6 | |
7 #include "chrome/browser/infobars/infobar_service.h" | |
8 #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.
| |
9 #include "chrome/browser/ui/browser.h" | |
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | |
11 #include "chrome/grit/chromium_strings.h" | |
12 #include "components/infobars/core/infobar.h" | |
13 #include "components/strings/grit/components_strings.h" | |
14 #include "content/public/browser/web_contents.h" | |
15 #include "google_apis/google_api_keys.h" | |
16 #include "ui/base/l10n/l10n_util.h" | |
17 | |
Devlin
2017/02/01 23:05:00
extra newline
samuong
2017/02/04 00:11:03
Done.
| |
18 | |
19 // static | |
20 void ChromeDriverInfoBarDelegate::Create(Browser* browser) { | |
21 content::WebContents* web_contents = | |
22 browser->tab_strip_model()->GetActiveWebContents(); | |
23 InfoBarService* infobar_service = | |
24 InfoBarService::FromWebContents(web_contents); | |
25 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( | |
26 std::unique_ptr<ConfirmInfoBarDelegate>( | |
27 new ChromeDriverInfoBarDelegate()))); | |
28 } | |
29 | |
30 ChromeDriverInfoBarDelegate::ChromeDriverInfoBarDelegate() | |
31 : ConfirmInfoBarDelegate() { | |
32 } | |
33 | |
34 ChromeDriverInfoBarDelegate::~ChromeDriverInfoBarDelegate() { | |
35 } | |
36 | |
37 infobars::InfoBarDelegate::InfoBarIdentifier | |
38 ChromeDriverInfoBarDelegate::GetIdentifier() const { | |
39 return CHROMEDRIVER_INFOBAR_DELEGATE; | |
40 } | |
41 | |
42 base::string16 ChromeDriverInfoBarDelegate::GetMessageText() const { | |
43 return l10n_util::GetStringUTF16(IDS_CONTROLLED_BY_CHROMEDRIVER); | |
44 } | |
45 | |
46 int ChromeDriverInfoBarDelegate::GetButtons() const { | |
47 return BUTTON_NONE; | |
48 } | |
49 | |
50 base::string16 ChromeDriverInfoBarDelegate::GetLinkText() const { | |
51 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); | |
52 } | |
53 | |
54 GURL ChromeDriverInfoBarDelegate::GetLinkURL() const { | |
55 return GURL("http://chromedriver.chromium.org/"); | |
56 } | |
57 | |
58 bool ChromeDriverInfoBarDelegate::ShouldExpire( | |
59 const NavigationDetails& details) const { | |
60 return false; | |
61 } | |
OLD | NEW |