| 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/extensions/extension_warning_service.h" | 5 #include "chrome/browser/extensions/extension_warning_service.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 warnings_.insert(warnings.begin(), warnings.end()); | 86 warnings_.insert(warnings.begin(), warnings.end()); |
| 87 | 87 |
| 88 if (old_size != warnings_.size()) | 88 if (old_size != warnings_.size()) |
| 89 NotifyWarningsChanged(); | 89 NotifyWarningsChanged(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 // static | 92 // static |
| 93 void ExtensionWarningService::NotifyWarningsOnUI( | 93 void ExtensionWarningService::NotifyWarningsOnUI( |
| 94 void* profile_id, | 94 void* profile_id, |
| 95 const ExtensionWarningSet& warnings) { | 95 const ExtensionWarningSet& warnings) { |
| 96 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 96 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 97 Profile* profile = reinterpret_cast<Profile*>(profile_id); | 97 Profile* profile = reinterpret_cast<Profile*>(profile_id); |
| 98 if (!profile || | 98 if (!profile || |
| 99 !g_browser_process->profile_manager() || | 99 !g_browser_process->profile_manager() || |
| 100 !g_browser_process->profile_manager()->IsValidProfile(profile)) { | 100 !g_browser_process->profile_manager()->IsValidProfile(profile)) { |
| 101 return; | 101 return; |
| 102 } | 102 } |
| 103 | 103 |
| 104 extensions::ExtensionWarningService* warning_service = | 104 extensions::ExtensionWarningService* warning_service = |
| 105 extensions::ExtensionSystem::Get(profile)->warning_service(); | 105 extensions::ExtensionSystem::Get(profile)->warning_service(); |
| 106 | 106 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 135 ClearWarnings(warning_types); | 135 ClearWarnings(warning_types); |
| 136 break; | 136 break; |
| 137 } | 137 } |
| 138 default: | 138 default: |
| 139 NOTREACHED(); | 139 NOTREACHED(); |
| 140 break; | 140 break; |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 } // namespace extensions | 144 } // namespace extensions |
| OLD | NEW |