| 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 void OnDetailsAvailable() override; |
| 129 | 129 |
| 130 private: | 130 private: |
| 131 virtual ~AboutMemoryHandler() {} | 131 ~AboutMemoryHandler() override {} |
| 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_; |
| 139 | 139 |
| 140 DISALLOW_COPY_AND_ASSIGN(AboutMemoryHandler); | 140 DISALLOW_COPY_AND_ASSIGN(AboutMemoryHandler); |
| 141 }; | 141 }; |
| (...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1162 Profile* profile = Profile::FromWebUI(web_ui); | 1162 Profile* profile = Profile::FromWebUI(web_ui); |
| 1163 | 1163 |
| 1164 #if defined(ENABLE_THEMES) | 1164 #if defined(ENABLE_THEMES) |
| 1165 // Set up the chrome://theme/ source. | 1165 // Set up the chrome://theme/ source. |
| 1166 ThemeSource* theme = new ThemeSource(profile); | 1166 ThemeSource* theme = new ThemeSource(profile); |
| 1167 content::URLDataSource::Add(profile, theme); | 1167 content::URLDataSource::Add(profile, theme); |
| 1168 #endif | 1168 #endif |
| 1169 | 1169 |
| 1170 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 1170 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
| 1171 } | 1171 } |
| OLD | NEW |