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

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

Issue 282093012: Remove dependencies of Metrics{Service,Log} on g_browser_process->local_state() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove cruft Created 6 years, 7 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) 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/flash_ui.h" 5 #include "chrome/browser/ui/webui/flash_ui.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/i18n/time_formatting.h" 13 #include "base/i18n/time_formatting.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "base/threading/thread_restrictions.h" 19 #include "base/threading/thread_restrictions.h"
20 #include "base/timer/timer.h" 20 #include "base/timer/timer.h"
21 #include "base/values.h" 21 #include "base/values.h"
22 #include "chrome/browser/browser_process.h"
22 #include "chrome/browser/crash_upload_list.h" 23 #include "chrome/browser/crash_upload_list.h"
23 #include "chrome/browser/metrics/metrics_service.h" 24 #include "chrome/browser/metrics/metrics_service.h"
24 #include "chrome/browser/plugins/plugin_prefs.h" 25 #include "chrome/browser/plugins/plugin_prefs.h"
25 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
26 #include "chrome/common/chrome_version_info.h" 27 #include "chrome/common/chrome_version_info.h"
27 #include "chrome/common/url_constants.h" 28 #include "chrome/common/url_constants.h"
28 #include "content/public/browser/gpu_data_manager.h" 29 #include "content/public/browser/gpu_data_manager.h"
29 #include "content/public/browser/gpu_data_manager_observer.h" 30 #include "content/public/browser/gpu_data_manager_observer.h"
30 #include "content/public/browser/plugin_service.h" 31 #include "content/public/browser/plugin_service.h"
31 #include "content/public/browser/user_metrics.h" 32 #include "content/public/browser/user_metrics.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 found_enabled = true; 292 found_enabled = true;
292 } else { 293 } else {
293 flash_version += ASCIIToUTF16(" (disabled)"); 294 flash_version += ASCIIToUTF16(" (disabled)");
294 } 295 }
295 AddPair(list, ASCIIToUTF16(kFlashPlugin), flash_version); 296 AddPair(list, ASCIIToUTF16(kFlashPlugin), flash_version);
296 } 297 }
297 } 298 }
298 299
299 // Crash information. 300 // Crash information.
300 AddPair(list, base::string16(), "--- Crash data ---"); 301 AddPair(list, base::string16(), "--- Crash data ---");
301 bool crash_reporting_enabled = 302 bool crash_reporting_enabled = MetricsServiceHelper::IsCrashReportingEnabled(
302 MetricsServiceHelper::IsCrashReportingEnabled(); 303 g_browser_process->local_state());
303 if (crash_reporting_enabled) { 304 if (crash_reporting_enabled) {
304 std::vector<CrashUploadList::UploadInfo> crashes; 305 std::vector<CrashUploadList::UploadInfo> crashes;
305 upload_list_->GetUploads(10, &crashes); 306 upload_list_->GetUploads(10, &crashes);
306 307
307 for (std::vector<CrashUploadList::UploadInfo>::iterator i = crashes.begin(); 308 for (std::vector<CrashUploadList::UploadInfo>::iterator i = crashes.begin();
308 i != crashes.end(); ++i) { 309 i != crashes.end(); ++i) {
309 base::string16 crash_string(ASCIIToUTF16(i->id)); 310 base::string16 crash_string(ASCIIToUTF16(i->id));
310 crash_string += ASCIIToUTF16(" "); 311 crash_string += ASCIIToUTF16(" ");
311 crash_string += base::TimeFormatFriendlyDateAndTime(i->time); 312 crash_string += base::TimeFormatFriendlyDateAndTime(i->time);
312 AddPair(list, ASCIIToUTF16("crash id"), crash_string); 313 AddPair(list, ASCIIToUTF16("crash id"), crash_string);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 Profile* profile = Profile::FromWebUI(web_ui); 395 Profile* profile = Profile::FromWebUI(web_ui);
395 content::WebUIDataSource::Add(profile, CreateFlashUIHTMLSource()); 396 content::WebUIDataSource::Add(profile, CreateFlashUIHTMLSource());
396 } 397 }
397 398
398 // static 399 // static
399 base::RefCountedMemory* FlashUI::GetFaviconResourceBytes( 400 base::RefCountedMemory* FlashUI::GetFaviconResourceBytes(
400 ui::ScaleFactor scale_factor) { 401 ui::ScaleFactor scale_factor) {
401 // Use the default icon for now. 402 // Use the default icon for now.
402 return NULL; 403 return NULL;
403 } 404 }
OLDNEW
« chrome/browser/metrics/metrics_service_unittest.cc ('K') | « chrome/browser/ui/webui/crashes_ui.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698