OLD | NEW |
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 #include "chrome/browser/ui/webui/about_ui.h" | 5 #include "chrome/browser/ui/webui/about_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // Handling about:memory is complicated enough to encapsulate its related | 118 // Handling about:memory is complicated enough to encapsulate its related |
119 // methods into a single class. The user should create it (on the heap) and call | 119 // methods into a single class. The user should create it (on the heap) and call |
120 // its |StartFetch()| method. | 120 // its |StartFetch()| method. |
121 class AboutMemoryHandler : public MemoryDetails { | 121 class AboutMemoryHandler : public MemoryDetails { |
122 public: | 122 public: |
123 explicit AboutMemoryHandler( | 123 explicit AboutMemoryHandler( |
124 const content::URLDataSource::GotDataCallback& callback) | 124 const content::URLDataSource::GotDataCallback& callback) |
125 : callback_(callback) { | 125 : callback_(callback) { |
126 } | 126 } |
127 | 127 |
128 virtual void OnDetailsAvailable() OVERRIDE; | 128 virtual void OnDetailsAvailable() override; |
129 | 129 |
130 private: | 130 private: |
131 virtual ~AboutMemoryHandler() {} | 131 virtual ~AboutMemoryHandler() {} |
132 | 132 |
133 void BindProcessMetrics(base::DictionaryValue* data, | 133 void BindProcessMetrics(base::DictionaryValue* data, |
134 ProcessMemoryInformation* info); | 134 ProcessMemoryInformation* info); |
135 void AppendProcess(base::ListValue* child_data, | 135 void AppendProcess(base::ListValue* child_data, |
136 ProcessMemoryInformation* info); | 136 ProcessMemoryInformation* info); |
137 | 137 |
138 content::URLDataSource::GotDataCallback callback_; | 138 content::URLDataSource::GotDataCallback callback_; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 response_string->clear(); | 182 response_string->clear(); |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 private: | 186 private: |
187 // Prevents allocation on the stack. ChromeOSOnlineTermsHandler should be | 187 // Prevents allocation on the stack. ChromeOSOnlineTermsHandler should be |
188 // created by 'operator new'. |this| takes care of destruction. | 188 // created by 'operator new'. |this| takes care of destruction. |
189 virtual ~ChromeOSOnlineTermsHandler() {} | 189 virtual ~ChromeOSOnlineTermsHandler() {} |
190 | 190 |
191 // net::URLFetcherDelegate: | 191 // net::URLFetcherDelegate: |
192 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE { | 192 virtual void OnURLFetchComplete(const net::URLFetcher* source) override { |
193 if (source != eula_fetcher_.get()) { | 193 if (source != eula_fetcher_.get()) { |
194 NOTREACHED() << "Callback from foreign URL fetcher"; | 194 NOTREACHED() << "Callback from foreign URL fetcher"; |
195 return; | 195 return; |
196 } | 196 } |
197 fetch_callback_.Run(this); | 197 fetch_callback_.Run(this); |
198 delete this; | 198 delete this; |
199 } | 199 } |
200 | 200 |
201 void OnDownloadTimeout() { | 201 void OnDownloadTimeout() { |
202 eula_fetcher_.reset(); | 202 eula_fetcher_.reset(); |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 Profile* profile = Profile::FromWebUI(web_ui); | 1096 Profile* profile = Profile::FromWebUI(web_ui); |
1097 | 1097 |
1098 #if defined(ENABLE_THEMES) | 1098 #if defined(ENABLE_THEMES) |
1099 // Set up the chrome://theme/ source. | 1099 // Set up the chrome://theme/ source. |
1100 ThemeSource* theme = new ThemeSource(profile); | 1100 ThemeSource* theme = new ThemeSource(profile); |
1101 content::URLDataSource::Add(profile, theme); | 1101 content::URLDataSource::Add(profile, theme); |
1102 #endif | 1102 #endif |
1103 | 1103 |
1104 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 1104 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
1105 } | 1105 } |
OLD | NEW |