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

Side by Side Diff: chrome/browser/ui/startup/obsolete_system_infobar_delegate.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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/startup/obsolete_system_infobar_delegate.h" 5 #include "chrome/browser/ui/startup/obsolete_system_infobar_delegate.h"
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/infobars/infobar_service.h" 8 #include "chrome/browser/infobars/infobar_service.h"
9 #include "chrome/browser/obsolete_system/obsolete_system.h" 9 #include "chrome/browser/obsolete_system/obsolete_system.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
11 #include "chrome/common/url_constants.h" 11 #include "chrome/common/url_constants.h"
12 #include "chrome/grit/chromium_strings.h" 12 #include "chrome/grit/chromium_strings.h"
13 #include "components/infobars/core/infobar.h" 13 #include "components/infobars/core/infobar.h"
14 #include "components/prefs/pref_service.h" 14 #include "components/prefs/pref_service.h"
15 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
16 #include "grit/components_strings.h" 16 #include "grit/components_strings.h"
17 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
18 18
19 // static 19 // static
20 void ObsoleteSystemInfoBarDelegate::Create(InfoBarService* infobar_service) { 20 void ObsoleteSystemInfoBarDelegate::Create(InfoBarService* infobar_service) {
21 PrefService* local_state = g_browser_process->local_state(); 21 PrefService* local_state = g_browser_process->local_state();
22 if (local_state && 22 if (local_state &&
23 local_state->GetBoolean(prefs::kSuppressUnsupportedOSWarning)) { 23 local_state->GetBoolean(prefs::kSuppressUnsupportedOSWarning)) {
24 return; 24 return;
25 } 25 }
26 if (!ObsoleteSystem::IsObsoleteNowOrSoon()) 26 if (!ObsoleteSystem::IsObsoleteNowOrSoon())
27 return; 27 return;
28 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( 28 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
29 scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteSystemInfoBarDelegate()))); 29 std::unique_ptr<ConfirmInfoBarDelegate>(
30 new ObsoleteSystemInfoBarDelegate())));
30 } 31 }
31 32
32 ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate() 33 ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate()
33 : ConfirmInfoBarDelegate() { 34 : ConfirmInfoBarDelegate() {
34 } 35 }
35 36
36 ObsoleteSystemInfoBarDelegate::~ObsoleteSystemInfoBarDelegate() { 37 ObsoleteSystemInfoBarDelegate::~ObsoleteSystemInfoBarDelegate() {
37 } 38 }
38 39
39 infobars::InfoBarDelegate::InfoBarIdentifier 40 infobars::InfoBarDelegate::InfoBarIdentifier
40 ObsoleteSystemInfoBarDelegate::GetIdentifier() const { 41 ObsoleteSystemInfoBarDelegate::GetIdentifier() const {
41 return OBSOLETE_SYSTEM_INFOBAR_DELEGATE; 42 return OBSOLETE_SYSTEM_INFOBAR_DELEGATE;
42 } 43 }
43 44
44 base::string16 ObsoleteSystemInfoBarDelegate::GetMessageText() const { 45 base::string16 ObsoleteSystemInfoBarDelegate::GetMessageText() const {
45 return ObsoleteSystem::LocalizedObsoleteString(); 46 return ObsoleteSystem::LocalizedObsoleteString();
46 } 47 }
47 48
48 int ObsoleteSystemInfoBarDelegate::GetButtons() const { 49 int ObsoleteSystemInfoBarDelegate::GetButtons() const {
49 return BUTTON_NONE; 50 return BUTTON_NONE;
50 } 51 }
51 52
52 base::string16 ObsoleteSystemInfoBarDelegate::GetLinkText() const { 53 base::string16 ObsoleteSystemInfoBarDelegate::GetLinkText() const {
53 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); 54 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
54 } 55 }
55 56
56 GURL ObsoleteSystemInfoBarDelegate::GetLinkURL() const { 57 GURL ObsoleteSystemInfoBarDelegate::GetLinkURL() const {
57 return GURL(ObsoleteSystem::GetLinkURL()); 58 return GURL(ObsoleteSystem::GetLinkURL());
58 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698