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

Unified Diff: chrome/browser/search_engines/template_url.cc

Issue 2078021: First pass at experimental omnibox API. There are plenty of rough edges and (Closed)
Patch Set: no prefer_keyword Created 10 years, 7 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/search_engines/template_url.h ('k') | chrome/browser/search_engines/template_url_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url.cc
diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc
index d91bce905c6312ca124ebcde34e96055b02b58fa..f069a8e07d8bf3f159a1c4a0017b62aa173a8f57 100644
--- a/chrome/browser/search_engines/template_url.cc
+++ b/chrome/browser/search_engines/template_url.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,6 +12,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/google_url_tracker.h"
#include "chrome/browser/search_engines/template_url_model.h"
+#include "chrome/common/url_constants.h"
#include "gfx/favicon_size.h"
#include "net/base/escape.h"
@@ -621,3 +622,12 @@ void TemplateURL::InvalidateCachedValues() const {
keyword_generated_ = false;
}
}
+
+std::string TemplateURL::GetExtensionId() const {
+ DCHECK(IsExtensionKeyword());
+ return GURL(WideToUTF8(url_.url())).host();
+}
+
+bool TemplateURL::IsExtensionKeyword() const {
+ return GURL(WideToUTF8(url_.url())).SchemeIs(chrome::kExtensionScheme);
+}
« no previous file with comments | « chrome/browser/search_engines/template_url.h ('k') | chrome/browser/search_engines/template_url_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698