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

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

Issue 147247: Remove null link from "welcome to tips" default suggestion. Also make some h... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/dom_ui/new_tab_ui.cc ('k') | chrome/browser/dom_ui/tips_handler.cc » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 // This class pulls data from a web resource (such as a JSON feed) which 5 // This class pulls data from a web resource (such as a JSON feed) which
6 // has been stored in the user's preferences file. Used mainly 6 // has been stored in the user's preferences file. Used mainly
7 // by the suggestions and tips area of the new tab page. 7 // by the suggestions and tips area of the new tab page.
8 8
9 // Current sketch of tip cache format, hardcoded for popgadget data in 9 // Current sketch of tip cache format, hardcoded for popgadget data in
10 // basic text form: 10 // basic text form:
(...skipping 13 matching lines...) Expand all
24 class DictionaryValue; 24 class DictionaryValue;
25 class DOMUI; 25 class DOMUI;
26 class PrefService; 26 class PrefService;
27 class Value; 27 class Value;
28 28
29 class TipsHandler : public DOMMessageHandler { 29 class TipsHandler : public DOMMessageHandler {
30 public: 30 public:
31 TipsHandler() : tips_cache_(NULL) {} 31 TipsHandler() : tips_cache_(NULL) {}
32 virtual ~TipsHandler() {} 32 virtual ~TipsHandler() {}
33 33
34 // DOMMessageHandler implementation and overrides. 34 // DOMMessageHandler implementation and overrides.
35 virtual DOMMessageHandler* Attach(DOMUI* dom_ui); 35 virtual DOMMessageHandler* Attach(DOMUI* dom_ui);
36 virtual void RegisterMessages(); 36 virtual void RegisterMessages();
37 37
38 // Callback which pulls tips data from the preferences. 38 // Callback which pulls tips data from the preferences.
39 void HandleGetTips(const Value* content); 39 void HandleGetTips(const Value* content);
40 40
41 // Register tips cache with pref service. 41 // Register tips cache with pref service.
42 static void RegisterUserPrefs(PrefService* prefs); 42 static void RegisterUserPrefs(PrefService* prefs);
43 43
44 private: 44 private:
45 // Make sure the string we are pushing to the NTP is a valid URL. 45 // Make sure the string we are pushing to the NTP is a valid URL.
46 bool IsValidURL(const std::wstring& url_string); 46 bool IsValidURL(const std::wstring& url_string);
47 47
48 // So we can push data out to the page that has called this handler.
49 DOMUI* dom_ui_;
50
48 // Filled with data from cache in preferences. 51 // Filled with data from cache in preferences.
49 const DictionaryValue* tips_cache_; 52 const DictionaryValue* tips_cache_;
50 53
51 DISALLOW_COPY_AND_ASSIGN(TipsHandler); 54 DISALLOW_COPY_AND_ASSIGN(TipsHandler);
52 }; 55 };
53 56
54 #endif // CHROME_BROWSER_DOM_UI_TIPS_HANDLER_H_ 57 #endif // CHROME_BROWSER_DOM_UI_TIPS_HANDLER_H_
55 58
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/new_tab_ui.cc ('k') | chrome/browser/dom_ui/tips_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698