File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77#include " base/strings/utf_string_conversions.h"
88#include " chrome/browser/ui/browser.h"
9+ #include " chrome/browser/ui/browser_commands.h"
910#include " chrome/browser/ui/tabs/tab_strip_model.h"
1011#include " chrome/browser/ui/views/frame/browser_view.h"
1112#include " content/public/browser/navigation_controller.h"
@@ -626,13 +627,11 @@ void DaoAddressBarView::OnToggleButtonPressed() {
626627}
627628
628629void DaoAddressBarView::OnBackButtonPressed () {
629- if (!tab_strip_model_ ) {
630+ if (!browser_ ) {
630631 return ;
631632 }
632- content::WebContents* contents =
633- tab_strip_model_->GetActiveWebContents ();
634- if (contents && contents->GetController ().CanGoBack ()) {
635- contents->GetController ().GoBack ();
633+ if (chrome::CanGoBack (browser_)) {
634+ chrome::GoBack (browser_, WindowOpenDisposition::CURRENT_TAB );
636635 }
637636}
638637
@@ -684,7 +683,7 @@ void DaoAddressBarView::UpdateNavButtonEnabled() {
684683 return ;
685684 }
686685 content::WebContents* contents = tab_strip_model_->GetActiveWebContents ();
687- bool can_back = contents && contents-> GetController (). CanGoBack ();
686+ bool can_back = browser_ && chrome:: CanGoBack (browser_ );
688687 bool can_forward = contents && contents->GetController ().CanGoForward ();
689688
690689 if (back_button_) {
You can’t perform that action at this time.
0 commit comments