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/options/clear_browser_data_handler.h" | 5 #include "chrome/browser/ui/webui/options/clear_browser_data_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
14 #include "base/metrics/sparse_histogram.h" | 14 #include "base/metrics/sparse_histogram.h" |
15 #include "base/prefs/pref_service.h" | |
16 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
17 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
18 #include "base/values.h" | 17 #include "base/values.h" |
19 #include "chrome/app/chrome_command_ids.h" | 18 #include "chrome/app/chrome_command_ids.h" |
20 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/browsing_data/autofill_counter.h" | 20 #include "chrome/browser/browsing_data/autofill_counter.h" |
22 #include "chrome/browser/browsing_data/browsing_data_counter.h" | 21 #include "chrome/browser/browsing_data/browsing_data_counter.h" |
23 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h" | 22 #include "chrome/browser/browsing_data/browsing_data_counter_utils.h" |
24 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 23 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
25 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 24 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
26 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 25 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
27 #include "chrome/browser/browsing_data/cache_counter.h" | 26 #include "chrome/browser/browsing_data/cache_counter.h" |
28 #include "chrome/browser/browsing_data/history_counter.h" | 27 #include "chrome/browser/browsing_data/history_counter.h" |
29 #include "chrome/browser/browsing_data/passwords_counter.h" | 28 #include "chrome/browser/browsing_data/passwords_counter.h" |
30 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 29 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
31 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
32 #include "chrome/browser/sync/profile_sync_service_factory.h" | 31 #include "chrome/browser/sync/profile_sync_service_factory.h" |
33 #include "chrome/browser/ui/accelerator_utils.h" | 32 #include "chrome/browser/ui/accelerator_utils.h" |
34 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
35 #include "chrome/grit/generated_resources.h" | 34 #include "chrome/grit/generated_resources.h" |
36 #include "chrome/grit/locale_settings.h" | 35 #include "chrome/grit/locale_settings.h" |
37 #include "components/google/core/browser/google_util.h" | 36 #include "components/google/core/browser/google_util.h" |
| 37 #include "components/prefs/pref_service.h" |
38 #include "content/public/browser/notification_details.h" | 38 #include "content/public/browser/notification_details.h" |
39 #include "content/public/browser/web_ui.h" | 39 #include "content/public/browser/web_ui.h" |
40 #include "ui/base/accelerators/accelerator.h" | 40 #include "ui/base/accelerators/accelerator.h" |
41 #include "ui/base/l10n/l10n_util.h" | 41 #include "ui/base/l10n/l10n_util.h" |
42 #include "ui/events/keycodes/keyboard_codes.h" | 42 #include "ui/events/keycodes/keyboard_codes.h" |
43 | 43 |
44 namespace { | 44 namespace { |
45 | 45 |
46 const char kClearBrowsingDataLearnMoreUrl[] = | 46 const char kClearBrowsingDataLearnMoreUrl[] = |
47 "https://support.google.com/chrome/?p=settings_clear_browsing_data"; | 47 "https://support.google.com/chrome/?p=settings_clear_browsing_data"; |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 base::StringValue(GetCounterTextFromResult(result.get()))); | 326 base::StringValue(GetCounterTextFromResult(result.get()))); |
327 } | 327 } |
328 | 328 |
329 void ClearBrowserDataHandler::OnStateChanged() { | 329 void ClearBrowserDataHandler::OnStateChanged() { |
330 web_ui()->CallJavascriptFunction( | 330 web_ui()->CallJavascriptFunction( |
331 "ClearBrowserDataOverlay.updateSyncWarning", | 331 "ClearBrowserDataOverlay.updateSyncWarning", |
332 base::FundamentalValue(sync_service_ && sync_service_->IsSyncActive())); | 332 base::FundamentalValue(sync_service_ && sync_service_->IsSyncActive())); |
333 } | 333 } |
334 | 334 |
335 } // namespace options | 335 } // namespace options |
OLD | NEW |