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

Side by Side Diff: ios/chrome/browser/ui/contextual_search/window_gesture_observer.h

Issue 2588713002: Upstream Chrome on iOS source code [4/11]. (Closed)
Patch Set: Created 4 years 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 2014 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 #ifndef IOS_CHROME_BROWSER_UI_CONTEXTUAL_SEARCH_WINDOW_GESTURE_OBSERVER_H_
6 #define IOS_CHROME_BROWSER_UI_CONTEXTUAL_SEARCH_WINDOW_GESTURE_OBSERVER_H_
7
8 #import <UIKit/UIGestureRecognizerSubclass.h>
9 #import <UIKit/UIKit.h>
10
11 // A specialized gesture recognizer to be used to detect any gesture in the app,
12 // excluding those whose touches are solely on a particular view.
13 // A WindowGestureObserver should be added to the app's main window.
14 // Use the normal -initWithTarget:action: method to create instances of this
15 // class.
16 // This recognizer *never* succeeds and doesn't use the target and action in
17 // the normal way. Instead, as soon as there is a touch event that is not
18 // inside |viewToExclude|, this recognizer will call the given action method on
19 // the target. Then this recognizer will immediately fail and pass the touches
20 // on to other recognizers.
21 // Before the action method is called, |touchedView| will be populated with
22 // a pointer to the view that triggered the call.
23 // In case there are multiple touches that simultaneously trigger this
24 // recognizer, only the first touch that is outside of |viewToExclude| will
25 // trigger a call to the action method. There is no guarantee about how "first"
26 // will be determined in this case.
27 // The target and action supplied in the -init will never be called in the
28 // usual way other regognizers call their action methods, and adding new
29 // target/action pairs will silently no-op.
30 // If |viewToExclude| is defined, this recognizer will require all gesture
31 // recognizers on it present at initialization time to fail before receiving
32 // touch events.
33
34 @interface WindowGestureObserver : UIGestureRecognizer
35
36 @property(nonatomic, assign) UIView* viewToExclude;
37 @property(nonatomic, readonly) UIView* touchedView;
38 @end
39
40 #endif // IOS_CHROME_BROWSER_UI_CONTEXTUAL_SEARCH_WINDOW_GESTURE_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698