| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // The history system runs on a background thread so that potentially slow | 5 // The history system runs on a background thread so that potentially slow |
| 6 // database operations don't delay the browser. This backend processing is | 6 // database operations don't delay the browser. This backend processing is |
| 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to | 7 // represented by HistoryBackend. The HistoryService's job is to dispatch to |
| 8 // that thread. | 8 // that thread. |
| 9 // | 9 // |
| 10 // Main thread History thread | 10 // Main thread History thread |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 bool HistoryService::CanAddURL(const GURL& url) const { | 571 bool HistoryService::CanAddURL(const GURL& url) const { |
| 572 if (!url.is_valid()) | 572 if (!url.is_valid()) |
| 573 return false; | 573 return false; |
| 574 | 574 |
| 575 if (url.SchemeIs(chrome::kJavaScriptScheme) || | 575 if (url.SchemeIs(chrome::kJavaScriptScheme) || |
| 576 url.SchemeIs(chrome::kChromeUIScheme) || | 576 url.SchemeIs(chrome::kChromeUIScheme) || |
| 577 url.SchemeIs(chrome::kViewSourceScheme)) | 577 url.SchemeIs(chrome::kViewSourceScheme)) |
| 578 return false; | 578 return false; |
| 579 | 579 |
| 580 if (url.SchemeIs(chrome::kAboutScheme)) { | 580 if (url.SchemeIs(chrome::kAboutScheme)) { |
| 581 if (LowerCaseEqualsASCII(url.spec(), chrome::kAboutBlankURL)) | 581 std::string path = url.path(); |
| 582 if (path.empty() || LowerCaseEqualsASCII(path, "blank")) |
| 582 return false; | 583 return false; |
| 583 // We allow all other about URLs since the user may like to see things | 584 // We allow all other about URLs since the user may like to see things |
| 584 // like "about:memory" or "about:histograms" in their history and | 585 // like "about:memory" or "about:histograms" in their history and |
| 585 // autocomplete. | 586 // autocomplete. |
| 586 } | 587 } |
| 587 | 588 |
| 588 return true; | 589 return true; |
| 589 } | 590 } |
| 590 | 591 |
| 591 void HistoryService::SetInMemoryBackend( | 592 void HistoryService::SetInMemoryBackend( |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 NotificationService::current()->Notify(type, source, det); | 658 NotificationService::current()->Notify(type, source, det); |
| 658 } | 659 } |
| 659 | 660 |
| 660 void HistoryService::OnDBLoaded() { | 661 void HistoryService::OnDBLoaded() { |
| 661 LOG(INFO) << "History backend finished loading"; | 662 LOG(INFO) << "History backend finished loading"; |
| 662 backend_loaded_ = true; | 663 backend_loaded_ = true; |
| 663 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, | 664 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, |
| 664 Source<Profile>(profile_), | 665 Source<Profile>(profile_), |
| 665 Details<HistoryService>(this)); | 666 Details<HistoryService>(this)); |
| 666 } | 667 } |
| OLD | NEW |