Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ios/web/web_state/web_state_impl.h" | 5 #include "ios/web/web_state/web_state_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 #import "ios/web/web_state/ui/crw_web_controller.h" | 26 #import "ios/web/web_state/ui/crw_web_controller.h" |
| 27 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" | 27 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" |
| 28 #import "ios/web/web_state/ui/crw_wk_web_view_web_controller.h" | 28 #import "ios/web/web_state/ui/crw_wk_web_view_web_controller.h" |
| 29 #include "ios/web/web_state/web_state_facade_delegate.h" | 29 #include "ios/web/web_state/web_state_facade_delegate.h" |
| 30 #import "ios/web/webui/web_ui_ios_controller_factory_registry.h" | 30 #import "ios/web/webui/web_ui_ios_controller_factory_registry.h" |
| 31 #import "ios/web/webui/web_ui_ios_impl.h" | 31 #import "ios/web/webui/web_ui_ios_impl.h" |
| 32 #include "net/http/http_response_headers.h" | 32 #include "net/http/http_response_headers.h" |
| 33 | 33 |
| 34 namespace web { | 34 namespace web { |
| 35 | 35 |
| 36 /* static */ | |
| 37 std::unique_ptr<WebState> WebState::Create(const CreateParams& params) { | |
| 38 WebStateImpl* web_state(new WebStateImpl(params.browser_state)); | |
|
rohitrao (ping after 24h)
2016/04/21 00:17:18
Is it worth wrapping this in a unique_ptr too?
Eugene But (OOO till 7-30)
2016/04/21 00:48:16
Done.
| |
| 39 | |
| 40 NSString* window_name = nil; | |
| 41 NSString* opener_id = nil; | |
| 42 BOOL opened_by_dom = NO; | |
| 43 int opener_navigation_index = 0; | |
| 44 web_state->GetNavigationManagerImpl().InitializeSession( | |
| 45 window_name, opener_id, opened_by_dom, opener_navigation_index); | |
| 46 | |
| 47 return std::unique_ptr<WebState>(web_state); | |
|
rohitrao (ping after 24h)
2016/04/21 00:17:18
And then using web_state.release() here?
Eugene But (OOO till 7-30)
2016/04/21 00:48:16
Done.
| |
| 48 } | |
| 49 | |
| 36 WebStateImpl::WebStateImpl(BrowserState* browser_state) | 50 WebStateImpl::WebStateImpl(BrowserState* browser_state) |
| 37 : delegate_(nullptr), | 51 : delegate_(nullptr), |
| 38 is_loading_(false), | 52 is_loading_(false), |
| 39 is_being_destroyed_(false), | 53 is_being_destroyed_(false), |
| 40 facade_delegate_(nullptr), | 54 facade_delegate_(nullptr), |
| 41 web_controller_(nil), | 55 web_controller_(nil), |
| 42 navigation_manager_(this, browser_state), | 56 navigation_manager_(this, browser_state), |
| 43 interstitial_(nullptr), | 57 interstitial_(nullptr), |
| 44 weak_factory_(this) { | 58 weak_factory_(this) { |
| 45 GlobalWebStateEventTracker::GetInstance()->OnWebStateCreated(this); | 59 GlobalWebStateEventTracker::GetInstance()->OnWebStateCreated(this); |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 626 const LoadCommittedDetails& load_details) { | 640 const LoadCommittedDetails& load_details) { |
| 627 FOR_EACH_OBSERVER(WebStateObserver, observers_, | 641 FOR_EACH_OBSERVER(WebStateObserver, observers_, |
| 628 NavigationItemCommitted(load_details)); | 642 NavigationItemCommitted(load_details)); |
| 629 } | 643 } |
| 630 | 644 |
| 631 WebState* WebStateImpl::GetWebState() { | 645 WebState* WebStateImpl::GetWebState() { |
| 632 return this; | 646 return this; |
| 633 } | 647 } |
| 634 | 648 |
| 635 } // namespace web | 649 } // namespace web |
| OLD | NEW |