OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #import "ios/chrome/browser/web/tab_helper_delegate.h" | |
6 #import "ios/web/public/web_state/web_state_observer.h" | |
7 #import "ios/web/public/web_state/web_state_user_data.h" | |
8 | |
9 #if !defined(__has_feature) || !__has_feature(objc_arc) | |
10 #error "This file requires ARC support." | |
11 #endif | |
12 | |
13 class SadTabTabHelper : public web::WebStateUserData<SadTabTabHelper>, | |
kkhorimoto
2017/04/10 22:31:09
Please add comments for this class
PL
2017/04/11 01:35:21
Done, thanks!
| |
14 public web::WebStateObserver { | |
15 public: | |
16 explicit SadTabTabHelper(web::WebState* web_state); | |
17 SadTabTabHelper(web::WebState* web_state, id<TabHelperDelegate> delegate); | |
18 ~SadTabTabHelper() override; | |
kkhorimoto
2017/04/10 22:31:10
If we want to enforce that this object is created
PL
2017/04/11 01:35:21
Done: I don't need the first one, so I've taken th
| |
19 | |
20 static void CreateForWebState(web::WebState* web_state, | |
kkhorimoto
2017/04/10 22:31:09
Needs a comment.
PL
2017/04/11 01:35:21
Done, thank you!
| |
21 id<TabHelperDelegate> delegate); | |
22 | |
23 // A TabHelperDelegate that can control aspects of this tab helper's behavior | |
24 __weak id<TabHelperDelegate> delegate; | |
kkhorimoto
2017/04/10 22:31:10
C++ ivars require a trailing underscore. Also, we
Eugene But (OOO till 7-30)
2017/04/10 22:56:28
More on Access Control here:
https://google.github
PL
2017/04/11 01:35:21
Done! I've made the delegate variable private. I'm
| |
25 | |
26 private: | |
27 // Presents a new SadTabView via the web_state object | |
28 void presentSadTab(const GURL& urlCausingFailure); | |
kkhorimoto
2017/04/10 22:31:09
s/urlCausingFailure/url_causing_failure
kkhorimoto
2017/04/10 22:31:10
s/presentSadTab/PresentSadTab
PL
2017/04/11 01:35:21
Done. My Objective-C is showing, thanks!
| |
29 | |
30 // An overridden callback that notifies SadTabTabHelper of a renderer crash | |
31 // via the web_state_observer superclass | |
32 void RenderProcessGone() override; | |
kkhorimoto
2017/04/10 22:31:09
Typically for overridden functions, we just commen
PL
2017/04/11 01:35:21
Done, thanks!
| |
33 | |
34 NSString* helperID(); | |
35 }; | |
OLD | NEW |