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

Side by Side Diff: chrome/browser/dom_ui/tips_handler.cc

Issue 4804001: Add new promotional line for NTP.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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
« no previous file with comments | « chrome/browser/dom_ui/ntp_resource_cache.cc ('k') | chrome/browser/resources/new_new_tab.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <string> 5 #include <string>
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 list_value.Append(tip_dict); 92 list_value.Append(tip_dict);
93 tips_cache_->SetInteger(WebResourceService::kCurrentTipPrefName, 93 tips_cache_->SetInteger(WebResourceService::kCurrentTipPrefName,
94 tip_index); 94 tip_index);
95 // Send list of web resource items back out to the DOM. 95 // Send list of web resource items back out to the DOM.
96 dom_ui_->CallJavascriptFunction(L"tips", list_value); 96 dom_ui_->CallJavascriptFunction(L"tips", list_value);
97 } 97 }
98 98
99 // static 99 // static
100 void TipsHandler::RegisterUserPrefs(PrefService* prefs) { 100 void TipsHandler::RegisterUserPrefs(PrefService* prefs) {
101 prefs->RegisterDictionaryPref(prefs::kNTPWebResourceCache); 101 prefs->RegisterDictionaryPref(prefs::kNTPWebResourceCache);
102 prefs->RegisterStringPref(prefs::kNTPLogoResourceServer, 102 prefs->RegisterStringPref(prefs::kNTPWebResourceServer,
103 WebResourceService::kDefaultResourceServer); 103 WebResourceService::kDefaultWebResourceServer);
104 } 104 }
105 105
106 bool TipsHandler::IsValidURL(const std::wstring& url_string) { 106 bool TipsHandler::IsValidURL(const std::wstring& url_string) {
107 GURL url(WideToUTF8(url_string)); 107 GURL url(WideToUTF8(url_string));
108 return !url.is_empty() && (url.SchemeIs(chrome::kHttpScheme) || 108 return !url.is_empty() && (url.SchemeIs(chrome::kHttpScheme) ||
109 url.SchemeIs(chrome::kHttpsScheme)); 109 url.SchemeIs(chrome::kHttpsScheme));
110 } 110 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/ntp_resource_cache.cc ('k') | chrome/browser/resources/new_new_tab.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698