OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/page_info/page_info_infobar_delegate.h" | 5 #include "chrome/browser/ui/page_info/page_info_infobar_delegate.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/app/vector_icons/vector_icons.h" | 10 #include "chrome/app/vector_icons/vector_icons.h" |
11 #include "chrome/browser/infobars/infobar_service.h" | 11 #include "chrome/browser/infobars/infobar_service.h" |
12 #include "chrome/grit/theme_resources.h" | |
13 #include "components/infobars/core/infobar.h" | 12 #include "components/infobars/core/infobar.h" |
14 #include "components/strings/grit/components_strings.h" | 13 #include "components/strings/grit/components_strings.h" |
15 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
16 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
17 | 16 |
18 // static | 17 // static |
19 void PageInfoInfoBarDelegate::Create(InfoBarService* infobar_service) { | 18 void PageInfoInfoBarDelegate::Create(InfoBarService* infobar_service) { |
20 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( | 19 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( |
21 std::unique_ptr<ConfirmInfoBarDelegate>(new PageInfoInfoBarDelegate()))); | 20 std::unique_ptr<ConfirmInfoBarDelegate>(new PageInfoInfoBarDelegate()))); |
22 } | 21 } |
(...skipping 29 matching lines...) Expand all Loading... |
52 DCHECK_EQ(BUTTON_OK, button); | 51 DCHECK_EQ(BUTTON_OK, button); |
53 return l10n_util::GetStringUTF16(IDS_PAGE_INFO_INFOBAR_BUTTON); | 52 return l10n_util::GetStringUTF16(IDS_PAGE_INFO_INFOBAR_BUTTON); |
54 } | 53 } |
55 | 54 |
56 bool PageInfoInfoBarDelegate::Accept() { | 55 bool PageInfoInfoBarDelegate::Accept() { |
57 content::WebContents* web_contents = | 56 content::WebContents* web_contents = |
58 InfoBarService::WebContentsFromInfoBar(infobar()); | 57 InfoBarService::WebContentsFromInfoBar(infobar()); |
59 web_contents->GetController().Reload(content::ReloadType::NORMAL, true); | 58 web_contents->GetController().Reload(content::ReloadType::NORMAL, true); |
60 return true; | 59 return true; |
61 } | 60 } |
OLD | NEW |