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 #include "chrome/browser/automation/automation_provider_observers.h" | 5 #include "chrome/browser/automation/automation_provider_observers.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 3040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3051 PostCallbackAfterPolicyUpdates( | 3051 PostCallbackAfterPolicyUpdates( |
3052 base::Bind(&PolicyUpdatesObserver::Reply, base::Owned(this))); | 3052 base::Bind(&PolicyUpdatesObserver::Reply, base::Owned(this))); |
3053 } | 3053 } |
3054 } | 3054 } |
3055 | 3055 |
3056 void PolicyUpdatesObserver::Reply() { | 3056 void PolicyUpdatesObserver::Reply() { |
3057 if (automation_) { | 3057 if (automation_) { |
3058 AutomationJSONReply( | 3058 AutomationJSONReply( |
3059 automation_, reply_message_.release()).SendSuccess(NULL); | 3059 automation_, reply_message_.release()).SendSuccess(NULL); |
3060 } | 3060 } |
| 3061 // Reply() is only called from MaybeReply(), which makes the callback own |
| 3062 // |this|; so |this| will be deleted once this method returns. |
3061 } | 3063 } |
3062 | 3064 |
3063 // static | 3065 // static |
3064 void PolicyUpdatesObserver::PostTask(content::BrowserThread::ID id, | 3066 void PolicyUpdatesObserver::PostTask(content::BrowserThread::ID id, |
3065 const base::Closure& callback) { | 3067 const base::Closure& callback) { |
3066 content::BrowserThread::PostTask(id, FROM_HERE, callback); | 3068 content::BrowserThread::PostTask(id, FROM_HERE, callback); |
3067 } | 3069 } |
3068 | 3070 |
3069 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 3071 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
3070 | 3072 |
(...skipping 21 matching lines...) Expand all Loading... |
3092 } | 3094 } |
3093 | 3095 |
3094 ExtensionHost* host = content::Details<ExtensionHost>(details).ptr(); | 3096 ExtensionHost* host = content::Details<ExtensionHost>(details).ptr(); |
3095 if (host->extension_id() == extension_id_ && | 3097 if (host->extension_id() == extension_id_ && |
3096 host->extension_host_type() == chrome::VIEW_TYPE_EXTENSION_POPUP) { | 3098 host->extension_host_type() == chrome::VIEW_TYPE_EXTENSION_POPUP) { |
3097 AutomationJSONReply(automation_, reply_message_.release()) | 3099 AutomationJSONReply(automation_, reply_message_.release()) |
3098 .SendSuccess(NULL); | 3100 .SendSuccess(NULL); |
3099 delete this; | 3101 delete this; |
3100 } | 3102 } |
3101 } | 3103 } |
OLD | NEW |