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

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

Issue 23658056: content: Move kHttpScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « chrome/browser/history/in_memory_url_index.cc ('k') | chrome/browser/history/visit_database.cc » ('j') | 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) 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/history/url_database.h" 5 #include "chrome/browser/history/url_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 history::URLRow info; 305 history::URLRow info;
306 FillURLRow(statement, &info); 306 FillURLRow(statement, &info);
307 if (info.url().is_valid()) 307 if (info.url().is_valid())
308 results->push_back(info); 308 results->push_back(info);
309 } 309 }
310 return !results->empty(); 310 return !results->empty();
311 } 311 }
312 312
313 bool URLDatabase::IsTypedHost(const std::string& host) { 313 bool URLDatabase::IsTypedHost(const std::string& host) {
314 const char* schemes[] = { 314 const char* schemes[] = {
315 chrome::kHttpScheme, 315 content::kHttpScheme,
316 content::kHttpsScheme, 316 content::kHttpsScheme,
317 chrome::kFtpScheme 317 chrome::kFtpScheme
318 }; 318 };
319 URLRows dummy; 319 URLRows dummy;
320 for (size_t i = 0; i < arraysize(schemes); ++i) { 320 for (size_t i = 0; i < arraysize(schemes); ++i) {
321 std::string scheme_and_host(schemes[i]); 321 std::string scheme_and_host(schemes[i]);
322 scheme_and_host += content::kStandardSchemeSeparator + host; 322 scheme_and_host += content::kStandardSchemeSeparator + host;
323 if (AutocompleteForPrefix(scheme_and_host + '/', 1, true, &dummy) || 323 if (AutocompleteForPrefix(scheme_and_host + '/', 1, true, &dummy) ||
324 AutocompleteForPrefix(scheme_and_host + ':', 1, true, &dummy)) 324 AutocompleteForPrefix(scheme_and_host + ':', 1, true, &dummy))
325 return true; 325 return true;
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 return GetDB().Execute(sql.c_str()); 606 return GetDB().Execute(sql.c_str());
607 } 607 }
608 608
609 bool URLDatabase::CreateMainURLIndex() { 609 bool URLDatabase::CreateMainURLIndex() {
610 // Index over URLs so we can quickly look up based on URL. 610 // Index over URLs so we can quickly look up based on URL.
611 return GetDB().Execute( 611 return GetDB().Execute(
612 "CREATE INDEX IF NOT EXISTS urls_url_index ON urls (url)"); 612 "CREATE INDEX IF NOT EXISTS urls_url_index ON urls (url)");
613 } 613 }
614 614
615 } // namespace history 615 } // namespace history
OLDNEW
« no previous file with comments | « chrome/browser/history/in_memory_url_index.cc ('k') | chrome/browser/history/visit_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698