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

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

Issue 7867044: PART1: Initiated the SignedSettings refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the comments from Denis. Created 9 years, 3 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) 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/crashes_ui.h" 5 #include "chrome/browser/ui/webui/crashes_ui.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/memory/ref_counted_memory.h" 8 #include "base/memory/ref_counted_memory.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 10 matching lines...) Expand all
21 #include "content/browser/tab_contents/tab_contents.h" 21 #include "content/browser/tab_contents/tab_contents.h"
22 #include "grit/browser_resources.h" 22 #include "grit/browser_resources.h"
23 #include "grit/chromium_strings.h" 23 #include "grit/chromium_strings.h"
24 #include "grit/generated_resources.h" 24 #include "grit/generated_resources.h"
25 #include "grit/theme_resources.h" 25 #include "grit/theme_resources.h"
26 #include "grit/theme_resources_standard.h" 26 #include "grit/theme_resources_standard.h"
27 #include "ui/base/l10n/l10n_util.h" 27 #include "ui/base/l10n/l10n_util.h"
28 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
29 29
30 #if defined(OS_CHROMEOS) 30 #if defined(OS_CHROMEOS)
31 #include "chrome/browser/chromeos/user_cros_settings_provider.h" 31 #include "chrome/browser/chromeos/cros_settings.h"
32 #endif 32 #endif
33 33
34 namespace { 34 namespace {
35 35
36 ChromeWebUIDataSource* CreateCrashesUIHTMLSource() { 36 ChromeWebUIDataSource* CreateCrashesUIHTMLSource() {
37 ChromeWebUIDataSource* source = 37 ChromeWebUIDataSource* source =
38 new ChromeWebUIDataSource(chrome::kChromeUICrashesHost); 38 new ChromeWebUIDataSource(chrome::kChromeUICrashesHost);
39 39
40 source->AddLocalizedString("crashesTitle", IDS_CRASHES_TITLE); 40 source->AddLocalizedString("crashesTitle", IDS_CRASHES_TITLE);
41 source->AddLocalizedString("crashCountFormat", 41 source->AddLocalizedString("crashCountFormat",
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 return ResourceBundle::GetSharedInstance(). 169 return ResourceBundle::GetSharedInstance().
170 LoadDataResourceBytes(IDR_SAD_FAVICON); 170 LoadDataResourceBytes(IDR_SAD_FAVICON);
171 } 171 }
172 172
173 // static 173 // static
174 bool CrashesUI::CrashReportingEnabled() { 174 bool CrashesUI::CrashReportingEnabled() {
175 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) 175 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS)
176 PrefService* prefs = g_browser_process->local_state(); 176 PrefService* prefs = g_browser_process->local_state();
177 return prefs->GetBoolean(prefs::kMetricsReportingEnabled); 177 return prefs->GetBoolean(prefs::kMetricsReportingEnabled);
178 #elif defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) 178 #elif defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS)
179 return chromeos::UserCrosSettingsProvider::cached_reporting_enabled(); 179 bool reporting_enabled;
180 if (chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref,
181 &reporting_enabled)) {
182 return reporting_enabled;
183 }
184 NOTREACHED() << "Error occurred while accessing the pref value!";
Mattias Nissler (ping if slow) 2011/09/21 11:12:59 This seems awkward. Is there any code actually doi
pastarmovj 2011/09/23 15:19:32 Done.
185 return false;
180 #else 186 #else
181 return false; 187 return false;
182 #endif 188 #endif
183 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698