| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_PROTECTOR_PROTECTOR_H_ | 5 #ifndef CHROME_BROWSER_PROTECTOR_PROTECTOR_H_ |
| 6 #define CHROME_BROWSER_PROTECTOR_PROTECTOR_H_ | 6 #define CHROME_BROWSER_PROTECTOR_PROTECTOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/task.h" | 12 #include "base/message_loop_helpers.h" |
| 13 #include "chrome/browser/protector/base_setting_change.h" | 13 #include "chrome/browser/protector/base_setting_change.h" |
| 14 #include "chrome/browser/protector/settings_change_global_error_delegate.h" | 14 #include "chrome/browser/protector/settings_change_global_error_delegate.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 class Profile; | 17 class Profile; |
| 18 class TemplateURLService; | 18 class TemplateURLService; |
| 19 | 19 |
| 20 namespace protector { | 20 namespace protector { |
| 21 | 21 |
| 22 class SettingsChangeGlobalError; | 22 class SettingsChangeGlobalError; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 41 // Returns the Profile instance we've shown error bubble for. | 41 // Returns the Profile instance we've shown error bubble for. |
| 42 Profile* profile() { return profile_; } | 42 Profile* profile() { return profile_; } |
| 43 | 43 |
| 44 // SettingsChangeGlobalErrorDelegate implementation. | 44 // SettingsChangeGlobalErrorDelegate implementation. |
| 45 virtual void OnApplyChange() OVERRIDE; | 45 virtual void OnApplyChange() OVERRIDE; |
| 46 virtual void OnDiscardChange() OVERRIDE; | 46 virtual void OnDiscardChange() OVERRIDE; |
| 47 virtual void OnDecisionTimeout() OVERRIDE; | 47 virtual void OnDecisionTimeout() OVERRIDE; |
| 48 virtual void OnRemovedFromProfile() OVERRIDE; | 48 virtual void OnRemovedFromProfile() OVERRIDE; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 friend class DeleteTask<Protector>; | 51 friend class base::DeleteHelper<Protector>; |
| 52 | 52 |
| 53 // The object can only be allocated and destroyed on heap. | 53 // The object can only be allocated and destroyed on heap. |
| 54 virtual ~Protector(); | 54 virtual ~Protector(); |
| 55 | 55 |
| 56 // Pointer to error bubble controller. Indicates if we're showing change | 56 // Pointer to error bubble controller. Indicates if we're showing change |
| 57 // notification to user. | 57 // notification to user. |
| 58 scoped_ptr<SettingsChangeGlobalError> error_; | 58 scoped_ptr<SettingsChangeGlobalError> error_; |
| 59 | 59 |
| 60 // Setting change which we're showing. | 60 // Setting change which we're showing. |
| 61 scoped_ptr<BaseSettingChange> change_; | 61 scoped_ptr<BaseSettingChange> change_; |
| 62 | 62 |
| 63 // Profile which settings we are protecting. | 63 // Profile which settings we are protecting. |
| 64 Profile* profile_; | 64 Profile* profile_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(Protector); | 66 DISALLOW_COPY_AND_ASSIGN(Protector); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 // Signs string value with protector's key. | 69 // Signs string value with protector's key. |
| 70 std::string SignSetting(const std::string& value); | 70 std::string SignSetting(const std::string& value); |
| 71 | 71 |
| 72 // Returns true if the signature is valid for the specified key. | 72 // Returns true if the signature is valid for the specified key. |
| 73 bool IsSettingValid(const std::string& value, const std::string& signature); | 73 bool IsSettingValid(const std::string& value, const std::string& signature); |
| 74 | 74 |
| 75 } // namespace protector | 75 } // namespace protector |
| 76 | 76 |
| 77 #endif // CHROME_BROWSER_PROTECTOR_PROTECTOR_H_ | 77 #endif // CHROME_BROWSER_PROTECTOR_PROTECTOR_H_ |
| OLD | NEW |