| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extension_history_api.h" | 5 #include "chrome/browser/extensions/extension_history_api.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 std::string json_args; | 136 std::string json_args; |
| 137 base::JSONWriter::Write(&args, false, &json_args); | 137 base::JSONWriter::Write(&args, false, &json_args); |
| 138 DispatchEvent(profile, keys::kOnVisitRemoved, json_args); | 138 DispatchEvent(profile, keys::kOnVisitRemoved, json_args); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void ExtensionHistoryEventRouter::DispatchEvent(Profile* profile, | 141 void ExtensionHistoryEventRouter::DispatchEvent(Profile* profile, |
| 142 const char* event_name, | 142 const char* event_name, |
| 143 const std::string& json_args) { | 143 const std::string& json_args) { |
| 144 if (profile && profile->GetExtensionMessageService()) { | 144 if (profile && profile->GetExtensionMessageService()) { |
| 145 profile->GetExtensionMessageService()->DispatchEventToRenderers( | 145 profile->GetExtensionMessageService()->DispatchEventToRenderers( |
| 146 event_name, json_args, profile->IsOffTheRecord(), GURL()); | 146 event_name, json_args, profile, GURL()); |
| 147 } | 147 } |
| 148 } | 148 } |
| 149 | 149 |
| 150 void HistoryFunction::Run() { | 150 void HistoryFunction::Run() { |
| 151 if (!RunImpl()) { | 151 if (!RunImpl()) { |
| 152 SendResponse(false); | 152 SendResponse(false); |
| 153 } | 153 } |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool HistoryFunction::GetUrlFromValue(Value* value, GURL* url) { | 156 bool HistoryFunction::GetUrlFromValue(Value* value, GURL* url) { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 base::Time::Now(), // To the current time. | 366 base::Time::Now(), // To the current time. |
| 367 &cancelable_consumer_, | 367 &cancelable_consumer_, |
| 368 NewCallback(this, &DeleteAllHistoryFunction::DeleteComplete)); | 368 NewCallback(this, &DeleteAllHistoryFunction::DeleteComplete)); |
| 369 | 369 |
| 370 return true; | 370 return true; |
| 371 } | 371 } |
| 372 | 372 |
| 373 void DeleteAllHistoryFunction::DeleteComplete() { | 373 void DeleteAllHistoryFunction::DeleteComplete() { |
| 374 SendAsyncResponse(); | 374 SendAsyncResponse(); |
| 375 } | 375 } |
| OLD | NEW |