| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate() == this) | 161 if (tab_->bookmark_tab_helper()->GetBookmarkDragDelegate() == this) |
| 162 tab_->bookmark_tab_helper()->SetBookmarkDragDelegate(NULL); | 162 tab_->bookmark_tab_helper()->SetBookmarkDragDelegate(NULL); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void BookmarkManagerExtensionEventRouter::DispatchEvent(const char* event_name, | 165 void BookmarkManagerExtensionEventRouter::DispatchEvent(const char* event_name, |
| 166 const ListValue* args) { | 166 const ListValue* args) { |
| 167 if (!profile_->GetExtensionEventRouter()) | 167 if (!profile_->GetExtensionEventRouter()) |
| 168 return; | 168 return; |
| 169 | 169 |
| 170 std::string json_args; | 170 std::string json_args; |
| 171 base::JSONWriter::Write(args, false, &json_args); | 171 base::JSONWriter::Write(args, &json_args); |
| 172 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( | 172 profile_->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 173 event_name, json_args, NULL, GURL()); | 173 event_name, json_args, NULL, GURL()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void BookmarkManagerExtensionEventRouter::DispatchDragEvent( | 176 void BookmarkManagerExtensionEventRouter::DispatchDragEvent( |
| 177 const BookmarkNodeData& data, const char* event_name) { | 177 const BookmarkNodeData& data, const char* event_name) { |
| 178 if (data.size() == 0) | 178 if (data.size() == 0) |
| 179 return; | 179 return; |
| 180 | 180 |
| 181 ListValue args; | 181 ListValue args; |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 bool CanEditBookmarkManagerFunction::RunImpl() { | 490 bool CanEditBookmarkManagerFunction::RunImpl() { |
| 491 result_.reset(Value::CreateBooleanValue( | 491 result_.reset(Value::CreateBooleanValue( |
| 492 profile_->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled))); | 492 profile_->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled))); |
| 493 return true; | 493 return true; |
| 494 } | 494 } |
| 495 | 495 |
| 496 bool RecordLaunchBookmarkFunction::RunImpl() { | 496 bool RecordLaunchBookmarkFunction::RunImpl() { |
| 497 bookmark_utils::RecordBookmarkLaunch(bookmark_utils::LAUNCH_MANAGER); | 497 bookmark_utils::RecordBookmarkLaunch(bookmark_utils::LAUNCH_MANAGER); |
| 498 return true; | 498 return true; |
| 499 } | 499 } |
| OLD | NEW |