| 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/extensions/api/history/history_api.h" | 5 #include "chrome/browser/extensions/api/history/history_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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 DependsOn(ActivityLog::GetFactoryInstance()); | 228 DependsOn(ActivityLog::GetFactoryInstance()); |
| 229 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 229 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void HistoryAPI::OnListenerAdded(const EventListenerInfo& details) { | 232 void HistoryAPI::OnListenerAdded(const EventListenerInfo& details) { |
| 233 history_event_router_.reset( | 233 history_event_router_.reset( |
| 234 new HistoryEventRouter(Profile::FromBrowserContext(browser_context_))); | 234 new HistoryEventRouter(Profile::FromBrowserContext(browser_context_))); |
| 235 EventRouter::Get(browser_context_)->UnregisterObserver(this); | 235 EventRouter::Get(browser_context_)->UnregisterObserver(this); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void HistoryFunction::Run() { | |
| 239 if (!RunImpl()) { | |
| 240 SendResponse(false); | |
| 241 } | |
| 242 } | |
| 243 | |
| 244 bool HistoryFunction::ValidateUrl(const std::string& url_string, GURL* url) { | 238 bool HistoryFunction::ValidateUrl(const std::string& url_string, GURL* url) { |
| 245 GURL temp_url(url_string); | 239 GURL temp_url(url_string); |
| 246 if (!temp_url.is_valid()) { | 240 if (!temp_url.is_valid()) { |
| 247 error_ = kInvalidUrlError; | 241 error_ = kInvalidUrlError; |
| 248 return false; | 242 return false; |
| 249 } | 243 } |
| 250 url->Swap(&temp_url); | 244 url->Swap(&temp_url); |
| 251 return true; | 245 return true; |
| 252 } | 246 } |
| 253 | 247 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 } | 475 } |
| 482 | 476 |
| 483 return true; | 477 return true; |
| 484 } | 478 } |
| 485 | 479 |
| 486 void HistoryDeleteAllFunction::DeleteComplete() { | 480 void HistoryDeleteAllFunction::DeleteComplete() { |
| 487 SendAsyncResponse(); | 481 SendAsyncResponse(); |
| 488 } | 482 } |
| 489 | 483 |
| 490 } // namespace extensions | 484 } // namespace extensions |
| OLD | NEW |