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 "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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |