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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
39 #include "ui/base/text/bytes_formatting.h" | 39 #include "ui/base/text/bytes_formatting.h" |
40 #include "ui/events/keycodes/keyboard_codes.h" | 40 #include "ui/events/keycodes/keyboard_codes.h" |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 const char kClearBrowsingDataLearnMoreUrl[] = | 44 const char kClearBrowsingDataLearnMoreUrl[] = |
45 "https://support.google.com/chrome/?p=settings_clear_browsing_data"; | 45 "https://support.google.com/chrome/?p=settings_clear_browsing_data"; |
46 | 46 |
47 bool AreCountersEnabled() { | 47 bool AreCountersEnabled() { |
48 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 48 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
49 switches::kEnableClearBrowsingDataCounters)) { | 49 switches::kEnableClearBrowsingDataCounters); |
50 return true; | |
51 } | |
52 | |
53 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
54 switches::kDisableClearBrowsingDataCounters)) { | |
55 return false; | |
56 } | |
57 | |
58 // Enabled by default. | |
59 return true; | |
60 } | 50 } |
61 | 51 |
62 } // namespace | 52 } // namespace |
63 | 53 |
64 namespace options { | 54 namespace options { |
65 | 55 |
66 ClearBrowserDataHandler::ClearBrowserDataHandler() | 56 ClearBrowserDataHandler::ClearBrowserDataHandler() |
67 : remover_(nullptr), | 57 : remover_(nullptr), |
68 sync_service_(nullptr) { | 58 sync_service_(nullptr) { |
69 } | 59 } |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 base::StringValue(GetCounterTextFromResult(result.get()))); | 453 base::StringValue(GetCounterTextFromResult(result.get()))); |
464 } | 454 } |
465 | 455 |
466 void ClearBrowserDataHandler::OnStateChanged() { | 456 void ClearBrowserDataHandler::OnStateChanged() { |
467 web_ui()->CallJavascriptFunction( | 457 web_ui()->CallJavascriptFunction( |
468 "ClearBrowserDataOverlay.updateSyncWarning", | 458 "ClearBrowserDataOverlay.updateSyncWarning", |
469 base::FundamentalValue(sync_service_ && sync_service_->IsSyncActive())); | 459 base::FundamentalValue(sync_service_ && sync_service_->IsSyncActive())); |
470 } | 460 } |
471 | 461 |
472 } // namespace options | 462 } // namespace options |
OLD | NEW |