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

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

Issue 1834783003: Added the SuppressUnsupportedOSWarning policy setting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed policy_test_cases Created 4 years, 9 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/infobars/infobar_service.h" 8 #include "chrome/browser/infobars/infobar_service.h"
8 #include "chrome/browser/obsolete_system/obsolete_system.h" 9 #include "chrome/browser/obsolete_system/obsolete_system.h"
10 #include "chrome/common/pref_names.h"
9 #include "chrome/common/url_constants.h" 11 #include "chrome/common/url_constants.h"
10 #include "chrome/grit/chromium_strings.h" 12 #include "chrome/grit/chromium_strings.h"
11 #include "components/infobars/core/infobar.h" 13 #include "components/infobars/core/infobar.h"
14 #include "components/prefs/pref_service.h"
12 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
13 #include "grit/components_strings.h" 16 #include "grit/components_strings.h"
14 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
15 18
16 // static 19 // static
17 void ObsoleteSystemInfoBarDelegate::Create(InfoBarService* infobar_service) { 20 void ObsoleteSystemInfoBarDelegate::Create(InfoBarService* infobar_service) {
21 PrefService* local_state = g_browser_process->local_state();
22 if (local_state &&
23 local_state->GetBoolean(prefs::kSuppressUnsupportedOSWarning)) {
24 return;
25 }
18 if (!ObsoleteSystem::IsObsoleteNowOrSoon()) 26 if (!ObsoleteSystem::IsObsoleteNowOrSoon())
19 return; 27 return;
20 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( 28 infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
21 scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteSystemInfoBarDelegate()))); 29 scoped_ptr<ConfirmInfoBarDelegate>(new ObsoleteSystemInfoBarDelegate())));
22 } 30 }
23 31
24 ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate() 32 ObsoleteSystemInfoBarDelegate::ObsoleteSystemInfoBarDelegate()
25 : ConfirmInfoBarDelegate() { 33 : ConfirmInfoBarDelegate() {
26 } 34 }
27 35
(...skipping 13 matching lines...) Expand all
41 return BUTTON_NONE; 49 return BUTTON_NONE;
42 } 50 }
43 51
44 base::string16 ObsoleteSystemInfoBarDelegate::GetLinkText() const { 52 base::string16 ObsoleteSystemInfoBarDelegate::GetLinkText() const {
45 return l10n_util::GetStringUTF16(IDS_LEARN_MORE); 53 return l10n_util::GetStringUTF16(IDS_LEARN_MORE);
46 } 54 }
47 55
48 GURL ObsoleteSystemInfoBarDelegate::GetLinkURL() const { 56 GURL ObsoleteSystemInfoBarDelegate::GetLinkURL() const {
49 return GURL(ObsoleteSystem::GetLinkURL()); 57 return GURL(ObsoleteSystem::GetLinkURL());
50 } 58 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698