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

Side by Side Diff: components/dom_distiller/core/experiments.cc

Issue 2768093004: Remove unused feedback class in dom distiller component (Closed)
Patch Set: address comments Created 3 years, 9 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/dom_distiller/core/experiments.h" 5 #include "components/dom_distiller/core/experiments.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "components/dom_distiller/core/dom_distiller_switches.h" 10 #include "components/dom_distiller/core/dom_distiller_switches.h"
(...skipping 29 matching lines...) Expand all
40 base::CompareCase::INSENSITIVE_ASCII)) { 40 base::CompareCase::INSENSITIVE_ASCII)) {
41 return DistillerHeuristicsType::OG_ARTICLE; 41 return DistillerHeuristicsType::OG_ARTICLE;
42 } 42 }
43 if (base::StartsWith(group_name, "Disabled", 43 if (base::StartsWith(group_name, "Disabled",
44 base::CompareCase::INSENSITIVE_ASCII)) { 44 base::CompareCase::INSENSITIVE_ASCII)) {
45 return DistillerHeuristicsType::NONE; 45 return DistillerHeuristicsType::NONE;
46 } 46 }
47 } 47 }
48 return DistillerHeuristicsType::ADABOOST_MODEL; 48 return DistillerHeuristicsType::ADABOOST_MODEL;
49 } 49 }
50
51 bool ShouldShowFeedbackForm() {
52 const std::string group_name =
53 base::FieldTrialList::FindFullName("ReaderModeUIFeedback");
54 const std::string switch_value =
55 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
56 switches::kReaderModeFeedback);
57 if (switch_value != "") {
58 if (switch_value == switches::reader_mode_feedback::kOn) {
59 return true;
60 }
61 if (switch_value == switches::reader_mode_feedback::kOff) {
62 return false;
63 }
64 NOTREACHED() << "Invalid value for " << switches::kReaderModeFeedback;
65 } else {
66 if (group_name == "DoNotShow") {
67 return false;
68 }
69 if (group_name == "Show") {
70 return true;
71 }
72 }
73 return false;
74 } 50 }
75 }
OLDNEW
« no previous file with comments | « components/dom_distiller/core/experiments.h ('k') | components/dom_distiller/core/javascript/dom_distiller_viewer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698