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

Side by Side Diff: chrome/browser/ui/webui/gpu_internals_ui.cc

Issue 9003014: Replace WebUI::tab_contents() with web_contents() and switch all users to use web_contents.h inst... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 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
« no previous file with comments | « chrome/browser/ui/webui/gpu_internals_ui.h ('k') | chrome/browser/ui/webui/history_ui.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/gpu_internals_ui.h" 5 #include "chrome/browser/ui/webui/gpu_internals_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/string_number_conversions.h" 12 #include "base/string_number_conversions.h"
13 #include "base/stringprintf.h" 13 #include "base/stringprintf.h"
14 #include "base/sys_info.h" 14 #include "base/sys_info.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 17 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
18 #include "chrome/common/chrome_version_info.h" 18 #include "chrome/common/chrome_version_info.h"
19 #include "chrome/common/url_constants.h" 19 #include "chrome/common/url_constants.h"
20 #include "content/browser/gpu/gpu_data_manager.h" 20 #include "content/browser/gpu/gpu_data_manager.h"
21 #include "content/browser/tab_contents/tab_contents.h"
22 #include "content/browser/webui/web_ui.h" 21 #include "content/browser/webui/web_ui.h"
23 #include "content/public/browser/browser_thread.h" 22 #include "content/public/browser/browser_thread.h"
23 #include "content/public/browser/web_contents.h"
24 #include "grit/browser_resources.h" 24 #include "grit/browser_resources.h"
25 #include "grit/generated_resources.h" 25 #include "grit/generated_resources.h"
26 #include "third_party/angle/src/common/version.h" 26 #include "third_party/angle/src/common/version.h"
27 #include "ui/base/l10n/l10n_util.h" 27 #include "ui/base/l10n/l10n_util.h"
28 28
29 using content::BrowserThread; 29 using content::BrowserThread;
30 using content::WebContents;
30 31
31 namespace { 32 namespace {
32 33
33 ChromeWebUIDataSource* CreateGpuHTMLSource() { 34 ChromeWebUIDataSource* CreateGpuHTMLSource() {
34 ChromeWebUIDataSource* source = 35 ChromeWebUIDataSource* source =
35 new ChromeWebUIDataSource(chrome::kChromeUIGpuInternalsHost); 36 new ChromeWebUIDataSource(chrome::kChromeUIGpuInternalsHost);
36 37
37 source->set_json_path("strings.js"); 38 source->set_json_path("strings.js");
38 source->add_resource_path("gpu_internals.js", IDR_GPU_INTERNALS_JS); 39 source->add_resource_path("gpu_internals.js", IDR_GPU_INTERNALS_JS);
39 source->set_default_resource(IDR_GPU_INTERNALS_HTML); 40 source->set_default_resource(IDR_GPU_INTERNALS_HTML);
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 230
230 } // namespace 231 } // namespace
231 232
232 233
233 //////////////////////////////////////////////////////////////////////////////// 234 ////////////////////////////////////////////////////////////////////////////////
234 // 235 //
235 // GpuInternalsUI 236 // GpuInternalsUI
236 // 237 //
237 //////////////////////////////////////////////////////////////////////////////// 238 ////////////////////////////////////////////////////////////////////////////////
238 239
239 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : ChromeWebUI(contents) { 240 GpuInternalsUI::GpuInternalsUI(WebContents* contents) : ChromeWebUI(contents) {
240 AddMessageHandler(new GpuMessageHandler()); 241 AddMessageHandler(new GpuMessageHandler());
241 242
242 // Set up the chrome://gpu-internals/ source. 243 // Set up the chrome://gpu-internals/ source.
243 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 244 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
244 profile->GetChromeURLDataManager()->AddDataSource(CreateGpuHTMLSource()); 245 profile->GetChromeURLDataManager()->AddDataSource(CreateGpuHTMLSource());
245 } 246 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/gpu_internals_ui.h ('k') | chrome/browser/ui/webui/history_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698