| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/prefs/session_startup_pref.h" | 10 #include "chrome/browser/prefs/session_startup_pref.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 int PrefsBackupInvalidChange::GetMenuItemIconID() const { | 94 int PrefsBackupInvalidChange::GetMenuItemIconID() const { |
| 95 return IDR_UPDATE_MENU4; | 95 return IDR_UPDATE_MENU4; |
| 96 } | 96 } |
| 97 | 97 |
| 98 int PrefsBackupInvalidChange::GetBubbleIconID() const { | 98 int PrefsBackupInvalidChange::GetBubbleIconID() const { |
| 99 return IDR_INPUT_ALERT; | 99 return IDR_INPUT_ALERT; |
| 100 } | 100 } |
| 101 | 101 |
| 102 string16 PrefsBackupInvalidChange::GetBubbleTitle() const { | 102 string16 PrefsBackupInvalidChange::GetBubbleTitle() const { |
| 103 return l10n_util::GetStringUTF16(IDS_SETTING_CHANGE_NO_BACKUP_TITLE); | 103 return l10n_util::GetStringUTF16(IDS_SETTING_CHANGE_TITLE); |
| 104 } | 104 } |
| 105 | 105 |
| 106 string16 PrefsBackupInvalidChange::GetBubbleMessage() const { | 106 string16 PrefsBackupInvalidChange::GetBubbleMessage() const { |
| 107 return startup_pref_reset_ ? | 107 return startup_pref_reset_ ? |
| 108 l10n_util::GetStringUTF16( | 108 l10n_util::GetStringUTF16( |
| 109 IDS_SETTING_CHANGE_NO_BACKUP_STARTUP_RESET_BUBBLE_MESSAGE) : | 109 IDS_SETTING_CHANGE_NO_BACKUP_STARTUP_RESET_BUBBLE_MESSAGE) : |
| 110 l10n_util::GetStringUTF16(IDS_SETTING_CHANGE_NO_BACKUP_BUBBLE_MESSAGE); | 110 l10n_util::GetStringUTF16(IDS_SETTING_CHANGE_BUBBLE_MESSAGE); |
| 111 } | 111 } |
| 112 | 112 |
| 113 string16 PrefsBackupInvalidChange::GetApplyButtonText() const { | 113 string16 PrefsBackupInvalidChange::GetApplyButtonText() const { |
| 114 // Don't show this button. | 114 // Don't show this button. |
| 115 return string16(); | 115 return string16(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 string16 PrefsBackupInvalidChange::GetDiscardButtonText() const { | 118 string16 PrefsBackupInvalidChange::GetDiscardButtonText() const { |
| 119 return l10n_util::GetStringUTF16(IDS_EDIT_SETTINGS); | 119 return l10n_util::GetStringUTF16(IDS_EDIT_SETTINGS); |
| 120 } | 120 } |
| 121 | 121 |
| 122 void PrefsBackupInvalidChange::ApplyDefaults(Profile* profile) { | 122 void PrefsBackupInvalidChange::ApplyDefaults(Profile* profile) { |
| 123 PrefService* prefs = profile->GetPrefs(); | 123 PrefService* prefs = profile->GetPrefs(); |
| 124 SessionStartupPref startup_pref = SessionStartupPref::GetStartupPref(prefs); | 124 SessionStartupPref startup_pref = SessionStartupPref::GetStartupPref(prefs); |
| 125 if (startup_pref.type != SessionStartupPref::LAST) { | 125 if (startup_pref.type != SessionStartupPref::LAST) { |
| 126 // If startup type is LAST, resetting it is dangerous (the whole previous | 126 // If startup type is LAST, resetting it is dangerous (the whole previous |
| 127 // session will be lost). | 127 // session will be lost). |
| 128 startup_pref.type = SessionStartupPref::GetDefaultStartupType(); | 128 startup_pref.type = SessionStartupPref::GetDefaultStartupType(); |
| 129 SessionStartupPref::SetStartupPref(prefs, startup_pref); | 129 SessionStartupPref::SetStartupPref(prefs, startup_pref); |
| 130 startup_pref_reset_ = true; | 130 startup_pref_reset_ = true; |
| 131 } | 131 } |
| 132 } | 132 } |
| 133 | 133 |
| 134 BaseSettingChange* CreatePrefsBackupInvalidChange() { | 134 BaseSettingChange* CreatePrefsBackupInvalidChange() { |
| 135 return new PrefsBackupInvalidChange(); | 135 return new PrefsBackupInvalidChange(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } // namespace protector | 138 } // namespace protector |
| OLD | NEW |