OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/tab_contents/navigation_controller.h" | 5 #include "content/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 "base/time.h" | 10 #include "base/time.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/browser_about_handler.h" | 12 #include "chrome/browser/browser_about_handler.h" |
13 #include "chrome/browser/browser_url_handler.h" | 13 #include "chrome/browser/browser_url_handler.h" |
14 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/sessions/session_types.h" | 16 #include "chrome/browser/sessions/session_types.h" |
17 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
18 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
20 #include "content/browser/in_process_webkit/session_storage_namespace.h" | 20 #include "content/browser/in_process_webkit/session_storage_namespace.h" |
21 #include "content/browser/site_instance.h" | 21 #include "content/browser/site_instance.h" |
22 #include "content/browser/tab_contents/interstitial_page.h" | 22 #include "content/browser/tab_contents/interstitial_page.h" |
23 #include "content/browser/tab_contents/navigation_entry.h" | 23 #include "content/browser/tab_contents/navigation_entry.h" |
24 #include "content/browser/tab_contents/tab_contents.h" | 24 #include "content/browser/tab_contents/tab_contents.h" |
25 #include "content/browser/tab_contents/tab_contents_delegate.h" | 25 #include "content/browser/tab_contents/tab_contents_delegate.h" |
| 26 #include "content/common/content_constants.h" |
26 #include "content/common/navigation_types.h" | 27 #include "content/common/navigation_types.h" |
27 #include "content/common/notification_service.h" | 28 #include "content/common/notification_service.h" |
28 #include "content/common/view_messages.h" | 29 #include "content/common/view_messages.h" |
29 #include "grit/app_resources.h" | 30 #include "grit/app_resources.h" |
30 #include "net/base/escape.h" | 31 #include "net/base/escape.h" |
31 #include "net/base/mime_util.h" | 32 #include "net/base/mime_util.h" |
32 #include "net/base/net_util.h" | 33 #include "net/base/net_util.h" |
33 #include "webkit/glue/webkit_glue.h" | 34 #include "webkit/glue/webkit_glue.h" |
34 | 35 |
35 namespace { | 36 namespace { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 return existing_url.ReplaceComponents(replacements) == | 101 return existing_url.ReplaceComponents(replacements) == |
101 new_url.ReplaceComponents(replacements); | 102 new_url.ReplaceComponents(replacements); |
102 } | 103 } |
103 | 104 |
104 } // namespace | 105 } // namespace |
105 | 106 |
106 // NavigationController --------------------------------------------------- | 107 // NavigationController --------------------------------------------------- |
107 | 108 |
108 // static | 109 // static |
109 size_t NavigationController::max_entry_count_ = | 110 size_t NavigationController::max_entry_count_ = |
110 chrome::kMaxSessionHistoryEntries; | 111 content::kMaxSessionHistoryEntries; |
111 | 112 |
112 // static | 113 // static |
113 bool NavigationController::check_for_repost_ = true; | 114 bool NavigationController::check_for_repost_ = true; |
114 | 115 |
115 NavigationController::NavigationController( | 116 NavigationController::NavigationController( |
116 TabContents* contents, | 117 TabContents* contents, |
117 Profile* profile, | 118 Profile* profile, |
118 SessionStorageNamespace* session_storage_namespace) | 119 SessionStorageNamespace* session_storage_namespace) |
119 : profile_(profile), | 120 : profile_(profile), |
120 pending_entry_(NULL), | 121 pending_entry_(NULL), |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1217 size_t insert_index = 0; | 1218 size_t insert_index = 0; |
1218 for (int i = 0; i < max_index; i++) { | 1219 for (int i = 0; i < max_index; i++) { |
1219 // When cloning a tab, copy all entries except interstitial pages | 1220 // When cloning a tab, copy all entries except interstitial pages |
1220 if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) { | 1221 if (source.entries_[i].get()->page_type() != INTERSTITIAL_PAGE) { |
1221 entries_.insert(entries_.begin() + insert_index++, | 1222 entries_.insert(entries_.begin() + insert_index++, |
1222 linked_ptr<NavigationEntry>( | 1223 linked_ptr<NavigationEntry>( |
1223 new NavigationEntry(*source.entries_[i]))); | 1224 new NavigationEntry(*source.entries_[i]))); |
1224 } | 1225 } |
1225 } | 1226 } |
1226 } | 1227 } |
OLD | NEW |