| 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/sync/util/extensions_activity_monitor.h" | 5 #include "chrome/browser/sync/util/extensions_activity_monitor.h" |
| 6 | 6 |
| 7 #include "base/task.h" | 7 #include "base/task.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_extension_api.h" | 8 #include "chrome/browser/bookmarks/bookmark_extension_api.h" |
| 9 #include "chrome/common/chrome_notification_types.h" | 9 #include "chrome/common/chrome_notification_types.h" |
| 10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
| 11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
| 13 | 13 |
| 14 using content::BrowserThread; |
| 15 |
| 14 namespace browser_sync { | 16 namespace browser_sync { |
| 15 | 17 |
| 16 namespace { | 18 namespace { |
| 17 // A helper task to register an ExtensionsActivityMonitor as an observer of | 19 // A helper task to register an ExtensionsActivityMonitor as an observer of |
| 18 // events on the UI thread (even though the monitor may live on another thread). | 20 // events on the UI thread (even though the monitor may live on another thread). |
| 19 // This liberates ExtensionsActivityMonitor from having to be ref counted. | 21 // This liberates ExtensionsActivityMonitor from having to be ref counted. |
| 20 class RegistrationTask : public Task { | 22 class RegistrationTask : public Task { |
| 21 public: | 23 public: |
| 22 RegistrationTask(ExtensionsActivityMonitor* monitor, | 24 RegistrationTask(ExtensionsActivityMonitor* monitor, |
| 23 content::NotificationRegistrar* registrar) | 25 content::NotificationRegistrar* registrar) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 f->name() == "bookmarks.create" || | 96 f->name() == "bookmarks.create" || |
| 95 f->name() == "bookmarks.removeTree" || | 97 f->name() == "bookmarks.removeTree" || |
| 96 f->name() == "bookmarks.remove") { | 98 f->name() == "bookmarks.remove") { |
| 97 Record& record = records_[extension->id()]; | 99 Record& record = records_[extension->id()]; |
| 98 record.extension_id = extension->id(); | 100 record.extension_id = extension->id(); |
| 99 record.bookmark_write_count++; | 101 record.bookmark_write_count++; |
| 100 } | 102 } |
| 101 } | 103 } |
| 102 | 104 |
| 103 } // namespace browser_sync | 105 } // namespace browser_sync |
| OLD | NEW |