| 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 thread_->message_loop()->PostTask(FROM_HERE, task); | 586 thread_->message_loop()->PostTask(FROM_HERE, task); |
| 587 } | 587 } |
| 588 | 588 |
| 589 bool HistoryService::CanAddURL(const GURL& url) const { | 589 bool HistoryService::CanAddURL(const GURL& url) const { |
| 590 if (!url.is_valid()) | 590 if (!url.is_valid()) |
| 591 return false; | 591 return false; |
| 592 | 592 |
| 593 if (url.SchemeIs(chrome::kJavaScriptScheme) || | 593 if (url.SchemeIs(chrome::kJavaScriptScheme) || |
| 594 url.SchemeIs(chrome::kChromeUIScheme) || | 594 url.SchemeIs(chrome::kChromeUIScheme) || |
| 595 url.SchemeIs(chrome::kViewSourceScheme) || | 595 url.SchemeIs(chrome::kViewSourceScheme) || |
| 596 url.SchemeIs(chrome::kChromeInternalScheme)) | 596 url.SchemeIs(chrome::kChromeInternalScheme) || |
| 597 url.SchemeIs(chrome::kPrintScheme)) |
| 597 return false; | 598 return false; |
| 598 | 599 |
| 599 if (url.SchemeIs(chrome::kAboutScheme)) { | 600 if (url.SchemeIs(chrome::kAboutScheme)) { |
| 600 std::string path = url.path(); | 601 std::string path = url.path(); |
| 601 if (path.empty() || LowerCaseEqualsASCII(path, "blank")) | 602 if (path.empty() || LowerCaseEqualsASCII(path, "blank")) |
| 602 return false; | 603 return false; |
| 603 // We allow all other about URLs since the user may like to see things | 604 // We allow all other about URLs since the user may like to see things |
| 604 // like "about:memory" or "about:histograms" in their history and | 605 // like "about:memory" or "about:histograms" in their history and |
| 605 // autocomplete. | 606 // autocomplete. |
| 606 } | 607 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 NotificationService::current()->Notify(type, source, det); | 678 NotificationService::current()->Notify(type, source, det); |
| 678 } | 679 } |
| 679 | 680 |
| 680 void HistoryService::OnDBLoaded() { | 681 void HistoryService::OnDBLoaded() { |
| 681 LOG(INFO) << "History backend finished loading"; | 682 LOG(INFO) << "History backend finished loading"; |
| 682 backend_loaded_ = true; | 683 backend_loaded_ = true; |
| 683 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, | 684 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, |
| 684 Source<Profile>(profile_), | 685 Source<Profile>(profile_), |
| 685 Details<HistoryService>(this)); | 686 Details<HistoryService>(this)); |
| 686 } | 687 } |
| OLD | NEW |