summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines/template_url.h
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 07:25:03 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 07:25:03 +0000
commit66789d6149575a97b65694c3f40c66414c7f39c9 (patch)
tree81cb0b0bc5f7235fefb61695dfd0c171c6d25156 /chrome/browser/search_engines/template_url.h
parent161d45fe28d44c8238b10d60dcc011188678dbf9 (diff)
downloadchromium_src-66789d6149575a97b65694c3f40c66414c7f39c9.zip
chromium_src-66789d6149575a97b65694c3f40c66414c7f39c9.tar.gz
chromium_src-66789d6149575a97b65694c3f40c66414c7f39c9.tar.bz2
Only attempt once to autogenerate a keyword for search engines.
BUG=none TEST=Add a search engine provider for which no keyword can be generated Review URL: http://codereview.chromium.org/2008017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47249 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines/template_url.h')
-rw-r--r--chrome/browser/search_engines/template_url.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/search_engines/template_url.h b/chrome/browser/search_engines/template_url.h
index 5a5c67f..1a7d779 100644
--- a/chrome/browser/search_engines/template_url.h
+++ b/chrome/browser/search_engines/template_url.h
@@ -267,6 +267,7 @@ class TemplateURL {
TemplateURL()
: autogenerate_keyword_(false),
+ keyword_generated_(false),
show_in_default_list_(false),
safe_for_autoreplace_(false),
id_(0),
@@ -334,8 +335,10 @@ class TemplateURL {
// keywords are mutually exclusive.
void set_autogenerate_keyword(bool autogenerate_keyword) {
autogenerate_keyword_ = autogenerate_keyword;
- if (autogenerate_keyword_)
+ if (autogenerate_keyword_) {
keyword_.clear();
+ keyword_generated_ = false;
+ }
}
bool autogenerate_keyword() const {
return autogenerate_keyword_;
@@ -437,6 +440,9 @@ class TemplateURL {
mutable std::wstring keyword_;
bool autogenerate_keyword_; // If this is set, |keyword_| holds the cached
// generated keyword if available.
+ mutable bool keyword_generated_; // True if the keyword was generated. This
+ // is used to avoid multiple attempts if
+ // generating a keyword failed.
bool show_in_default_list_;
bool safe_for_autoreplace_;
std::vector<ImageRef> image_refs_;