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

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

Issue 7016005: Don't show suggestions in the Omnibox from the Extension App provider unless the app has Incognit... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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/extensions/extension_service.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 void ExtensionAppProvider::RefreshAppList() { 89 void ExtensionAppProvider::RefreshAppList() {
90 ExtensionService* extension_service = profile_->GetExtensionService(); 90 ExtensionService* extension_service = profile_->GetExtensionService();
91 if (!extension_service) 91 if (!extension_service)
92 return; // During testing, there is no extension service. 92 return; // During testing, there is no extension service.
93 const ExtensionList* extensions = extension_service->extensions(); 93 const ExtensionList* extensions = extension_service->extensions();
94 extension_apps_.clear(); 94 extension_apps_.clear();
95 for (ExtensionList::const_iterator app = extensions->begin(); 95 for (ExtensionList::const_iterator app = extensions->begin();
96 app != extensions->end(); ++app) { 96 app != extensions->end(); ++app) {
97 if ((*app)->is_app() && (*app)->GetFullLaunchURL().is_valid()) { 97 if ((*app)->is_app() && (*app)->GetFullLaunchURL().is_valid()) {
98 if (profile_->IsOffTheRecord() &&
99 !extension_service->CanLoadInIncognito((*app)))
100 continue;
101
98 extension_apps_.push_back( 102 extension_apps_.push_back(
99 std::make_pair((*app)->name(), 103 std::make_pair((*app)->name(),
100 (*app)->GetFullLaunchURL().spec())); 104 (*app)->GetFullLaunchURL().spec()));
101 } 105 }
102 } 106 }
103 } 107 }
104 108
105 void ExtensionAppProvider::RegisterForNotifications() { 109 void ExtensionAppProvider::RegisterForNotifications() {
106 registrar_.Add(this, NotificationType::EXTENSION_LOADED, 110 registrar_.Add(this, NotificationType::EXTENSION_LOADED,
107 NotificationService::AllSources()); 111 NotificationService::AllSources());
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 history::URLRow info; 168 history::URLRow info;
165 url_db->GetRowForURL(url, &info); 169 url_db->GetRowForURL(url, &info);
166 type_count_boost = 170 type_count_boost =
167 400 * (1.0 - (std::pow(static_cast<double>(2), -info.typed_count()))); 171 400 * (1.0 - (std::pow(static_cast<double>(2), -info.typed_count())));
168 } 172 }
169 int relevance = 575 + static_cast<int>(type_count_boost) + 173 int relevance = 575 + static_cast<int>(type_count_boost) +
170 static_cast<int>(fraction_boost); 174 static_cast<int>(fraction_boost);
171 DCHECK_LE(relevance, kMaxRelevance); 175 DCHECK_LE(relevance, kMaxRelevance);
172 return relevance; 176 return relevance;
173 } 177 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698