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

Side by Side Diff: chrome/browser/ui/webui/ntp/new_tab_ui.h

Issue 11881055: Simplify WebUI data sources. Currently WebUI data sources implement a URLDataSourceDelegate interfa… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix issue in about_ui exposed by cros tests Created 7 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_
6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/prefs/public/pref_change_registrar.h" 12 #include "base/prefs/public/pref_change_registrar.h"
13 #include "base/time.h" 13 #include "base/time.h"
14 #include "base/timer.h" 14 #include "base/timer.h"
15 #include "chrome/browser/sessions/tab_restore_service.h" 15 #include "chrome/browser/sessions/tab_restore_service.h"
16 #include "content/public/browser/url_data_source_delegate.h" 16 #include "content/public/browser/url_data_source.h"
17 #include "content/public/browser/notification_observer.h" 17 #include "content/public/browser/notification_observer.h"
18 #include "content/public/browser/notification_registrar.h" 18 #include "content/public/browser/notification_registrar.h"
19 #include "content/public/browser/web_ui_controller.h" 19 #include "content/public/browser/web_ui_controller.h"
20 20
21 class GURL; 21 class GURL;
22 class PrefServiceSyncable; 22 class PrefServiceSyncable;
23 class Profile; 23 class Profile;
24 24
25 namespace base { 25 namespace base {
26 class DictionaryValue; 26 class DictionaryValue;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 virtual void RenderViewReused( 60 virtual void RenderViewReused(
61 content::RenderViewHost* render_view_host) OVERRIDE; 61 content::RenderViewHost* render_view_host) OVERRIDE;
62 62
63 // Returns true if the bookmark bar can be displayed over this webui, detached 63 // Returns true if the bookmark bar can be displayed over this webui, detached
64 // from the location bar. 64 // from the location bar.
65 bool CanShowBookmarkBar() const; 65 bool CanShowBookmarkBar() const;
66 66
67 bool showing_sync_bubble() { return showing_sync_bubble_; } 67 bool showing_sync_bubble() { return showing_sync_bubble_; }
68 void set_showing_sync_bubble(bool showing) { showing_sync_bubble_ = showing; } 68 void set_showing_sync_bubble(bool showing) { showing_sync_bubble_ = showing; }
69 69
70 class NewTabHTMLSource : public content::URLDataSourceDelegate { 70 class NewTabHTMLSource : public content::URLDataSource {
71 public: 71 public:
72 explicit NewTabHTMLSource(Profile* profile); 72 explicit NewTabHTMLSource(Profile* profile);
73 73
74 // content::URLDataSourceDelegate implementation. 74 // content::URLDataSource implementation.
75 virtual std::string GetSource() OVERRIDE; 75 virtual std::string GetSource() OVERRIDE;
76 virtual void StartDataRequest(const std::string& path, 76 virtual void StartDataRequest(
77 bool is_incognito, 77 const std::string& path,
78 int request_id) OVERRIDE; 78 bool is_incognito,
79 const content::URLDataSource::GotDataCallback& callback) OVERRIDE;
79 virtual std::string GetMimeType(const std::string&) const OVERRIDE; 80 virtual std::string GetMimeType(const std::string&) const OVERRIDE;
80 virtual bool ShouldReplaceExistingSource() const OVERRIDE; 81 virtual bool ShouldReplaceExistingSource() const OVERRIDE;
81 82
82 // Adds |resource| to the source. |resource_id| is resource id or 0, 83 // Adds |resource| to the source. |resource_id| is resource id or 0,
83 // which means return empty data set. |mime_type| is mime type of the 84 // which means return empty data set. |mime_type| is mime type of the
84 // resource. 85 // resource.
85 void AddResource(const char* resource, 86 void AddResource(const char* resource,
86 const char *mime_type, 87 const char *mime_type,
87 int resource_id); 88 int resource_id);
88 89
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 130
130 // If the sync promo NTP bubble is being shown. 131 // If the sync promo NTP bubble is being shown.
131 bool showing_sync_bubble_; 132 bool showing_sync_bubble_;
132 133
133 PrefChangeRegistrar pref_change_registrar_; 134 PrefChangeRegistrar pref_change_registrar_;
134 135
135 DISALLOW_COPY_AND_ASSIGN(NewTabUI); 136 DISALLOW_COPY_AND_ASSIGN(NewTabUI);
136 }; 137 };
137 138
138 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_ 139 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NEW_TAB_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698