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

Side by Side Diff: chrome/browser/tab_contents/navigation_controller.cc

Issue 40076: Fix back button behavior for DOMUI contents (or at least make it as not-broke... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/tab_contents/navigation_controller.h" 5 #include "chrome/browser/tab_contents/navigation_controller.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // get confused if we navigate back to it. 47 // get confused if we navigate back to it.
48 // 48 //
49 // An empty state is treated as a new navigation by WebKit, which would mean 49 // An empty state is treated as a new navigation by WebKit, which would mean
50 // losing the navigation entries and generating a new navigation entry after 50 // losing the navigation entries and generating a new navigation entry after
51 // this one. We don't want that. To avoid this we create a valid state which 51 // this one. We don't want that. To avoid this we create a valid state which
52 // WebKit will not treat as a new navigation. 52 // WebKit will not treat as a new navigation.
53 void SetContentStateIfEmpty(NavigationEntry* entry) { 53 void SetContentStateIfEmpty(NavigationEntry* entry) {
54 if (entry->content_state().empty() && 54 if (entry->content_state().empty() &&
55 (entry->tab_type() == TAB_CONTENTS_WEB || 55 (entry->tab_type() == TAB_CONTENTS_WEB ||
56 entry->tab_type() == TAB_CONTENTS_NEW_TAB_UI || 56 entry->tab_type() == TAB_CONTENTS_NEW_TAB_UI ||
57 entry->tab_type() == TAB_CONTENTS_DOM_UI ||
57 entry->tab_type() == TAB_CONTENTS_ABOUT_UI || 58 entry->tab_type() == TAB_CONTENTS_ABOUT_UI ||
58 entry->tab_type() == TAB_CONTENTS_HTML_DIALOG || 59 entry->tab_type() == TAB_CONTENTS_HTML_DIALOG ||
59 entry->IsViewSourceMode())) { 60 entry->IsViewSourceMode())) {
60 entry->set_content_state( 61 entry->set_content_state(
61 webkit_glue::CreateHistoryStateForURL(entry->url())); 62 webkit_glue::CreateHistoryStateForURL(entry->url()));
62 } 63 }
63 } 64 }
64 65
65 // Configure all the NavigationEntries in entries for restore. This resets 66 // Configure all the NavigationEntries in entries for restore. This resets
66 // the transition type to reload and makes sure the content state isn't empty. 67 // the transition type to reload and makes sure the content state isn't empty.
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 return i; 1226 return i;
1226 } 1227 }
1227 return -1; 1228 return -1;
1228 } 1229 }
1229 1230
1230 NavigationEntry* NavigationController::GetTransientEntry() const { 1231 NavigationEntry* NavigationController::GetTransientEntry() const {
1231 if (transient_entry_index_ == -1) 1232 if (transient_entry_index_ == -1)
1232 return NULL; 1233 return NULL;
1233 return entries_[transient_entry_index_].get(); 1234 return entries_[transient_entry_index_].get();
1234 } 1235 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698