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

Side by Side Diff: ios/chrome/browser/web/error_page_content.mm

Issue 2823953004: [ObjC ARC] Converts ios/chrome/browser/web:web_internal to ARC. (Closed)
Patch Set: Address comments Created 3 years, 8 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 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/web/error_page_content.h" 5 #import "ios/chrome/browser/web/error_page_content.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #import "base/mac/scoped_nsobject.h"
10 #import "ios/chrome/browser/web/error_page_generator.h" 9 #import "ios/chrome/browser/web/error_page_generator.h"
11 #include "ios/web/public/referrer.h" 10 #include "ios/web/public/referrer.h"
12 #include "ui/base/page_transition_types.h" 11 #include "ui/base/page_transition_types.h"
13 #include "url/gurl.h" 12 #include "url/gurl.h"
14 13
14 #if !defined(__has_feature) || !__has_feature(objc_arc)
15 #error "This file requires ARC support."
16 #endif
17
15 @implementation ErrorPageContent 18 @implementation ErrorPageContent
16 19
17 #pragma mark - 20 #pragma mark -
18 #pragma mark CRWNativeContent methods 21 #pragma mark CRWNativeContent methods
19 22
20 // Override StaticHtmlNativeContent method to always force error pages to 23 // Override StaticHtmlNativeContent method to always force error pages to
21 // try loading the URL again, because the error might have been fixed. 24 // try loading the URL again, because the error might have been fixed.
22 - (void)reload { 25 - (void)reload {
23 // Because we don't have the original page transition at this point, just 26 // Because we don't have the original page transition at this point, just
24 // use PAGE_TRANSITION_TYPED. We can revisit if this causes problems. 27 // use PAGE_TRANSITION_TYPED. We can revisit if this causes problems.
25 [super loadURL:[self url] 28 [super loadURL:[self url]
26 referrer:web::Referrer() 29 referrer:web::Referrer()
27 transition:ui::PAGE_TRANSITION_TYPED 30 transition:ui::PAGE_TRANSITION_TYPED
28 rendererInitiated:YES]; 31 rendererInitiated:YES];
29 } 32 }
30 33
31 - (id)initWithLoader:(id<UrlLoader>)loader 34 - (id)initWithLoader:(id<UrlLoader>)loader
32 browserState:(web::BrowserState*)browserState 35 browserState:(web::BrowserState*)browserState
33 url:(const GURL&)url 36 url:(const GURL&)url
34 error:(NSError*)error 37 error:(NSError*)error
35 isPost:(BOOL)isPost 38 isPost:(BOOL)isPost
36 isIncognito:(BOOL)isIncognito { 39 isIncognito:(BOOL)isIncognito {
37 ErrorPageGenerator* generator = 40 ErrorPageGenerator* generator =
38 [[[ErrorPageGenerator alloc] initWithError:error 41 [[ErrorPageGenerator alloc] initWithError:error
39 isPost:isPost 42 isPost:isPost
40 isIncognito:isIncognito] autorelease]; 43 isIncognito:isIncognito];
41 44
42 base::scoped_nsobject<StaticHtmlViewController> HTMLViewController( 45 StaticHtmlViewController* HTMLViewController =
43 [[StaticHtmlViewController alloc] initWithGenerator:generator 46 [[StaticHtmlViewController alloc] initWithGenerator:generator
44 browserState:browserState]); 47 browserState:browserState];
45 return [super initWithLoader:loader 48 return [super initWithLoader:loader
46 staticHTMLViewController:HTMLViewController 49 staticHTMLViewController:HTMLViewController
47 URL:url]; 50 URL:url];
48 } 51 }
49 52
50 @end 53 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/web/chrome_web_client.mm ('k') | ios/chrome/browser/web/error_page_generator.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698