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

Side by Side Diff: ios/chrome/browser/tabs/tab.mm

Issue 2740473002: DownloadManagerController now uses WebState (Closed)
Patch Set: handles nil StoreKitTabHelper 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
« no previous file with comments | « no previous file | ios/chrome/browser/ui/downloads/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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #import "ios/chrome/browser/tabs/tab.h" 5 #import "ios/chrome/browser/tabs/tab.h"
6 6
7 #import <CoreLocation/CoreLocation.h> 7 #import <CoreLocation/CoreLocation.h>
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 - (void)closeThisTab { 1437 - (void)closeThisTab {
1438 if (!parentTabModel_) 1438 if (!parentTabModel_)
1439 return; 1439 return;
1440 1440
1441 NSUInteger index = [parentTabModel_ indexOfTab:self]; 1441 NSUInteger index = [parentTabModel_ indexOfTab:self];
1442 if (index != NSNotFound) 1442 if (index != NSNotFound)
1443 [parentTabModel_ closeTabAtIndex:index]; 1443 [parentTabModel_ closeTabAtIndex:index];
1444 } 1444 }
1445 1445
1446 - (id<CRWNativeContent>)controllerForUnhandledContentAtURL:(const GURL&)url { 1446 - (id<CRWNativeContent>)controllerForUnhandledContentAtURL:(const GURL&)url {
1447 StoreKitTabHelper* helper = StoreKitTabHelper::FromWebState(self.webState); 1447 // Shows download manager UI for unhandled content.
1448 if (!helper)
1449 return nil;
1450 id<StoreKitLauncher> storeKitLauncher = helper->GetLauncher();
1451 if (!storeKitLauncher)
1452 return nil;
1453 DownloadManagerController* downloadController = 1448 DownloadManagerController* downloadController =
1454 [[[DownloadManagerController alloc] 1449 [[[DownloadManagerController alloc] initWithWebState:self.webState
1455 initWithURL:url 1450 downloadURL:url] autorelease];
1456 requestContextGetter:browserState_->GetRequestContext()
1457 storeKitLauncher:storeKitLauncher] autorelease];
1458 [downloadController start]; 1451 [downloadController start];
1459 return downloadController; 1452 return downloadController;
1460 } 1453 }
1461 1454
1462 - (void)handleExportableFile:(net::HttpResponseHeaders*)headers { 1455 - (void)handleExportableFile:(net::HttpResponseHeaders*)headers {
1463 // Only "application/pdf" is supported for now. 1456 // Only "application/pdf" is supported for now.
1464 if (self.webState->GetContentsMimeType() != "application/pdf") 1457 if (self.webState->GetContentsMimeType() != "application/pdf")
1465 return; 1458 return;
1466 1459
1467 [[NSNotificationCenter defaultCenter] 1460 [[NSNotificationCenter defaultCenter]
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
2224 2217
2225 - (TabModel*)parentTabModel { 2218 - (TabModel*)parentTabModel {
2226 return parentTabModel_; 2219 return parentTabModel_;
2227 } 2220 }
2228 2221
2229 - (FormInputAccessoryViewController*)inputAccessoryViewController { 2222 - (FormInputAccessoryViewController*)inputAccessoryViewController {
2230 return inputAccessoryViewController_.get(); 2223 return inputAccessoryViewController_.get();
2231 } 2224 }
2232 2225
2233 @end 2226 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/ui/downloads/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698