| 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/history/history_extension_api.h" | 5 #include "chrome/browser/history/history_extension_api.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 std::string json_args; | 156 std::string json_args; |
| 157 base::JSONWriter::Write(&args, &json_args); | 157 base::JSONWriter::Write(&args, &json_args); |
| 158 DispatchEvent(profile, kOnVisitRemoved, json_args); | 158 DispatchEvent(profile, kOnVisitRemoved, json_args); |
| 159 } | 159 } |
| 160 | 160 |
| 161 void HistoryExtensionEventRouter::DispatchEvent(Profile* profile, | 161 void HistoryExtensionEventRouter::DispatchEvent(Profile* profile, |
| 162 const char* event_name, | 162 const char* event_name, |
| 163 const std::string& json_args) { | 163 const std::string& json_args) { |
| 164 if (profile && profile->GetExtensionEventRouter()) { | 164 if (profile && profile->GetExtensionEventRouter()) { |
| 165 profile->GetExtensionEventRouter()->DispatchEventToRenderers( | 165 profile->GetExtensionEventRouter()->DispatchEventToRenderers( |
| 166 event_name, json_args, profile, GURL(), | 166 event_name, json_args, profile, GURL()); |
| 167 extensions::EventFilteringInfo()); | |
| 168 } | 167 } |
| 169 } | 168 } |
| 170 | 169 |
| 171 void HistoryFunction::Run() { | 170 void HistoryFunction::Run() { |
| 172 if (!RunImpl()) { | 171 if (!RunImpl()) { |
| 173 SendResponse(false); | 172 SendResponse(false); |
| 174 } | 173 } |
| 175 } | 174 } |
| 176 | 175 |
| 177 bool HistoryFunction::GetUrlFromValue(Value* value, GURL* url) { | 176 bool HistoryFunction::GetUrlFromValue(Value* value, GURL* url) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 &cancelable_consumer_, | 405 &cancelable_consumer_, |
| 407 base::Bind(&DeleteAllHistoryFunction::DeleteComplete, | 406 base::Bind(&DeleteAllHistoryFunction::DeleteComplete, |
| 408 base::Unretained(this))); | 407 base::Unretained(this))); |
| 409 | 408 |
| 410 return true; | 409 return true; |
| 411 } | 410 } |
| 412 | 411 |
| 413 void DeleteAllHistoryFunction::DeleteComplete() { | 412 void DeleteAllHistoryFunction::DeleteComplete() { |
| 414 SendAsyncResponse(); | 413 SendAsyncResponse(); |
| 415 } | 414 } |
| OLD | NEW |