| 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 #include "blimp/engine/session/blimp_engine_session.h" | 5 #include "blimp/engine/session/blimp_engine_session.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } | 314 } |
| 315 | 315 |
| 316 if (web_contents_ && web_contents_->GetRenderViewHost() && | 316 if (web_contents_ && web_contents_->GetRenderViewHost() && |
| 317 web_contents_->GetRenderViewHost()->GetWidget()) { | 317 web_contents_->GetRenderViewHost()->GetWidget()) { |
| 318 web_contents_->GetRenderViewHost()->GetWidget()->WasResized(); | 318 web_contents_->GetRenderViewHost()->GetWidget()->WasResized(); |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 | 321 |
| 322 void BlimpEngineSession::LoadUrl(const int target_tab_id, const GURL& url) { | 322 void BlimpEngineSession::LoadUrl(const int target_tab_id, const GURL& url) { |
| 323 DVLOG(1) << "Load URL " << url << " in tab " << target_tab_id; | 323 DVLOG(1) << "Load URL " << url << " in tab " << target_tab_id; |
| 324 if (url.is_empty()) { | 324 if (!url.is_valid()) { |
| 325 VLOG(1) << "Dropping invalid URL " << url; |
| 325 return; | 326 return; |
| 326 } | 327 } |
| 327 | 328 |
| 328 // TODO(dtrainor, haibinlu): Fix up the URL with url_fixer.h. If that doesn't | 329 // TODO(dtrainor, haibinlu): Fix up the URL with url_fixer.h. If that doesn't |
| 329 // produce a valid spec() then try to build a search query? | 330 // produce a valid spec() then try to build a search query? |
| 330 content::NavigationController::LoadURLParams params(url); | 331 content::NavigationController::LoadURLParams params(url); |
| 331 params.transition_type = ui::PageTransitionFromInt( | 332 params.transition_type = ui::PageTransitionFromInt( |
| 332 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); | 333 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); |
| 333 web_contents_->GetController().LoadURLWithParams(params); | 334 web_contents_->GetController().LoadURLWithParams(params); |
| 334 web_contents_->Focus(); | 335 web_contents_->Focus(); |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 | 605 |
| 605 aura::Window* parent = window_tree_host_->window(); | 606 aura::Window* parent = window_tree_host_->window(); |
| 606 aura::Window* content = web_contents_->GetNativeView(); | 607 aura::Window* content = web_contents_->GetNativeView(); |
| 607 if (!parent->Contains(content)) | 608 if (!parent->Contains(content)) |
| 608 parent->AddChild(content); | 609 parent->AddChild(content); |
| 609 content->Show(); | 610 content->Show(); |
| 610 } | 611 } |
| 611 | 612 |
| 612 } // namespace engine | 613 } // namespace engine |
| 613 } // namespace blimp | 614 } // namespace blimp |
| OLD | NEW |