| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/extensions/extension_message_bubble_controller.h" | 5 #include "chrome/browser/extensions/extension_message_bubble_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 return pref_state; | 70 return pref_state; |
| 71 } | 71 } |
| 72 | 72 |
| 73 void ExtensionMessageBubbleController::Delegate::SetBubbleInfoBeenAcknowledged( | 73 void ExtensionMessageBubbleController::Delegate::SetBubbleInfoBeenAcknowledged( |
| 74 const std::string& extension_id, | 74 const std::string& extension_id, |
| 75 bool value) { | 75 bool value) { |
| 76 std::string pref_name = get_acknowledged_flag_pref_name(); | 76 std::string pref_name = get_acknowledged_flag_pref_name(); |
| 77 if (pref_name.empty()) | 77 if (pref_name.empty()) |
| 78 return; | 78 return; |
| 79 extensions::ExtensionPrefs* prefs = extensions::ExtensionPrefs::Get(profile_); | 79 extensions::ExtensionPrefs* prefs = extensions::ExtensionPrefs::Get(profile_); |
| 80 prefs->UpdateExtensionPref(extension_id, | 80 prefs->UpdateExtensionPref(extension_id, pref_name, |
| 81 pref_name, | 81 value ? new base::Value(value) : NULL); |
| 82 value ? new base::FundamentalValue(value) : NULL); | |
| 83 } | 82 } |
| 84 | 83 |
| 85 std::string | 84 std::string |
| 86 ExtensionMessageBubbleController::Delegate::get_acknowledged_flag_pref_name() | 85 ExtensionMessageBubbleController::Delegate::get_acknowledged_flag_pref_name() |
| 87 const { | 86 const { |
| 88 return acknowledged_pref_name_; | 87 return acknowledged_pref_name_; |
| 89 } | 88 } |
| 90 | 89 |
| 91 void ExtensionMessageBubbleController::Delegate:: | 90 void ExtensionMessageBubbleController::Delegate:: |
| 92 set_acknowledged_flag_pref_name(const std::string& pref_name) { | 91 set_acknowledged_flag_pref_name(const std::string& pref_name) { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 if (delegate_->ClearProfileSetAfterAction()) | 321 if (delegate_->ClearProfileSetAfterAction()) |
| 323 GetProfileSet()->clear(); | 322 GetProfileSet()->clear(); |
| 324 } | 323 } |
| 325 } | 324 } |
| 326 | 325 |
| 327 std::set<Profile*>* ExtensionMessageBubbleController::GetProfileSet() { | 326 std::set<Profile*>* ExtensionMessageBubbleController::GetProfileSet() { |
| 328 return &g_shown_for_profiles.Get()[delegate_->GetKey()]; | 327 return &g_shown_for_profiles.Get()[delegate_->GetKey()]; |
| 329 } | 328 } |
| 330 | 329 |
| 331 } // namespace extensions | 330 } // namespace extensions |
| OLD | NEW |