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

Side by Side Diff: chrome/browser/ui/webui/options/clear_browser_data_handler.cc

Issue 1434763002: Reland "Enable 'Browsing data volume counters on Desktop' by default." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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 return base::CommandLine::ForCurrentProcess()->HasSwitch( 48 if (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;
50 } 60 }
51 61
52 } // namespace 62 } // namespace
53 63
54 namespace options { 64 namespace options {
55 65
56 ClearBrowserDataHandler::ClearBrowserDataHandler() 66 ClearBrowserDataHandler::ClearBrowserDataHandler()
57 : remover_(nullptr), 67 : remover_(nullptr),
58 sync_service_(nullptr) { 68 sync_service_(nullptr) {
59 } 69 }
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 base::StringValue(GetCounterTextFromResult(result.get()))); 463 base::StringValue(GetCounterTextFromResult(result.get())));
454 } 464 }
455 465
456 void ClearBrowserDataHandler::OnStateChanged() { 466 void ClearBrowserDataHandler::OnStateChanged() {
457 web_ui()->CallJavascriptFunction( 467 web_ui()->CallJavascriptFunction(
458 "ClearBrowserDataOverlay.updateSyncWarning", 468 "ClearBrowserDataOverlay.updateSyncWarning",
459 base::FundamentalValue(sync_service_ && sync_service_->IsSyncActive())); 469 base::FundamentalValue(sync_service_ && sync_service_->IsSyncActive()));
460 } 470 }
461 471
462 } // namespace options 472 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698