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/bookmarks/bookmark_extension_api.h" | 5 #include "chrome/browser/bookmarks/bookmark_extension_api.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_path.h" | 8 #include "base/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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 if (model_) { | 144 if (model_) { |
145 model_->RemoveObserver(this); | 145 model_->RemoveObserver(this); |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 void BookmarkExtensionEventRouter::DispatchEvent( | 149 void BookmarkExtensionEventRouter::DispatchEvent( |
150 Profile* profile, | 150 Profile* profile, |
151 const char* event_name, | 151 const char* event_name, |
152 scoped_ptr<ListValue> event_args) { | 152 scoped_ptr<ListValue> event_args) { |
153 if (extensions::ExtensionSystem::Get(profile)->event_router()) { | 153 if (extensions::ExtensionSystem::Get(profile)->event_router()) { |
154 extensions::ExtensionSystem::Get(profile)->event_router()-> | 154 extensions::ExtensionSystem::Get(profile)->event_router()->BroadcastEvent( |
155 DispatchEventToRenderers(event_name, event_args.Pass(), NULL, GURL(), | 155 make_scoped_ptr(new extensions::Event(event_name, event_args.Pass()))); |
156 extensions::EventFilteringInfo()); | |
157 } | 156 } |
158 } | 157 } |
159 | 158 |
160 void BookmarkExtensionEventRouter::Loaded(BookmarkModel* model, | 159 void BookmarkExtensionEventRouter::Loaded(BookmarkModel* model, |
161 bool ids_reassigned) { | 160 bool ids_reassigned) { |
162 // TODO(erikkay): Perhaps we should send this event down to the extension | 161 // TODO(erikkay): Perhaps we should send this event down to the extension |
163 // so they know when it's safe to use the API? | 162 // so they know when it's safe to use the API? |
164 } | 163 } |
165 | 164 |
166 void BookmarkExtensionEventRouter::BookmarkModelBeingDeleted( | 165 void BookmarkExtensionEventRouter::BookmarkModelBeingDeleted( |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 int index, | 958 int index, |
960 void* params) { | 959 void* params) { |
961 #if !defined(OS_ANDROID) | 960 #if !defined(OS_ANDROID) |
962 // Android does not have support for the standard exporter. | 961 // Android does not have support for the standard exporter. |
963 // TODO(jgreenwald): remove ifdef once extensions are no longer built on | 962 // TODO(jgreenwald): remove ifdef once extensions are no longer built on |
964 // Android. | 963 // Android. |
965 bookmark_html_writer::WriteBookmarks(profile(), path, NULL); | 964 bookmark_html_writer::WriteBookmarks(profile(), path, NULL); |
966 #endif | 965 #endif |
967 Release(); // Balanced in BookmarksIOFunction::SelectFile() | 966 Release(); // Balanced in BookmarksIOFunction::SelectFile() |
968 } | 967 } |
OLD | NEW |