Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: chrome/browser/extensions/api/bookmarks/bookmarks_api.cc

Issue 1201063002: Set up the infrastructure for Extension event metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaaaaase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/api/bookmarks/bookmarks_api.h" 5 #include "chrome/browser/extensions/api/bookmarks/bookmarks_api.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/i18n/file_util_icu.h" 9 #include "base/i18n/file_util_icu.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 if (model_) { 251 if (model_) {
252 model_->RemoveObserver(this); 252 model_->RemoveObserver(this);
253 } 253 }
254 } 254 }
255 255
256 void BookmarkEventRouter::DispatchEvent( 256 void BookmarkEventRouter::DispatchEvent(
257 const std::string& event_name, 257 const std::string& event_name,
258 scoped_ptr<base::ListValue> event_args) { 258 scoped_ptr<base::ListValue> event_args) {
259 EventRouter* event_router = EventRouter::Get(browser_context_); 259 EventRouter* event_router = EventRouter::Get(browser_context_);
260 if (event_router) { 260 if (event_router) {
261 event_router->BroadcastEvent( 261 event_router->BroadcastEvent(make_scoped_ptr(new extensions::Event(
262 make_scoped_ptr(new extensions::Event(event_name, event_args.Pass()))); 262 extensions::events::UNKNOWN, event_name, event_args.Pass())));
263 } 263 }
264 } 264 }
265 265
266 void BookmarkEventRouter::BookmarkModelLoaded(BookmarkModel* model, 266 void BookmarkEventRouter::BookmarkModelLoaded(BookmarkModel* model,
267 bool ids_reassigned) { 267 bool ids_reassigned) {
268 // TODO(erikkay): Perhaps we should send this event down to the extension 268 // TODO(erikkay): Perhaps we should send this event down to the extension
269 // so they know when it's safe to use the API? 269 // so they know when it's safe to use the API?
270 } 270 }
271 271
272 void BookmarkEventRouter::BookmarkModelBeingDeleted(BookmarkModel* model) { 272 void BookmarkEventRouter::BookmarkModelBeingDeleted(BookmarkModel* model) {
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 } 843 }
844 844
845 void BookmarksExportFunction::FileSelected(const base::FilePath& path, 845 void BookmarksExportFunction::FileSelected(const base::FilePath& path,
846 int index, 846 int index,
847 void* params) { 847 void* params) {
848 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL); 848 bookmark_html_writer::WriteBookmarks(GetProfile(), path, NULL);
849 Release(); // Balanced in BookmarksIOFunction::SelectFile() 849 Release(); // Balanced in BookmarksIOFunction::SelectFile()
850 } 850 }
851 851
852 } // namespace extensions 852 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698