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

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

Issue 2604773002: Create distiller files for Reading List. (Closed)
Patch Set: feedback Created 3 years, 11 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 | « ios/chrome/browser/reading_list/url_downloader_unittest.mm ('k') | ios/chrome/test/BUILD.gn » ('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 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);
177 } 178 }
178 179
179 - (void)distillationFinished:(const std::string&)html forURL:(const GURL&)url { 180 - (void)distillationFinished:(const std::string&)html forURL:(const GURL&)url {
180 UIView* superview = [self.delegate superviewForReaderModePanel]; 181 UIView* superview = [self.delegate superviewForReaderModePanel];
181 DCHECK(_viewer || [superview viewWithTag:kReaderModeViewTag]); 182 DCHECK(_viewer || [superview viewWithTag:kReaderModeViewTag]);
182 if ([superview viewWithTag:kReaderModeViewTag]) { 183 if ([superview viewWithTag:kReaderModeViewTag]) {
183 [self.delegate loadReaderModeHTML:base::SysUTF8ToNSString(html) forURL:url]; 184 [self.delegate loadReaderModeHTML:base::SysUTF8ToNSString(html) forURL:url];
184 } else if (_viewer) { 185 } else if (_viewer) {
185 [self showInfoBar:html forURL:url]; 186 [self showInfoBar:html forURL:url];
186 } 187 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 #pragma mark - InfoBarManagerObserverBridgeProtocol. 301 #pragma mark - InfoBarManagerObserverBridgeProtocol.
301 302
302 - (void)infoBarRemoved:(infobars::InfoBar*)infobar { 303 - (void)infoBarRemoved:(infobars::InfoBar*)infobar {
303 if (infobar == infobar_) { 304 if (infobar == infobar_) {
304 _viewer.reset(); 305 _viewer.reset();
305 infobar_ = nullptr; 306 infobar_ = nullptr;
306 } 307 }
307 } 308 }
308 309
309 @end 310 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/reading_list/url_downloader_unittest.mm ('k') | ios/chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698