| 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 Task* task) { | 562 Task* task) { |
| 563 // FIXME(brettw) do prioritization. | 563 // FIXME(brettw) do prioritization. |
| 564 thread_->message_loop()->PostTask(FROM_HERE, task); | 564 thread_->message_loop()->PostTask(FROM_HERE, task); |
| 565 } | 565 } |
| 566 | 566 |
| 567 bool HistoryService::CanAddURL(const GURL& url) const { | 567 bool HistoryService::CanAddURL(const GURL& url) const { |
| 568 if (!url.is_valid()) | 568 if (!url.is_valid()) |
| 569 return false; | 569 return false; |
| 570 | 570 |
| 571 if (url.SchemeIs("javascript") || | 571 if (url.SchemeIs("javascript") || |
| 572 url.SchemeIs("chrome-resource") || | 572 url.SchemeIs("chrome") || |
| 573 url.SchemeIs("view-source")) | 573 url.SchemeIs("view-source")) |
| 574 return false; | 574 return false; |
| 575 | 575 |
| 576 if (url.SchemeIs("about")) { | 576 if (url.SchemeIs("about")) { |
| 577 std::string path = url.path(); | 577 std::string path = url.path(); |
| 578 if (path.empty() || LowerCaseEqualsASCII(path, "blank")) | 578 if (path.empty() || LowerCaseEqualsASCII(path, "blank")) |
| 579 return false; | 579 return false; |
| 580 // We allow all other about URLs since the user may like to see things | 580 // We allow all other about URLs since the user may like to see things |
| 581 // like "about:memory" or "about:histograms" in their history and | 581 // like "about:memory" or "about:histograms" in their history and |
| 582 // autocomplete. | 582 // autocomplete. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 NotificationService::current()->Notify(type, source, det); | 649 NotificationService::current()->Notify(type, source, det); |
| 650 } | 650 } |
| 651 | 651 |
| 652 void HistoryService::OnDBLoaded() { | 652 void HistoryService::OnDBLoaded() { |
| 653 LOG(INFO) << "History backend finished loading"; | 653 LOG(INFO) << "History backend finished loading"; |
| 654 backend_loaded_ = true; | 654 backend_loaded_ = true; |
| 655 NotificationService::current()->Notify(NOTIFY_HISTORY_LOADED, | 655 NotificationService::current()->Notify(NOTIFY_HISTORY_LOADED, |
| 656 Source<Profile>(profile_), | 656 Source<Profile>(profile_), |
| 657 Details<HistoryService>(this)); | 657 Details<HistoryService>(this)); |
| 658 } | 658 } |
| OLD | NEW |