OLD | NEW |
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_about_handler.h" | 10 #include "chrome/browser/browser_about_handler.h" |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 // If the active contents supports |url|, use it. | 469 // If the active contents supports |url|, use it. |
470 // Note: in both cases, we give TabContents a chance to rewrite the URL. | 470 // Note: in both cases, we give TabContents a chance to rewrite the URL. |
471 // | 471 // |
472 // TODO(brettw): The BrowserURLHandler::HandleBrowserURL call should just be | 472 // TODO(brettw): The BrowserURLHandler::HandleBrowserURL call should just be |
473 // moved here from inside TypeForURL once the tab contents types are removed. | 473 // moved here from inside TypeForURL once the tab contents types are removed. |
474 TabContents* active = active_contents(); | 474 TabContents* active = active_contents(); |
475 if (active && active->SupportsURL(&real_url)) | 475 if (active && active->SupportsURL(&real_url)) |
476 type = active->type(); | 476 type = active->type(); |
477 else | 477 else |
478 type = TabContents::TypeForURL(&real_url); | 478 type = TabContents::TypeForURL(&real_url); |
479 | 479 |
480 NavigationEntry* entry = new NavigationEntry(type, NULL, -1, real_url, | 480 NavigationEntry* entry = new NavigationEntry(type, NULL, -1, real_url, |
481 referrer, | 481 referrer, |
482 string16(), transition); | 482 string16(), transition); |
483 entry->set_display_url(url); | 483 entry->set_display_url(url); |
484 entry->set_user_typed_url(url); | 484 entry->set_user_typed_url(url); |
485 if (url.SchemeIsFile()) { | 485 if (url.SchemeIsFile()) { |
486 entry->set_title(WideToUTF16Hack( | 486 entry->set_title(WideToUTF16Hack( |
487 file_util::GetFilenameFromPath(UTF8ToWide(url.host() + url.path())))); | 487 file_util::GetFilenameFromPath(UTF8ToWide(url.host() + url.path())))); |
488 } | 488 } |
489 return entry; | 489 return entry; |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 return i; | 1229 return i; |
1230 } | 1230 } |
1231 return -1; | 1231 return -1; |
1232 } | 1232 } |
1233 | 1233 |
1234 NavigationEntry* NavigationController::GetTransientEntry() const { | 1234 NavigationEntry* NavigationController::GetTransientEntry() const { |
1235 if (transient_entry_index_ == -1) | 1235 if (transient_entry_index_ == -1) |
1236 return NULL; | 1236 return NULL; |
1237 return entries_[transient_entry_index_].get(); | 1237 return entries_[transient_entry_index_].get(); |
1238 } | 1238 } |
OLD | NEW |