| OLD | NEW |
| 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/crashes_ui.h" | 5 #include "chrome/browser/ui/webui/crashes_ui.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
| 24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 25 #include "content/public/browser/web_ui.h" | 25 #include "content/public/browser/web_ui.h" |
| 26 #include "content/public/browser/web_ui_message_handler.h" | 26 #include "content/public/browser/web_ui_message_handler.h" |
| 27 #include "grit/browser_resources.h" | 27 #include "grit/browser_resources.h" |
| 28 #include "grit/chromium_strings.h" | 28 #include "grit/chromium_strings.h" |
| 29 #include "grit/generated_resources.h" | 29 #include "grit/generated_resources.h" |
| 30 #include "grit/theme_resources.h" | 30 #include "grit/theme_resources.h" |
| 31 #include "grit/theme_resources_standard.h" | 31 #include "grit/theme_resources_standard.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/layout.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
| 34 | 35 |
| 35 #if defined(OS_CHROMEOS) | 36 #if defined(OS_CHROMEOS) |
| 36 #include "chrome/browser/chromeos/cros_settings.h" | 37 #include "chrome/browser/chromeos/cros_settings.h" |
| 37 #endif | 38 #endif |
| 38 | 39 |
| 39 using content::WebContents; | 40 using content::WebContents; |
| 40 using content::WebUIMessageHandler; | 41 using content::WebUIMessageHandler; |
| 41 | 42 |
| 42 namespace { | 43 namespace { |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 web_ui->AddMessageHandler(new CrashesDOMHandler()); | 166 web_ui->AddMessageHandler(new CrashesDOMHandler()); |
| 166 | 167 |
| 167 // Set up the chrome://crashes/ source. | 168 // Set up the chrome://crashes/ source. |
| 168 Profile* profile = Profile::FromWebUI(web_ui); | 169 Profile* profile = Profile::FromWebUI(web_ui); |
| 169 ChromeURLDataManager::AddDataSource(profile, CreateCrashesUIHTMLSource()); | 170 ChromeURLDataManager::AddDataSource(profile, CreateCrashesUIHTMLSource()); |
| 170 } | 171 } |
| 171 | 172 |
| 172 // static | 173 // static |
| 173 base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes() { | 174 base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes() { |
| 174 return ResourceBundle::GetSharedInstance(). | 175 return ResourceBundle::GetSharedInstance(). |
| 175 LoadDataResourceBytes(IDR_SAD_FAVICON); | 176 LoadDataResourceBytes(IDR_SAD_FAVICON, |
| 177 ui::SCALE_FACTOR_NONE); |
| 176 } | 178 } |
| 177 | 179 |
| 178 // static | 180 // static |
| 179 bool CrashesUI::CrashReportingEnabled() { | 181 bool CrashesUI::CrashReportingEnabled() { |
| 180 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) | 182 #if defined(GOOGLE_CHROME_BUILD) && !defined(OS_CHROMEOS) |
| 181 PrefService* prefs = g_browser_process->local_state(); | 183 PrefService* prefs = g_browser_process->local_state(); |
| 182 return prefs->GetBoolean(prefs::kMetricsReportingEnabled); | 184 return prefs->GetBoolean(prefs::kMetricsReportingEnabled); |
| 183 #elif defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) | 185 #elif defined(GOOGLE_CHROME_BUILD) && defined(OS_CHROMEOS) |
| 184 bool reporting_enabled = false; | 186 bool reporting_enabled = false; |
| 185 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, | 187 chromeos::CrosSettings::Get()->GetBoolean(chromeos::kStatsReportingPref, |
| 186 &reporting_enabled); | 188 &reporting_enabled); |
| 187 return reporting_enabled; | 189 return reporting_enabled; |
| 188 #else | 190 #else |
| 189 return false; | 191 return false; |
| 190 #endif | 192 #endif |
| 191 } | 193 } |
| OLD | NEW |