| 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/sync/glue/chrome_extensions_activity_monitor.h" | 5 #include "chrome/browser/sync/glue/chrome_extensions_activity_monitor.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.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" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 records_[i->first].bookmark_write_count += i->second.bookmark_write_count; | 44 records_[i->first].bookmark_write_count += i->second.bookmark_write_count; |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 void ChromeExtensionsActivityMonitor::Observe( | 48 void ChromeExtensionsActivityMonitor::Observe( |
| 49 int type, | 49 int type, |
| 50 const content::NotificationSource& source, | 50 const content::NotificationSource& source, |
| 51 const content::NotificationDetails& details) { | 51 const content::NotificationDetails& details) { |
| 52 base::AutoLock lock(records_lock_); | 52 base::AutoLock lock(records_lock_); |
| 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 53 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 54 const Extension* extension = content::Source<const Extension>(source).ptr(); | 54 const extensions::Extension* extension = |
| 55 content::Source<const extensions::Extension>(source).ptr(); |
| 55 const BookmarksFunction* f = | 56 const BookmarksFunction* f = |
| 56 content::Details<const BookmarksFunction>(details).ptr(); | 57 content::Details<const BookmarksFunction>(details).ptr(); |
| 57 if (f->name() == "bookmarks.update" || | 58 if (f->name() == "bookmarks.update" || |
| 58 f->name() == "bookmarks.move" || | 59 f->name() == "bookmarks.move" || |
| 59 f->name() == "bookmarks.create" || | 60 f->name() == "bookmarks.create" || |
| 60 f->name() == "bookmarks.removeTree" || | 61 f->name() == "bookmarks.removeTree" || |
| 61 f->name() == "bookmarks.remove") { | 62 f->name() == "bookmarks.remove") { |
| 62 Record& record = records_[extension->id()]; | 63 Record& record = records_[extension->id()]; |
| 63 record.extension_id = extension->id(); | 64 record.extension_id = extension->id(); |
| 64 record.bookmark_write_count++; | 65 record.bookmark_write_count++; |
| 65 } | 66 } |
| 66 } | 67 } |
| 67 | 68 |
| 68 } // namespace browser_sync | 69 } // namespace browser_sync |
| OLD | NEW |