| 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/protector/mock_setting_change.h" | 5 #include "chrome/browser/protector/mock_setting_change.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "grit/theme_resources.h" | 8 #include "grit/theme_resources.h" |
| 9 #include "grit/theme_resources_standard.h" | 9 #include "grit/theme_resources_standard.h" |
| 10 | 10 |
| 11 using ::testing::Return; | 11 using ::testing::Return; |
| 12 | 12 |
| 13 namespace protector { | 13 namespace protector { |
| 14 | 14 |
| 15 MockSettingChange::MockSettingChange() { | 15 MockSettingChange::MockSettingChange() { |
| 16 ON_CALL(*this, GetBadgeIconID()).WillByDefault(Return(IDR_UPDATE_BADGE4)); | 16 ON_CALL(*this, GetBadgeIconID()).WillByDefault(Return(IDR_UPDATE_BADGE4)); |
| 17 ON_CALL(*this, GetMenuItemIconID()).WillByDefault(Return(IDR_UPDATE_MENU4)); | 17 ON_CALL(*this, GetMenuItemIconID()).WillByDefault(Return(IDR_UPDATE_MENU4)); |
| 18 ON_CALL(*this, GetBubbleIconID()).WillByDefault(Return(IDR_INPUT_ALERT)); | 18 ON_CALL(*this, GetBubbleIconID()).WillByDefault(Return(IDR_INPUT_ALERT)); |
| 19 | 19 |
| 20 ON_CALL(*this, GetBubbleTitle()). | 20 ON_CALL(*this, GetBubbleTitle()). |
| 21 WillByDefault(Return(UTF8ToUTF16("Title"))); | 21 WillByDefault(Return(UTF8ToUTF16("Title"))); |
| 22 ON_CALL(*this, GetBubbleMessage()). | 22 ON_CALL(*this, GetBubbleMessage()). |
| 23 WillByDefault(Return(UTF8ToUTF16("Message"))); | 23 WillByDefault(Return(UTF8ToUTF16("Message"))); |
| 24 ON_CALL(*this, GetApplyButtonText()). | 24 ON_CALL(*this, GetApplyButtonText()). |
| 25 WillByDefault(Return(UTF8ToUTF16("Apply"))); | 25 WillByDefault(Return(UTF8ToUTF16("Apply"))); |
| 26 ON_CALL(*this, GetDiscardButtonText()). | 26 ON_CALL(*this, GetDiscardButtonText()). |
| 27 WillByDefault(Return(UTF8ToUTF16("Discard"))); | 27 WillByDefault(Return(UTF8ToUTF16("Discard"))); |
| 28 |
| 29 ON_CALL(*this, GetApplyDisplayName()). |
| 30 WillByDefault(Return( |
| 31 DisplayName(kDefaultNamePriority, UTF8ToUTF16("new settings")))); |
| 32 |
| 33 ON_CALL(*this, GetNewSettingURL()).WillByDefault(Return(GURL())); |
| 34 ON_CALL(*this, CanBeMerged()).WillByDefault(Return(false)); |
| 28 } | 35 } |
| 29 | 36 |
| 30 MockSettingChange::~MockSettingChange() { | 37 MockSettingChange::~MockSettingChange() { |
| 31 } | 38 } |
| 32 | 39 |
| 33 bool MockSettingChange::Init(Profile* profile) { | 40 bool MockSettingChange::Init(Profile* profile) { |
| 34 if (!BaseSettingChange::Init(profile)) | 41 if (!BaseSettingChange::Init(profile)) |
| 35 return false; | 42 return false; |
| 36 return MockInit(profile); | 43 return MockInit(profile); |
| 37 } | 44 } |
| 38 | 45 |
| 39 } // namespace protector | 46 } // namespace protector |
| OLD | NEW |