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

Side by Side Diff: chrome/browser/autocomplete/base_search_provider.h

Issue 343523003: Remove AutocompleteInput Type and PageClassification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This class contains common functionality for search-based autocomplete 5 // This class contains common functionality for search-based autocomplete
6 // providers. Search provider and zero suggest provider both use it for common 6 // providers. Search provider and zero suggest provider both use it for common
7 // functionality. 7 // functionality.
8 8
9 #ifndef CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_ 9 #ifndef CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_
10 #define CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_ 10 #define CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // * The suggest request is sent over HTTPS. This avoids leaking the current 371 // * The suggest request is sent over HTTPS. This avoids leaking the current
372 // page URL or personal data in unencrypted network traffic. 372 // page URL or personal data in unencrypted network traffic.
373 // * The user has suggest enabled in their settings and is not in incognito 373 // * The user has suggest enabled in their settings and is not in incognito
374 // mode. (Incognito disables suggest entirely.) 374 // mode. (Incognito disables suggest entirely.)
375 // * The user's suggest provider is Google. We might want to allow other 375 // * The user's suggest provider is Google. We might want to allow other
376 // providers to see this data someday, but for now this has only been 376 // providers to see this data someday, but for now this has only been
377 // implemented for Google. 377 // implemented for Google.
378 static bool ZeroSuggestEnabled( 378 static bool ZeroSuggestEnabled(
379 const GURL& suggest_url, 379 const GURL& suggest_url,
380 const TemplateURL* template_url, 380 const TemplateURL* template_url,
381 AutocompleteInput::PageClassification page_classification, 381 metrics::OmniboxEventProto::PageClassification page_classification,
382 Profile* profile); 382 Profile* profile);
383 383
384 // Returns whether we can send the URL of the current page in any suggest 384 // Returns whether we can send the URL of the current page in any suggest
385 // requests. Doing this requires that all the following hold: 385 // requests. Doing this requires that all the following hold:
386 // * ZeroSuggestEnabled() is true, so we meet the requirements above. 386 // * ZeroSuggestEnabled() is true, so we meet the requirements above.
387 // * The current URL is HTTP, or HTTPS with the same domain as the suggest 387 // * The current URL is HTTP, or HTTPS with the same domain as the suggest
388 // server. Non-HTTP[S] URLs (e.g. FTP/file URLs) may contain sensitive 388 // server. Non-HTTP[S] URLs (e.g. FTP/file URLs) may contain sensitive
389 // information. HTTPS URLs may also contain sensitive information, but if 389 // information. HTTPS URLs may also contain sensitive information, but if
390 // they're on the same domain as the suggest server, then the relevant 390 // they're on the same domain as the suggest server, then the relevant
391 // entity could have already seen/logged this data. 391 // entity could have already seen/logged this data.
392 // * The user is OK in principle with sending URLs of current pages to their 392 // * The user is OK in principle with sending URLs of current pages to their
393 // provider. Today, there is no explicit setting that controls this, but if 393 // provider. Today, there is no explicit setting that controls this, but if
394 // the user has tab sync enabled and tab sync is unencrypted, then they're 394 // the user has tab sync enabled and tab sync is unencrypted, then they're
395 // already sending this data to Google for sync purposes. Thus we use this 395 // already sending this data to Google for sync purposes. Thus we use this
396 // setting as a proxy for "it's OK to send such data". In the future, 396 // setting as a proxy for "it's OK to send such data". In the future,
397 // especially if we want to support suggest providers other than Google, we 397 // especially if we want to support suggest providers other than Google, we
398 // may change this to be a standalone setting or part of some explicit 398 // may change this to be a standalone setting or part of some explicit
399 // general opt-in. 399 // general opt-in.
400 static bool CanSendURL( 400 static bool CanSendURL(
401 const GURL& current_page_url, 401 const GURL& current_page_url,
402 const GURL& suggest_url, 402 const GURL& suggest_url,
403 const TemplateURL* template_url, 403 const TemplateURL* template_url,
404 AutocompleteInput::PageClassification page_classification, 404 metrics::OmniboxEventProto::PageClassification page_classification,
405 Profile* profile); 405 Profile* profile);
406 406
407 // net::URLFetcherDelegate: 407 // net::URLFetcherDelegate:
408 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; 408 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
409 409
410 // If the |deletion_url| is valid, then set |match.deletable| to true and 410 // If the |deletion_url| is valid, then set |match.deletable| to true and
411 // save the |deletion_url| into the |match|'s additional info under 411 // save the |deletion_url| into the |match|'s additional info under
412 // the key |kDeletionUrlKey|. 412 // the key |kDeletionUrlKey|.
413 void SetDeletionURL(const std::string& deletion_url, 413 void SetDeletionURL(const std::string& deletion_url,
414 AutocompleteMatch* match); 414 AutocompleteMatch* match);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 521
522 // True if this provider's results are being displayed in the app list. By 522 // True if this provider's results are being displayed in the app list. By
523 // default this is false, meaning that the results will be shown in the 523 // default this is false, meaning that the results will be shown in the
524 // omnibox. 524 // omnibox.
525 bool in_app_list_; 525 bool in_app_list_;
526 526
527 DISALLOW_COPY_AND_ASSIGN(BaseSearchProvider); 527 DISALLOW_COPY_AND_ASSIGN(BaseSearchProvider);
528 }; 528 };
529 529
530 #endif // CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_ 530 #endif // CHROME_BROWSER_AUTOCOMPLETE_BASE_SEARCH_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698