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

Unified Diff: chrome/browser/template_url.cc

Issue 4247: Port some things in browser/{download,history}, minor things in common.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/template_url.h ('k') | chrome/common/mru_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/template_url.cc
===================================================================
--- chrome/browser/template_url.cc (revision 2786)
+++ chrome/browser/template_url.cc (working copy)
@@ -11,6 +11,7 @@
#include "chrome/browser/google_url_tracker.h"
#include "chrome/browser/template_url_model.h"
#include "chrome/common/gfx/favicon_size.h"
+#include "chrome/common/l10n_util.h"
#include "net/base/escape.h"
// The TemplateURLRef has any number of terms that need to be replaced. Each of
@@ -503,6 +504,13 @@
url_.Set(url, index_offset, page_offset);
}
+void TemplateURL::set_keyword(const std::wstring& keyword) {
+ // Case sensitive keyword matching is confusing. As such, we force all
+ // keywords to be lower case.
+ keyword_ = l10n_util::ToLower(keyword);
+ autogenerate_keyword_ = false;
+}
+
const std::wstring& TemplateURL::keyword() const {
if (autogenerate_keyword_ && keyword_.empty()) {
// Generate a keyword and cache it.
« no previous file with comments | « chrome/browser/template_url.h ('k') | chrome/common/mru_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698