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

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

Issue 2295543002: More Blimp browser tests for navigation (Closed)
Patch Set: unused 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()) {
Kevin M 2016/08/30 17:28:59 Add DLOG(ERROR) in here so that we call attention
Brian Goldman 2016/08/30 17:52:05 Done.
79 return;
80 }
78 DVLOG(1) << "Back in tab " << tab_id_; 81 DVLOG(1) << "Back in tab " << tab_id_;
79 web_contents_->GetController().GoBack(); 82 web_contents_->GetController().GoBack();
80 } 83 }
81 84
82 void Tab::GoForward() { 85 void Tab::GoForward() {
86 if (!web_contents_->GetController().CanGoForward()) {
87 return;
88 }
83 DVLOG(1) << "Forward in tab " << tab_id_; 89 DVLOG(1) << "Forward in tab " << tab_id_;
84 web_contents_->GetController().GoForward(); 90 web_contents_->GetController().GoForward();
85 } 91 }
86 92
87 void Tab::Reload() { 93 void Tab::Reload() {
88 DVLOG(1) << "Reload in tab " << tab_id_; 94 DVLOG(1) << "Reload in tab " << tab_id_;
89 web_contents_->GetController().Reload(true); 95 web_contents_->GetController().Reload(true);
90 } 96 }
91 97
92 void Tab::RenderViewCreated(content::RenderViewHost* render_view_host) { 98 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); 147 navigation_message->set_type(NavigationMessage::NAVIGATION_STATE_CHANGED);
142 navigation_message->mutable_navigation_state_changed() 148 navigation_message->mutable_navigation_state_changed()
143 ->set_page_load_completed(load_status == PageLoadStatus::LOADED); 149 ->set_page_load_completed(load_status == PageLoadStatus::LOADED);
144 150
145 navigation_message_sender_->ProcessMessage(std::move(message), 151 navigation_message_sender_->ProcessMessage(std::move(message),
146 net::CompletionCallback()); 152 net::CompletionCallback());
147 } 153 }
148 154
149 } // namespace engine 155 } // namespace engine
150 } // namespace blimp 156 } // 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