Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: blimp/engine/session/tab.cc

Issue 2295543002: More Blimp browser tests for navigation (Closed)
Patch Set: log Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « blimp/engine/browser_tests/engine_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "blimp/engine/session/tab.h" 5 #include "blimp/engine/session/tab.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "blimp/common/create_blimp_message.h" 9 #include "blimp/common/create_blimp_message.h"
10 #include "blimp/common/proto/blimp_message.pb.h" 10 #include "blimp/common/proto/blimp_message.pb.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 content::NavigationController::LoadURLParams params(url); 69 content::NavigationController::LoadURLParams params(url);
70 params.transition_type = ui::PageTransitionFromInt( 70 params.transition_type = ui::PageTransitionFromInt(
71 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); 71 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
72 params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE; 72 params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE;
73 web_contents_->GetController().LoadURLWithParams(params); 73 web_contents_->GetController().LoadURLWithParams(params);
74 web_contents_->Focus(); 74 web_contents_->Focus();
75 } 75 }
76 76
77 void Tab::GoBack() { 77 void Tab::GoBack() {
78 if (!web_contents_->GetController().CanGoBack()) {
79 DLOG(ERROR) << "Ignoring back in tab " << tab_id_;
80 return;
81 }
78 DVLOG(1) << "Back in tab " << tab_id_; 82 DVLOG(1) << "Back in tab " << tab_id_;
79 web_contents_->GetController().GoBack(); 83 web_contents_->GetController().GoBack();
80 } 84 }
81 85
82 void Tab::GoForward() { 86 void Tab::GoForward() {
87 if (!web_contents_->GetController().CanGoForward()) {
88 DLOG(ERROR) << "Ignoring forward in tab " << tab_id_;
89 return;
90 }
83 DVLOG(1) << "Forward in tab " << tab_id_; 91 DVLOG(1) << "Forward in tab " << tab_id_;
84 web_contents_->GetController().GoForward(); 92 web_contents_->GetController().GoForward();
85 } 93 }
86 94
87 void Tab::Reload() { 95 void Tab::Reload() {
88 DVLOG(1) << "Reload in tab " << tab_id_; 96 DVLOG(1) << "Reload in tab " << tab_id_;
89 web_contents_->GetController().Reload(true); 97 web_contents_->GetController().Reload(true);
90 } 98 }
91 99
92 void Tab::RenderViewCreated(content::RenderViewHost* render_view_host) { 100 void Tab::RenderViewCreated(content::RenderViewHost* render_view_host) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 navigation_message->set_type(NavigationMessage::NAVIGATION_STATE_CHANGED); 149 navigation_message->set_type(NavigationMessage::NAVIGATION_STATE_CHANGED);
142 navigation_message->mutable_navigation_state_changed() 150 navigation_message->mutable_navigation_state_changed()
143 ->set_page_load_completed(load_status == PageLoadStatus::LOADED); 151 ->set_page_load_completed(load_status == PageLoadStatus::LOADED);
144 152
145 navigation_message_sender_->ProcessMessage(std::move(message), 153 navigation_message_sender_->ProcessMessage(std::move(message),
146 net::CompletionCallback()); 154 net::CompletionCallback());
147 } 155 }
148 156
149 } // namespace engine 157 } // namespace engine
150 } // namespace blimp 158 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/engine/browser_tests/engine_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698