| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ | 5 #ifndef COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ |
| 6 #define COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ | 6 #define COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 9 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 11 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
| 12 #include "url/gurl.h" |
| 10 | 13 |
| 11 namespace web_view { | 14 namespace web_view { |
| 12 | 15 |
| 13 class FrameConnection; | 16 class FrameConnection; |
| 14 class WebViewImpl; | 17 class WebViewImpl; |
| 15 | 18 |
| 16 // PendingWebViewLoad holds the state necessary to service a load of the main | 19 // PendingWebViewLoad holds the state necessary to service a load of the main |
| 17 // frame. Once the necessary state has been obtained the load is started. | 20 // frame. Once the necessary state has been obtained the load is started. |
| 18 class PendingWebViewLoad { | 21 class PendingWebViewLoad { |
| 19 public: | 22 public: |
| 20 explicit PendingWebViewLoad(WebViewImpl* web_view); | 23 explicit PendingWebViewLoad(WebViewImpl* web_view); |
| 21 ~PendingWebViewLoad(); | 24 ~PendingWebViewLoad(); |
| 22 | 25 |
| 23 void Init(mojo::URLRequestPtr request); | 26 void Init(mojo::URLRequestPtr request); |
| 24 | 27 |
| 25 scoped_ptr<FrameConnection> frame_connection() { | 28 scoped_ptr<FrameConnection> frame_connection() { |
| 26 return frame_connection_.Pass(); | 29 return frame_connection_.Pass(); |
| 27 } | 30 } |
| 28 | 31 |
| 29 bool is_content_handler_id_valid() const { | 32 bool is_content_handler_id_valid() const { |
| 30 return is_content_handler_id_valid_; | 33 return is_content_handler_id_valid_; |
| 31 } | 34 } |
| 32 | 35 |
| 36 const GURL& pending_url() const { return pending_url_; } |
| 37 |
| 33 private: | 38 private: |
| 34 void OnGotContentHandlerID(); | 39 void OnGotContentHandlerID(); |
| 35 | 40 |
| 36 WebViewImpl* web_view_; | 41 WebViewImpl* web_view_; |
| 37 | 42 |
| 43 GURL pending_url_; |
| 38 bool is_content_handler_id_valid_; | 44 bool is_content_handler_id_valid_; |
| 39 | 45 |
| 40 scoped_ptr<FrameConnection> frame_connection_; | 46 scoped_ptr<FrameConnection> frame_connection_; |
| 41 | 47 |
| 42 DISALLOW_COPY_AND_ASSIGN(PendingWebViewLoad); | 48 DISALLOW_COPY_AND_ASSIGN(PendingWebViewLoad); |
| 43 }; | 49 }; |
| 44 | 50 |
| 45 } // namespace web_view | 51 } // namespace web_view |
| 46 | 52 |
| 47 #endif // COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ | 53 #endif // COMPONENTS_WEB_VIEW_PENDING_WEB_VIEW_LOAD_H_ |
| OLD | NEW |