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

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

Issue 8986007: Move WebUIMessageHandler to its own file in the public directory and put it in the content namesp... (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/flash_ui.cc ('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/webui/web_ui.h" 21 #include "content/browser/webui/web_ui.h"
22 #include "content/public/browser/browser_thread.h" 22 #include "content/public/browser/browser_thread.h"
23 #include "content/public/browser/web_contents.h" 23 #include "content/public/browser/web_contents.h"
24 #include "content/public/browser/web_ui_message_handler.h"
24 #include "grit/browser_resources.h" 25 #include "grit/browser_resources.h"
25 #include "grit/generated_resources.h" 26 #include "grit/generated_resources.h"
26 #include "third_party/angle/src/common/version.h" 27 #include "third_party/angle/src/common/version.h"
27 #include "ui/base/l10n/l10n_util.h" 28 #include "ui/base/l10n/l10n_util.h"
28 29
29 using content::BrowserThread; 30 using content::BrowserThread;
30 using content::WebContents; 31 using content::WebContents;
32 using content::WebUIMessageHandler;
31 33
32 namespace { 34 namespace {
33 35
34 ChromeWebUIDataSource* CreateGpuHTMLSource() { 36 ChromeWebUIDataSource* CreateGpuHTMLSource() {
35 ChromeWebUIDataSource* source = 37 ChromeWebUIDataSource* source =
36 new ChromeWebUIDataSource(chrome::kChromeUIGpuInternalsHost); 38 new ChromeWebUIDataSource(chrome::kChromeUIGpuInternalsHost);
37 39
38 source->set_json_path("strings.js"); 40 source->set_json_path("strings.js");
39 source->add_resource_path("gpu_internals.js", IDR_GPU_INTERNALS_JS); 41 source->add_resource_path("gpu_internals.js", IDR_GPU_INTERNALS_JS);
40 source->set_default_resource(IDR_GPU_INTERNALS_HTML); 42 source->set_default_resource(IDR_GPU_INTERNALS_HTML);
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // 239 //
238 //////////////////////////////////////////////////////////////////////////////// 240 ////////////////////////////////////////////////////////////////////////////////
239 241
240 GpuInternalsUI::GpuInternalsUI(WebContents* contents) : ChromeWebUI(contents) { 242 GpuInternalsUI::GpuInternalsUI(WebContents* contents) : ChromeWebUI(contents) {
241 AddMessageHandler(new GpuMessageHandler()); 243 AddMessageHandler(new GpuMessageHandler());
242 244
243 // Set up the chrome://gpu-internals/ source. 245 // Set up the chrome://gpu-internals/ source.
244 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext()); 246 Profile* profile = Profile::FromBrowserContext(contents->GetBrowserContext());
245 profile->GetChromeURLDataManager()->AddDataSource(CreateGpuHTMLSource()); 247 profile->GetChromeURLDataManager()->AddDataSource(CreateGpuHTMLSource());
246 } 248 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/flash_ui.cc ('k') | chrome/browser/ui/webui/history_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698