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

Side by Side Diff: chrome/browser/search_engines/search_terms_data.h

Issue 6278007: Remove wstring from TemplateURL and friends.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 (c) 2010 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 #ifndef CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_
6 #define CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ 6 #define CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/string16.h"
12 13
13 // All data needed by TemplateURLRef::ReplaceSearchTerms which typically may 14 // All data needed by TemplateURLRef::ReplaceSearchTerms which typically may
14 // only be accessed on the UI thread. 15 // only be accessed on the UI thread.
15 class SearchTermsData { 16 class SearchTermsData {
16 public: 17 public:
17 SearchTermsData(); 18 SearchTermsData();
18 virtual ~SearchTermsData(); 19 virtual ~SearchTermsData();
19 20
20 // Returns the value for the GOOGLE_BASE_SUGGEST_URL term. 21 // Returns the value for the GOOGLE_BASE_SUGGEST_URL term.
21 std::string GoogleBaseSuggestURLValue() const; 22 std::string GoogleBaseSuggestURLValue() const;
22 23
23 // Returns the value to use for replacements of type GOOGLE_BASE_URL. 24 // Returns the value to use for replacements of type GOOGLE_BASE_URL.
24 virtual std::string GoogleBaseURLValue() const = 0; 25 virtual std::string GoogleBaseURLValue() const = 0;
25 26
26 // Returns the locale used by the application. 27 // Returns the locale used by the application.
27 virtual std::string GetApplicationLocale() const = 0; 28 virtual std::string GetApplicationLocale() const = 0;
28 29
29 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) 30 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
30 // Returns the value for the Chrome Omnibox rlz. 31 // Returns the value for the Chrome Omnibox rlz.
31 virtual std::wstring GetRlzParameterValue() const = 0; 32 virtual string16 GetRlzParameterValue() const = 0;
32 #endif 33 #endif
33 34
34 private: 35 private:
35 DISALLOW_COPY_AND_ASSIGN(SearchTermsData); 36 DISALLOW_COPY_AND_ASSIGN(SearchTermsData);
36 }; 37 };
37 38
38 // Implementation of SearchTermsData that is only usable on the UI thread. 39 // Implementation of SearchTermsData that is only usable on the UI thread.
39 class UIThreadSearchTermsData : public SearchTermsData { 40 class UIThreadSearchTermsData : public SearchTermsData {
40 public: 41 public:
41 UIThreadSearchTermsData(); 42 UIThreadSearchTermsData();
42 43
43 // Implementation of SearchTermsData. 44 // Implementation of SearchTermsData.
44 virtual std::string GoogleBaseURLValue() const; 45 virtual std::string GoogleBaseURLValue() const;
45 virtual std::string GetApplicationLocale() const; 46 virtual std::string GetApplicationLocale() const;
46 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) 47 #if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
47 virtual std::wstring GetRlzParameterValue() const; 48 virtual string16 GetRlzParameterValue() const;
48 #endif 49 #endif
49 50
50 // Used by tests to set the value for the Google base url. This takes 51 // Used by tests to set the value for the Google base url. This takes
51 // ownership of the given std::string. 52 // ownership of the given std::string.
52 static void SetGoogleBaseURL(std::string* google_base_url); 53 static void SetGoogleBaseURL(std::string* google_base_url);
53 54
54 private: 55 private:
55 static std::string* google_base_url_; 56 static std::string* google_base_url_;
56 57
57 DISALLOW_COPY_AND_ASSIGN(UIThreadSearchTermsData); 58 DISALLOW_COPY_AND_ASSIGN(UIThreadSearchTermsData);
58 }; 59 };
59 60
60 #endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_ 61 #endif // CHROME_BROWSER_SEARCH_ENGINES_SEARCH_TERMS_DATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698