Chromium Code Reviews| 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/sad_tab_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 // SadTabTabHelper listens to RenderProcessGone events and presents a | |
| 14 // SadTabView view appropriately | |
|
kkhorimoto
2017/04/11 02:13:15
Please finish comments with a period here and else
PL
2017/04/11 03:08:56
Done! (Maybe this is something we can have git cl
| |
| 15 class SadTabTabHelper : public web::WebStateUserData<SadTabTabHelper>, | |
| 16 public web::WebStateObserver { | |
| 17 public: | |
| 18 // Create a SadTabTabHelper and attach it to a specific web_state object, | |
| 19 // an optional delegate object can be provided to control presentation | |
| 20 static void CreateForWebState(web::WebState* web_state, | |
| 21 id<SadTabTabHelperDelegate> delegate); | |
| 22 | |
| 23 private: | |
| 24 // Constructor for SadTabTabHelper, assigning the helper to a web_state and | |
| 25 // providing an optional delegate | |
|
kkhorimoto
2017/04/11 02:13:15
Do we want the delegate to be optional? I can't t
PL
2017/04/11 03:08:56
Done. This made more sense when I had the notion o
| |
| 26 SadTabTabHelper(web::WebState* web_state, | |
| 27 id<SadTabTabHelperDelegate> delegate); | |
| 28 | |
| 29 // Deconstructor for SadTabTabHelper | |
| 30 ~SadTabTabHelper() override; | |
| 31 | |
| 32 // A TabHelperDelegate that can control aspects of this tab helper's behavior | |
| 33 __weak id<SadTabTabHelperDelegate> delegate_; | |
| 34 | |
| 35 // Presents a new SadTabView via the web_state object | |
| 36 void PresentSadTab(const GURL& url_causing_failure); | |
| 37 | |
| 38 // WebStateObserver: | |
| 39 void RenderProcessGone() override; | |
| 40 }; | |
| OLD | NEW |