| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ | |
| 6 #define COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <utility> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/time/time.h" | |
| 14 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | |
| 15 #include "url/gurl.h" | |
| 16 | |
| 17 namespace web_view { | |
| 18 | |
| 19 class FrameConnection; | |
| 20 class WebViewImpl; | |
| 21 | |
| 22 // PendingWebViewLoad holds the state necessary to service a load of the main | |
| 23 // frame. Once the necessary state has been obtained the load is started. | |
| 24 class PendingWebViewLoad { | |
| 25 public: | |
| 26 explicit PendingWebViewLoad(WebViewImpl* web_view); | |
| 27 ~PendingWebViewLoad(); | |
| 28 | |
| 29 void Init(mojo::URLRequestPtr request); | |
| 30 | |
| 31 scoped_ptr<FrameConnection> frame_connection() { | |
| 32 return std::move(frame_connection_); | |
| 33 } | |
| 34 | |
| 35 bool is_content_handler_id_valid() const { | |
| 36 return is_content_handler_id_valid_; | |
| 37 } | |
| 38 | |
| 39 const GURL& pending_url() const { return pending_url_; } | |
| 40 | |
| 41 base::TimeTicks navigation_start_time() const { | |
| 42 return navigation_start_time_; | |
| 43 } | |
| 44 | |
| 45 private: | |
| 46 void OnGotContentHandlerID(); | |
| 47 | |
| 48 WebViewImpl* web_view_; | |
| 49 | |
| 50 GURL pending_url_; | |
| 51 bool is_content_handler_id_valid_; | |
| 52 | |
| 53 scoped_ptr<FrameConnection> frame_connection_; | |
| 54 | |
| 55 base::TimeTicks navigation_start_time_; | |
| 56 | |
| 57 DISALLOW_COPY_AND_ASSIGN(PendingWebViewLoad); | |
| 58 }; | |
| 59 | |
| 60 } // namespace web_view | |
| 61 | |
| 62 #endif // COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ | |
| OLD | NEW |