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

Side by Side Diff: chrome/browser/autocomplete/extension_app_provider.cc

Issue 339433007: Componentize URLDatabase (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 | chrome/browser/autocomplete/extension_app_provider_unittest.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/autocomplete/extension_app_provider.h" 5 #include "chrome/browser/autocomplete/extension_app_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "chrome/browser/chrome_notification_types.h" 12 #include "chrome/browser/chrome_notification_types.h"
13 #include "chrome/browser/extensions/extension_service.h" 13 #include "chrome/browser/extensions/extension_service.h"
14 #include "chrome/browser/extensions/extension_ui_util.h" 14 #include "chrome/browser/extensions/extension_ui_util.h"
15 #include "chrome/browser/extensions/extension_util.h" 15 #include "chrome/browser/extensions/extension_util.h"
16 #include "chrome/browser/history/history_service.h" 16 #include "chrome/browser/history/history_service.h"
17 #include "chrome/browser/history/history_service_factory.h" 17 #include "chrome/browser/history/history_service_factory.h"
18 #include "chrome/browser/history/url_database.h"
19 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/ui/extensions/application_launch.h" 19 #include "chrome/browser/ui/extensions/application_launch.h"
21 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h" 20 #include "chrome/browser/ui/webui/ntp/core_app_launcher_handler.h"
22 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" 21 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
22 #include "components/history/core/browser/url_database.h"
23 #include "components/metrics/proto/omnibox_input_type.pb.h" 23 #include "components/metrics/proto/omnibox_input_type.pb.h"
24 #include "content/public/browser/notification_source.h" 24 #include "content/public/browser/notification_source.h"
25 #include "extensions/browser/extension_registry.h" 25 #include "extensions/browser/extension_registry.h"
26 #include "extensions/browser/extension_system.h" 26 #include "extensions/browser/extension_system.h"
27 #include "extensions/common/extension.h" 27 #include "extensions/common/extension.h"
28 #include "extensions/common/extension_set.h" 28 #include "extensions/common/extension_set.h"
29 #include "ui/base/l10n/l10n_util.h" 29 #include "ui/base/l10n/l10n_util.h"
30 30
31 ExtensionAppProvider::ExtensionAppProvider( 31 ExtensionAppProvider::ExtensionAppProvider(
32 AutocompleteProviderListener* listener, 32 AutocompleteProviderListener* listener,
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 history::URLRow info; 222 history::URLRow info;
223 url_db->GetRowForURL(url, &info); 223 url_db->GetRowForURL(url, &info);
224 type_count_boost = 224 type_count_boost =
225 400 * (1.0 - (std::pow(static_cast<double>(2), -info.typed_count()))); 225 400 * (1.0 - (std::pow(static_cast<double>(2), -info.typed_count())));
226 } 226 }
227 int relevance = 575 + static_cast<int>(type_count_boost) + 227 int relevance = 575 + static_cast<int>(type_count_boost) +
228 static_cast<int>(fraction_boost); 228 static_cast<int>(fraction_boost);
229 DCHECK_LE(relevance, kMaxRelevance); 229 DCHECK_LE(relevance, kMaxRelevance);
230 return relevance; 230 return relevance;
231 } 231 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/extension_app_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698