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

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

Issue 10332071: Pass command line arguments onto platform apps which provide the right intent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Windows tests fixed Created 8 years, 7 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/automation/testing_automation_provider.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/string16.h" 10 #include "base/string16.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 AppLauncherHandler::RecordAppLaunchType( 44 AppLauncherHandler::RecordAppLaunchType(
45 extension_misc::APP_LAUNCH_OMNIBOX_APP); 45 extension_misc::APP_LAUNCH_OMNIBOX_APP);
46 46
47 // Look at the preferences to find the right launch container. If no 47 // Look at the preferences to find the right launch container. If no
48 // preference is set, launch as a regular tab. 48 // preference is set, launch as a regular tab.
49 extension_misc::LaunchContainer launch_container = 49 extension_misc::LaunchContainer launch_container =
50 service->extension_prefs()->GetLaunchContainer( 50 service->extension_prefs()->GetLaunchContainer(
51 extension, ExtensionPrefs::LAUNCH_REGULAR); 51 extension, ExtensionPrefs::LAUNCH_REGULAR);
52 52
53 application_launch::OpenApplication(profile, extension, launch_container, 53 application_launch::OpenApplication(profile, extension, launch_container,
54 GURL(), disposition); 54 GURL(), disposition, NULL);
55 } 55 }
56 56
57 void ExtensionAppProvider::AddExtensionAppForTesting( 57 void ExtensionAppProvider::AddExtensionAppForTesting(
58 const ExtensionApp& extension_app) { 58 const ExtensionApp& extension_app) {
59 extension_apps_.push_back(extension_app); 59 extension_apps_.push_back(extension_app);
60 } 60 }
61 61
62 AutocompleteMatch ExtensionAppProvider::CreateAutocompleteMatch( 62 AutocompleteMatch ExtensionAppProvider::CreateAutocompleteMatch(
63 const AutocompleteInput& input, 63 const AutocompleteInput& input,
64 const ExtensionApp& app, 64 const ExtensionApp& app,
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 history::URLRow info; 213 history::URLRow info;
214 url_db->GetRowForURL(url, &info); 214 url_db->GetRowForURL(url, &info);
215 type_count_boost = 215 type_count_boost =
216 400 * (1.0 - (std::pow(static_cast<double>(2), -info.typed_count()))); 216 400 * (1.0 - (std::pow(static_cast<double>(2), -info.typed_count())));
217 } 217 }
218 int relevance = 575 + static_cast<int>(type_count_boost) + 218 int relevance = 575 + static_cast<int>(type_count_boost) +
219 static_cast<int>(fraction_boost); 219 static_cast<int>(fraction_boost);
220 DCHECK_LE(relevance, kMaxRelevance); 220 DCHECK_LE(relevance, kMaxRelevance);
221 return relevance; 221 return relevance;
222 } 222 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698