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

Side by Side Diff: ios/chrome/browser/ui/reader_mode/reader_mode_checker.mm

Issue 2961533002: Add "AllArticles" mode to Reader Mode heuristics (Closed)
Patch Set: Revert "exclude ios" Created 3 years, 5 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
« no previous file with comments | « components/dom_distiller/core/experiments.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import "ios/chrome/browser/ui/reader_mode/reader_mode_checker.h" 5 #import "ios/chrome/browser/ui/reader_mode/reader_mode_checker.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "components/dom_distiller/core/distillable_page_detector.h" 9 #include "components/dom_distiller/core/distillable_page_detector.h"
10 #include "components/dom_distiller/core/experiments.h" 10 #include "components/dom_distiller/core/experiments.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 switch (dom_distiller::GetDistillerHeuristicsType()) { 143 switch (dom_distiller::GetDistillerHeuristicsType()) {
144 case dom_distiller::DistillerHeuristicsType::NONE: 144 case dom_distiller::DistillerHeuristicsType::NONE:
145 is_distillable_ = Status::kSwitchMaybe; 145 is_distillable_ = Status::kSwitchMaybe;
146 break; 146 break;
147 case dom_distiller::DistillerHeuristicsType::OG_ARTICLE: 147 case dom_distiller::DistillerHeuristicsType::OG_ARTICLE:
148 CheckIsDistillableOG(receiver); 148 CheckIsDistillableOG(receiver);
149 break; 149 break;
150 case dom_distiller::DistillerHeuristicsType::ADABOOST_MODEL: 150 case dom_distiller::DistillerHeuristicsType::ADABOOST_MODEL:
151 case dom_distiller::DistillerHeuristicsType::ALL_ARTICLES:
151 CheckIsDistillableDetector(receiver); 152 CheckIsDistillableDetector(receiver);
152 break; 153 break;
153 case dom_distiller::DistillerHeuristicsType::ALWAYS_TRUE: 154 case dom_distiller::DistillerHeuristicsType::ALWAYS_TRUE:
154 is_distillable_ = Status::kSwitchPossible; 155 is_distillable_ = Status::kSwitchPossible;
155 break; 156 break;
156 } 157 }
157 } 158 }
158 159
159 void ReaderModeChecker::WebStateDestroyed() { 160 void ReaderModeChecker::WebStateDestroyed() {
160 is_distillable_ = Status::kSwitchNo; 161 is_distillable_ = Status::kSwitchNo;
161 } 162 }
162 163
163 void ReaderModeChecker::AddObserver(ReaderModeCheckerObserver* observer) { 164 void ReaderModeChecker::AddObserver(ReaderModeCheckerObserver* observer) {
164 DCHECK(!observers_.HasObserver(observer)); 165 DCHECK(!observers_.HasObserver(observer));
165 observers_.AddObserver(observer); 166 observers_.AddObserver(observer);
166 } 167 }
167 168
168 void ReaderModeChecker::RemoveObserver(ReaderModeCheckerObserver* observer) { 169 void ReaderModeChecker::RemoveObserver(ReaderModeCheckerObserver* observer) {
169 DCHECK(observers_.HasObserver(observer)); 170 DCHECK(observers_.HasObserver(observer));
170 observers_.RemoveObserver(observer); 171 observers_.RemoveObserver(observer);
171 } 172 }
OLDNEW
« no previous file with comments | « components/dom_distiller/core/experiments.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698