| 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_manager_extension_api.h" | 5 #include "chrome/browser/bookmarks/bookmark_manager_extension_api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 | 163 |
| 164 void BookmarkManagerExtensionEventRouter::DispatchEvent(const char* event_name, | 164 void BookmarkManagerExtensionEventRouter::DispatchEvent(const char* event_name, |
| 165 const ListValue* args) { | 165 const ListValue* args) { |
| 166 if (!profile_->GetExtensionEventRouter()) | 166 if (!profile_->GetExtensionEventRouter()) |
| 167 return; | 167 return; |
| 168 | 168 |
| 169 std::string json_args; | 169 std::string json_args; |
| 170 base::JSONWriter::Write(args, &json_args); | 170 base::JSONWriter::Write(args, &json_args); |
| 171 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( | 171 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 172 event_name, json_args, NULL, GURL()); | 172 event_name, json_args, NULL, GURL(), extensions::EventFilteringInfo()); |
| 173 } | 173 } |
| 174 | 174 |
| 175 void BookmarkManagerExtensionEventRouter::DispatchDragEvent( | 175 void BookmarkManagerExtensionEventRouter::DispatchDragEvent( |
| 176 const BookmarkNodeData& data, const char* event_name) { | 176 const BookmarkNodeData& data, const char* event_name) { |
| 177 if (data.size() == 0) | 177 if (data.size() == 0) |
| 178 return; | 178 return; |
| 179 | 179 |
| 180 ListValue args; | 180 ListValue args; |
| 181 BookmarkNodeDataToJSON(profile_, data, &args); | 181 BookmarkNodeDataToJSON(profile_, data, &args); |
| 182 DispatchEvent(event_name, &args); | 182 DispatchEvent(event_name, &args); |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 bool CanEditBookmarkManagerFunction::RunImpl() { | 493 bool CanEditBookmarkManagerFunction::RunImpl() { |
| 494 result_.reset(Value::CreateBooleanValue( | 494 result_.reset(Value::CreateBooleanValue( |
| 495 profile_->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled))); | 495 profile_->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled))); |
| 496 return true; | 496 return true; |
| 497 } | 497 } |
| 498 | 498 |
| 499 bool RecordLaunchBookmarkFunction::RunImpl() { | 499 bool RecordLaunchBookmarkFunction::RunImpl() { |
| 500 bookmark_utils::RecordBookmarkLaunch(bookmark_utils::LAUNCH_MANAGER); | 500 bookmark_utils::RecordBookmarkLaunch(bookmark_utils::LAUNCH_MANAGER); |
| 501 return true; | 501 return true; |
| 502 } | 502 } |
| OLD | NEW |