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

Side by Side Diff: chrome/browser/dom_ui/gpu_internals_ui.cc

Issue 6479007: Attempt 3 at: Splits ChromeURLDataManager into 2 chunks:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/dom_ui/gpu_internals_ui.h" 5 #include "chrome/browser/dom_ui/gpu_internals_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 11 matching lines...) Expand all
22 #include "chrome/browser/browser_thread.h" 22 #include "chrome/browser/browser_thread.h"
23 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" 23 #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
24 #include "chrome/browser/gpu_process_host.h" 24 #include "chrome/browser/gpu_process_host.h"
25 #include "chrome/browser/gpu_process_host_ui_shim.h" 25 #include "chrome/browser/gpu_process_host_ui_shim.h"
26 #include "chrome/browser/io_thread.h" 26 #include "chrome/browser/io_thread.h"
27 #include "chrome/browser/net/chrome_net_log.h" 27 #include "chrome/browser/net/chrome_net_log.h"
28 #include "chrome/browser/net/connection_tester.h" 28 #include "chrome/browser/net/connection_tester.h"
29 #include "chrome/browser/net/passive_log_collector.h" 29 #include "chrome/browser/net/passive_log_collector.h"
30 #include "chrome/browser/net/url_fixer_upper.h" 30 #include "chrome/browser/net/url_fixer_upper.h"
31 #include "chrome/browser/platform_util.h" 31 #include "chrome/browser/platform_util.h"
32 #include "chrome/browser/profiles/profile.h"
33 #include "chrome/browser/tab_contents/tab_contents.h"
32 #include "chrome/common/chrome_paths.h" 34 #include "chrome/common/chrome_paths.h"
33 #include "chrome/common/chrome_version_info.h" 35 #include "chrome/common/chrome_version_info.h"
34 #include "chrome/common/jstemplate_builder.h" 36 #include "chrome/common/jstemplate_builder.h"
35 #include "chrome/common/net/url_request_context_getter.h" 37 #include "chrome/common/net/url_request_context_getter.h"
36 #include "chrome/common/url_constants.h" 38 #include "chrome/common/url_constants.h"
37 #include "grit/browser_resources.h" 39 #include "grit/browser_resources.h"
38 #include "grit/generated_resources.h" 40 #include "grit/generated_resources.h"
39 #include "net/base/escape.h" 41 #include "net/base/escape.h"
40 #include "ui/base/l10n/l10n_util.h" 42 #include "ui/base/l10n/l10n_util.h"
41 #include "ui/base/resource/resource_bundle.h" 43 #include "ui/base/resource/resource_bundle.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 gpu_info.gl_version_string())); 302 gpu_info.gl_version_string()));
301 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS", 303 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS",
302 gpu_info.gl_extensions())); 304 gpu_info.gl_extensions()));
303 305
304 DictionaryValue* info = new DictionaryValue(); 306 DictionaryValue* info = new DictionaryValue();
305 info->Set("basic_info", basic_info); 307 info->Set("basic_info", basic_info);
306 308
307 if (gpu_info.level() == GPUInfo::kPartial) { 309 if (gpu_info.level() == GPUInfo::kPartial) {
308 info->SetString("level", "partial"); 310 info->SetString("level", "partial");
309 } else if (gpu_info.level() == GPUInfo::kCompleting) { 311 } else if (gpu_info.level() == GPUInfo::kCompleting) {
310 info->SetString("level", "completing"); 312 info->SetString("level", "completing");
311 } else if (gpu_info.level() == GPUInfo::kComplete) { 313 } else if (gpu_info.level() == GPUInfo::kComplete) {
312 info->SetString("level", "complete"); 314 info->SetString("level", "complete");
313 } else { 315 } else {
314 DCHECK(false) << "Unrecognized GPUInfo::Level value"; 316 DCHECK(false) << "Unrecognized GPUInfo::Level value";
315 info->SetString("level", ""); 317 info->SetString("level", "");
316 } 318 }
317 319
318 #if defined(OS_WIN) 320 #if defined(OS_WIN)
319 if (gpu_info.level() == GPUInfo::kComplete) { 321 if (gpu_info.level() == GPUInfo::kComplete) {
320 ListValue* dx_info = DxDiagNodeToList(gpu_info.dx_diagnostics()); 322 ListValue* dx_info = DxDiagNodeToList(gpu_info.dx_diagnostics());
321 info->Set("diagnostics", dx_info); 323 info->Set("diagnostics", dx_info);
322 } 324 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 // GpuInternalsUI 360 // GpuInternalsUI
359 // 361 //
360 //////////////////////////////////////////////////////////////////////////////// 362 ////////////////////////////////////////////////////////////////////////////////
361 363
362 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : DOMUI(contents) { 364 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : DOMUI(contents) {
363 AddMessageHandler((new GpuMessageHandler())->Attach(this)); 365 AddMessageHandler((new GpuMessageHandler())->Attach(this));
364 366
365 GpuHTMLSource* html_source = new GpuHTMLSource(); 367 GpuHTMLSource* html_source = new GpuHTMLSource();
366 368
367 // Set up the chrome://gpu/ source. 369 // Set up the chrome://gpu/ source.
368 BrowserThread::PostTask( 370 contents->profile()->GetChromeURLDataManager()->AddDataSource(html_source);
369 BrowserThread::IO, FROM_HERE,
370 NewRunnableMethod(
371 ChromeURLDataManager::GetInstance(),
372 &ChromeURLDataManager::AddDataSource,
373 make_scoped_refptr(html_source)));
374 } 371 }
375 372
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698