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

Side by Side Diff: chrome/browser/ui/search/search.h

Issue 11876045: [Search] Store and recall search terms using NavigationEntry to improve search term extraction (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: const Created 7 years, 10 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
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 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_H_ 5 #ifndef CHROME_BROWSER_UI_SEARCH_SEARCH_H_
6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_H_ 6 #define CHROME_BROWSER_UI_SEARCH_SEARCH_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/string16.h"
13 14
14 class GURL; 15 class GURL;
15 class Profile; 16 class Profile;
17 namespace content {
sreeram 2013/01/30 21:41:39 Nit: Add a blank line between "class Profile" and
Mathieu 2013/01/30 21:55:12 Done.
18 class NavigationEntry;
19 }
16 20
17 namespace chrome { 21 namespace chrome {
18 namespace search { 22 namespace search {
19 23
24 // The key used to store search terms data in the NavigationEntry to be later
25 // displayed in the Omnibox. With the context of the user's exact query,
26 // InstantController sets the correct search terms to be displayed.
27 extern const char kInstantExtendedSearchTermsKey[];
28
20 // Returns whether the Instant extended API is enabled for the given |profile|. 29 // Returns whether the Instant extended API is enabled for the given |profile|.
21 // |profile| may not be NULL. 30 // |profile| may not be NULL.
22 bool IsInstantExtendedAPIEnabled(Profile* profile); 31 bool IsInstantExtendedAPIEnabled(Profile* profile);
23 32
24 // Returns the value to pass to the &espv cgi parameter when loading the 33 // Returns the value to pass to the &espv cgi parameter when loading the
25 // embedded search page from the user's default search provider. Will be 34 // embedded search page from the user's default search provider. Will be
26 // 0 if the Instant Extended API is not enabled. 35 // 0 if the Instant Extended API is not enabled.
27 uint64 EmbeddedSearchPageVersion(Profile* profile); 36 uint64 EmbeddedSearchPageVersion(Profile* profile);
28 37
29 // Force the instant extended API to be enabled for tests. 38 // Force the instant extended API to be enabled for tests.
30 void EnableInstantExtendedAPIForTesting(); 39 void EnableInstantExtendedAPIForTesting();
31 40
32 // Returns whether query extraction is enabled. If 41 // Returns whether query extraction is enabled. If
33 // |IsInstantExtendedAPIEnabled()| and the profile is not off the record, then 42 // |IsInstantExtendedAPIEnabled()| and the profile is not off the record, then
34 // this method will also return true. 43 // this method will also return true.
35 bool IsQueryExtractionEnabled(Profile* profile); 44 bool IsQueryExtractionEnabled(Profile* profile);
36 45
37 // Force query extraction to be enabled for tests. 46 // Force query extraction to be enabled for tests.
38 void EnableQueryExtractionForTesting(); 47 void EnableQueryExtractionForTesting();
39 48
49 // Return the search terms attached to a specific NavigationEntry, or empty
50 // string otherwise.
51 string16 GetSearchTermsFromNavigationEntry(
52 const content::NavigationEntry* entry);
53
40 // Returns true if |url| has the same scheme, host, port and path as the 54 // Returns true if |url| has the same scheme, host, port and path as the
41 // Instant URL set via --instant-url. 55 // Instant URL set via --instant-url.
42 bool IsForcedInstantURL(const GURL& url); 56 bool IsForcedInstantURL(const GURL& url);
43 57
44 // Type for a collection of experiment configuration parameters. 58 // Type for a collection of experiment configuration parameters.
45 typedef std::vector<std::pair<std::string, std::string> > FieldTrialFlags; 59 typedef std::vector<std::pair<std::string, std::string> > FieldTrialFlags;
46 60
47 // Given a field trial group name, parses out the group number and configuration 61 // Given a field trial group name, parses out the group number and configuration
48 // flags. 62 // flags.
49 // Exposed for testing only. 63 // Exposed for testing only.
(...skipping 17 matching lines...) Expand all
67 81
68 // Given a FieldTrialFlags object, returns the bool value of the provided flag. 82 // Given a FieldTrialFlags object, returns the bool value of the provided flag.
69 // Exposed for testing only. 83 // Exposed for testing only.
70 bool GetBoolValueForFlagWithDefault( 84 bool GetBoolValueForFlagWithDefault(
71 const std::string& flag, bool default_value, FieldTrialFlags& flags); 85 const std::string& flag, bool default_value, FieldTrialFlags& flags);
72 86
73 } // namespace search 87 } // namespace search
74 } // namespace chrome 88 } // namespace chrome
75 89
76 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_H_ 90 #endif // CHROME_BROWSER_UI_SEARCH_SEARCH_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698