Chromium Code Reviews| Index: ios/web/public/web_state/navigation_handle.h |
| diff --git a/ios/web/public/web_state/navigation_handle.h b/ios/web/public/web_state/navigation_handle.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fe0c4c73168c8cd30b8eb80429654fb34cbd00a9 |
| --- /dev/null |
| +++ b/ios/web/public/web_state/navigation_handle.h |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_HANDLE_H_ |
| +#define IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_HANDLE_H_ |
| + |
| +#include "net/base/net_errors.h" |
|
kkhorimoto
2017/02/22 01:42:37
It doesn't look like this is needed here.
Eugene But (OOO till 7-30)
2017/02/22 17:54:32
Done.
|
| + |
| +class GURL; |
| + |
| +namespace web { |
| + |
| +class WebState; |
| + |
| +// Tracks information related to a single navigation. NavigationHandle is |
|
marq (ping after 24h)
2017/02/22 13:26:36
nit: 'A NavigationHandle'.
Eugene But (OOO till 7-30)
2017/02/22 17:54:32
Done.
|
| +// provided to WebStateObserver methods to allow observers to track specific |
| +// navigations and their details. Observers should clear any references to a |
| +// NavigationHandle at the time of WebStateObserver::DidFinishNavigation, just |
| +// before the handle is destroyed. |
| +class NavigationHandle { |
|
marq (ping after 24h)
2017/02/22 13:26:36
'Handle' is usually used to mean a pointer to a po
Eugene But (OOO till 7-30)
2017/02/22 17:54:32
NavigationHandle was content term. But I agree tha
|
| + public: |
| + // The WebState the navigation is taking place in. |
| + virtual WebState* GetWebState() = 0; |
|
kkhorimoto
2017/02/22 01:42:37
This is only used by a WSO callback right? If so,
Eugene But (OOO till 7-30)
2017/02/22 17:54:32
This is modeled from content, which has Navigation
kkhorimoto
2017/02/22 18:38:05
It looks like GlobalWebStateObserver includes anal
Eugene But (OOO till 7-30)
2017/02/22 21:44:56
I don't think there is a difference here between w
kkhorimoto
2017/02/22 21:55:44
Hmm, yeah you have a good point. My main reason f
Eugene But (OOO till 7-30)
2017/02/22 22:08:32
LoadCommittedDetails is always passed as a referen
|
| + |
| + // The URL the frame is navigating to. |
|
marq (ping after 24h)
2017/02/22 13:26:36
Not clear what 'frame' means in this context.
Eugene But (OOO till 7-30)
2017/02/22 17:54:32
Changed to "The URL the WebState is navigating to.
|
| + virtual const GURL& GetUrl() const = 0; |
|
kkhorimoto
2017/02/22 01:42:37
Other public web// interfaces use "URL" (which, a
Eugene But (OOO till 7-30)
2017/02/22 17:54:33
Well, there is no real consistency, and URL is pro
|
| + |
| + // Whether the navigation happened in the same page. Examples of same page |
| + // navigations are: |
| + // * reference fragment navigations |
| + // * pushState/replaceState |
| + // * same page history navigation |
| + virtual bool IsSamePage() const = 0; |
|
kkhorimoto
2017/02/22 01:42:37
s/Page/Document
Eugene But (OOO till 7-30)
2017/02/22 17:54:32
This is modeled from content and I would like to u
kkhorimoto
2017/02/22 18:38:05
While I agree that cross-platform consistency is i
Eugene But (OOO till 7-30)
2017/02/22 21:44:56
I started discussion with folks who wrote the orig
kkhorimoto
2017/02/22 21:55:44
Great, thanks for that!
|
| + |
| + // Whether the navigation resulted in an error page. |
| + virtual bool IsErrorPage() const = 0; |
| + |
| + virtual ~NavigationHandle() {} |
| +}; |
| + |
| +} // namespace web |
| + |
| +#endif // IOS_WEB_PUBLIC_WEB_STATE_NAVIGATION_HANDLE_H_ |