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

Side by Side Diff: ios/chrome/browser/web/sad_tab_tab_helper.h

Issue 2807843002: Refactor creation of SadTabView into a tab helper object (Closed)
Patch Set: Further small review changes 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
(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/web/public/web_state/web_state_observer.h"
6 #import "ios/web/public/web_state/web_state_user_data.h"
7
8 @protocol SadTabTabHelperDelegate;
9
10 #if !defined(__has_feature) || !__has_feature(objc_arc)
11 #error "This file requires ARC support."
12 #endif
13
14 // SadTabTabHelper listens to RenderProcessGone events and presents a
15 // SadTabView view appropriately.
16 class SadTabTabHelper : public web::WebStateUserData<SadTabTabHelper>,
17 public web::WebStateObserver {
18 public:
19 // Creates a SadTabTabHelper and attaches it to a specific web_state object,
20 // a delegate object controls presentation.
21 static void CreateForWebState(web::WebState* web_state,
22 id<SadTabTabHelperDelegate> delegate);
23
24 private:
25 // Constructor for SadTabTabHelper, assigning the helper to a web_state and
26 // providing a delegate.
27 SadTabTabHelper(web::WebState* web_state,
28 id<SadTabTabHelperDelegate> delegate);
29
30 ~SadTabTabHelper() override;
31
32 // Presents a new SadTabView via the web_state object.
33 void PresentSadTab(const GURL& url_causing_failure);
34
35 // WebStateObserver:
36 void RenderProcessGone() override;
37
38 // A TabHelperDelegate that can control aspects of this tab helper's behavior.
39 __weak id<SadTabTabHelperDelegate> delegate_;
40 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698