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

Unified Diff: chrome/renderer/searchbox/searchbox_extension.cc

Issue 2677023003: Clean up IconNTP-related code (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/searchbox/searchbox_extension.cc
diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc
index 72d0b6b1347c74e71947d1921c5b00384585cd12..aee955c7bac4f58f079985dc021df2ffd395438c 100644
--- a/chrome/renderer/searchbox/searchbox_extension.cc
+++ b/chrome/renderer/searchbox/searchbox_extension.cc
@@ -70,21 +70,6 @@ base::string16 V8ValueToUTF16(v8::Local<v8::Value> v) {
return base::string16(reinterpret_cast<const base::char16*>(*s), s.length());
}
-// Returns whether icon NTP is enabled by experiment.
-// TODO(huangs): Remove all 3 copies of this routine once Icon NTP launches.
-bool IsIconNTPEnabled() {
- // Note: It's important to query the field trial state first, to ensure that
- // UMA reports the correct group.
- const std::string group_name = base::FieldTrialList::FindFullName("IconNTP");
- using base::CommandLine;
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableIconNtp))
- return false;
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableIconNtp))
- return true;
-
- return base::StartsWith(group_name, "Enabled", base::CompareCase::SENSITIVE);
-}
-
// Converts string16 to V8 String.
v8::Local<v8::String> UTF16ToV8String(v8::Isolate* isolate,
const base::string16& s) {
@@ -189,18 +174,6 @@ v8::Local<v8::Object> GenerateMostVisitedItem(
obj->Set(v8::String::NewFromUtf8(isolate, "tileSource"),
v8::Integer::New(isolate, static_cast<int>(mv_item.source)));
-
- if (IsIconNTPEnabled()) {
- // Update website http://www.chromium.org/embeddedsearch when we make this
- // permanent.
- // Large icon size is 48px * window.devicePixelRatio. This is easier to set
- // from JS, where IsIconNTPEnabled() is not available. So we add stubs
- // here, and let JS fill in details.
- obj->Set(v8::String::NewFromUtf8(isolate, "largeIconUrl"),
- v8::String::NewFromUtf8(isolate, "chrome-search://large-icon/"));
- obj->Set(v8::String::NewFromUtf8(isolate, "fallbackIconUrl"),
- v8::String::NewFromUtf8(isolate, "chrome-search://fallback-icon/"));
- }
obj->Set(v8::String::NewFromUtf8(isolate, "title"),
UTF16ToV8String(isolate, title));
obj->Set(v8::String::NewFromUtf8(isolate, "domain"),

Powered by Google App Engine
This is Rietveld 408576698