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

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

Issue 2666643002: Remove usage of DomDistillerService in ReadingListDownloadService. (Closed)
Patch Set: feedback Created 3 years, 10 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 #import "ios/chrome/browser/ui/reader_mode/reader_mode_controller.h" 5 #import "ios/chrome/browser/ui/reader_mode/reader_mode_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/ios/weak_nsobject.h" 10 #include "base/ios/weak_nsobject.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 ios::ChromeBrowserState::FromBrowserState(_webState->GetBrowserState()); 166 ios::ChromeBrowserState::FromBrowserState(_webState->GetBrowserState());
167 return base::MakeUnique<dom_distiller::DistillerViewer>( 167 return base::MakeUnique<dom_distiller::DistillerViewer>(
168 dom_distiller::DomDistillerServiceFactory::GetForBrowserState( 168 dom_distiller::DomDistillerServiceFactory::GetForBrowserState(
169 browserState), 169 browserState),
170 browserState->GetPrefs(), pageURL, 170 browserState->GetPrefs(), pageURL,
171 base::BindBlock(^( 171 base::BindBlock(^(
172 const GURL& pageURL, const std::string& html, 172 const GURL& pageURL, const std::string& html,
173 const std::vector<dom_distiller::DistillerViewer::ImageInfo>& images, 173 const std::vector<dom_distiller::DistillerViewer::ImageInfo>& images,
174 const std::string& title) { 174 const std::string& title) {
175 [weakSelf distillationFinished:html forURL:pageURL]; 175 [weakSelf distillationFinished:html forURL:pageURL];
176 }), 176 }));
177 nullptr);
178 } 177 }
179 178
180 - (void)distillationFinished:(const std::string&)html forURL:(const GURL&)url { 179 - (void)distillationFinished:(const std::string&)html forURL:(const GURL&)url {
181 UIView* superview = [self.delegate superviewForReaderModePanel]; 180 UIView* superview = [self.delegate superviewForReaderModePanel];
182 DCHECK(_viewer || [superview viewWithTag:kReaderModeViewTag]); 181 DCHECK(_viewer || [superview viewWithTag:kReaderModeViewTag]);
183 if ([superview viewWithTag:kReaderModeViewTag]) { 182 if ([superview viewWithTag:kReaderModeViewTag]) {
184 [self.delegate loadReaderModeHTML:base::SysUTF8ToNSString(html) forURL:url]; 183 [self.delegate loadReaderModeHTML:base::SysUTF8ToNSString(html) forURL:url];
185 } else if (_viewer) { 184 } else if (_viewer) {
186 [self showInfoBar:html forURL:url]; 185 [self showInfoBar:html forURL:url];
187 } 186 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 #pragma mark - InfoBarManagerObserverBridgeProtocol. 300 #pragma mark - InfoBarManagerObserverBridgeProtocol.
302 301
303 - (void)infoBarRemoved:(infobars::InfoBar*)infobar { 302 - (void)infoBarRemoved:(infobars::InfoBar*)infobar {
304 if (infobar == infobar_) { 303 if (infobar == infobar_) {
305 _viewer.reset(); 304 _viewer.reset();
306 infobar_ = nullptr; 305 infobar_ = nullptr;
307 } 306 }
308 } 307 }
309 308
310 @end 309 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698