Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1386)

Side by Side Diff: chrome/browser/history/history.cc

Issue 193071: The chrome://* address are not being added to the history DB, and as such the... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 void HistoryService::ScheduleTask(SchedulePriority priority, 608 void HistoryService::ScheduleTask(SchedulePriority priority,
609 Task* task) { 609 Task* task) {
610 // FIXME(brettw) do prioritization. 610 // FIXME(brettw) do prioritization.
611 thread_->message_loop()->PostTask(FROM_HERE, task); 611 thread_->message_loop()->PostTask(FROM_HERE, task);
612 } 612 }
613 613
614 bool HistoryService::CanAddURL(const GURL& url) const { 614 bool HistoryService::CanAddURL(const GURL& url) const {
615 if (!url.is_valid()) 615 if (!url.is_valid())
616 return false; 616 return false;
617 617
618 // We allow chrome://* URLs so that they will be added to history and
619 // autocomplete suggestions.
618 if (url.SchemeIs(chrome::kJavaScriptScheme) || 620 if (url.SchemeIs(chrome::kJavaScriptScheme) ||
619 url.SchemeIs(chrome::kChromeUIScheme) ||
620 url.SchemeIs(chrome::kViewSourceScheme) || 621 url.SchemeIs(chrome::kViewSourceScheme) ||
621 url.SchemeIs(chrome::kChromeInternalScheme) || 622 url.SchemeIs(chrome::kChromeInternalScheme) ||
622 url.SchemeIs(chrome::kPrintScheme)) 623 url.SchemeIs(chrome::kPrintScheme))
623 return false; 624 return false;
624 625
625 if (url.SchemeIs(chrome::kAboutScheme)) { 626 if (url.SchemeIs(chrome::kAboutScheme)) {
626 std::string path = url.path(); 627 if (LowerCaseEqualsASCII(url.path(), "blank"))
627 if (path.empty() || LowerCaseEqualsASCII(path, "blank"))
628 return false; 628 return false;
629 // We allow all other about URLs since the user may like to see things 629 // We allow all other about URLs since the user may like to see things
630 // like "about:memory" or "about:histograms" in their history and 630 // like "about:memory" or "about:histograms" in their history and
631 // autocomplete. 631 // autocomplete.
632 } 632 }
633 633
634 return true; 634 return true;
635 } 635 }
636 636
637 void HistoryService::SetInMemoryBackend( 637 void HistoryService::SetInMemoryBackend(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 NotificationService::current()->Notify(type, source, det); 689 NotificationService::current()->Notify(type, source, det);
690 } 690 }
691 691
692 void HistoryService::OnDBLoaded() { 692 void HistoryService::OnDBLoaded() {
693 LOG(INFO) << "History backend finished loading"; 693 LOG(INFO) << "History backend finished loading";
694 backend_loaded_ = true; 694 backend_loaded_ = true;
695 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED, 695 NotificationService::current()->Notify(NotificationType::HISTORY_LOADED,
696 Source<Profile>(profile_), 696 Source<Profile>(profile_),
697 Details<HistoryService>(this)); 697 Details<HistoryService>(this));
698 } 698 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698