| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/navigation/view_impl.h" | 5 #include "services/navigation/view_impl.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
| 10 #include "content/public/browser/interstitial_page.h" | 10 #include "content/public/browser/interstitial_page.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 void ViewImpl::AddNewContents(content::WebContents* source, | 143 void ViewImpl::AddNewContents(content::WebContents* source, |
| 144 content::WebContents* new_contents, | 144 content::WebContents* new_contents, |
| 145 WindowOpenDisposition disposition, | 145 WindowOpenDisposition disposition, |
| 146 const gfx::Rect& initial_rect, | 146 const gfx::Rect& initial_rect, |
| 147 bool user_gesture, | 147 bool user_gesture, |
| 148 bool* was_blocked) { | 148 bool* was_blocked) { |
| 149 mojom::ViewClientPtr client; | 149 mojom::ViewClientPtr client; |
| 150 mojom::ViewPtr view; | 150 mojom::ViewPtr view; |
| 151 mojom::ViewRequest view_request = GetProxy(&view); | 151 mojom::ViewRequest view_request = MakeRequest(&view); |
| 152 client_->ViewCreated(std::move(view), GetProxy(&client), | 152 client_->ViewCreated(std::move(view), MakeRequest(&client), |
| 153 disposition == WindowOpenDisposition::NEW_POPUP, | 153 disposition == WindowOpenDisposition::NEW_POPUP, |
| 154 initial_rect, user_gesture); | 154 initial_rect, user_gesture); |
| 155 | 155 |
| 156 const std::string new_user_id = | 156 const std::string new_user_id = |
| 157 content::BrowserContext::GetServiceUserIdFor( | 157 content::BrowserContext::GetServiceUserIdFor( |
| 158 new_contents->GetBrowserContext()); | 158 new_contents->GetBrowserContext()); |
| 159 auto impl = base::MakeUnique<ViewImpl>(connector_->Clone(), new_user_id, | 159 auto impl = base::MakeUnique<ViewImpl>(connector_->Clone(), new_user_id, |
| 160 std::move(client), ref_->Clone()); | 160 std::move(client), ref_->Clone()); |
| 161 | 161 |
| 162 // TODO(beng): This is a bit crappy. should be able to create the ViewImpl | 162 // TODO(beng): This is a bit crappy. should be able to create the ViewImpl |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 | 317 |
| 318 views::Widget* ViewImpl::GetWidget() { | 318 views::Widget* ViewImpl::GetWidget() { |
| 319 return web_view_->GetWidget(); | 319 return web_view_->GetWidget(); |
| 320 } | 320 } |
| 321 | 321 |
| 322 const views::Widget* ViewImpl::GetWidget() const { | 322 const views::Widget* ViewImpl::GetWidget() const { |
| 323 return web_view_->GetWidget(); | 323 return web_view_->GetWidget(); |
| 324 } | 324 } |
| 325 | 325 |
| 326 } // navigation | 326 } // navigation |
| OLD | NEW |