| 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/back_forward_menu_model.h" | 5 #include "chrome/browser/back_forward_menu_model.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "chrome/browser/navigation_controller.h" | 9 #include "chrome/browser/navigation_controller.h" |
| 10 #include "chrome/browser/navigation_entry.h" | 10 #include "chrome/browser/navigation_entry.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 contents->CreateView(::GetDesktopWindow(), gfx::Rect()); | 98 contents->CreateView(::GetDesktopWindow(), gfx::Rect()); |
| 99 contents->SetupController(profile_); | 99 contents->SetupController(profile_); |
| 100 return contents; | 100 return contents; |
| 101 } | 101 } |
| 102 | 102 |
| 103 // Forwards a URL "load" request through to our dummy TabContents | 103 // Forwards a URL "load" request through to our dummy TabContents |
| 104 // implementation. | 104 // implementation. |
| 105 void LoadURLAndUpdateState(TabContents* contents, | 105 void LoadURLAndUpdateState(TabContents* contents, |
| 106 const std::wstring& url, | 106 const std::wstring& url, |
| 107 const std::wstring& title) { | 107 const std::wstring& title) { |
| 108 contents->controller()->LoadURL(GURL(url), PageTransition::LINK); | 108 contents->controller()->LoadURL(GURL(url), GURL(), PageTransition::LINK); |
| 109 BackFwdMenuModelTestTabContents* rsmttc = | 109 BackFwdMenuModelTestTabContents* rsmttc = |
| 110 static_cast<BackFwdMenuModelTestTabContents*>(contents); | 110 static_cast<BackFwdMenuModelTestTabContents*>(contents); |
| 111 rsmttc->UpdateState(title); | 111 rsmttc->UpdateState(title); |
| 112 } | 112 } |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 MessageLoopForUI message_loop_; | 115 MessageLoopForUI message_loop_; |
| 116 std::wstring test_dir_; | 116 std::wstring test_dir_; |
| 117 std::wstring profile_path_; | 117 std::wstring profile_path_; |
| 118 ProfileManager pm_; | 118 ProfileManager pm_; |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 EXPECT_EQ(4, back_model.GetIndexOfNextChapterStop(3, true)); | 498 EXPECT_EQ(4, back_model.GetIndexOfNextChapterStop(3, true)); |
| 499 // And try backwards as well. | 499 // And try backwards as well. |
| 500 EXPECT_EQ(3, back_model.GetIndexOfNextChapterStop(4, false)); | 500 EXPECT_EQ(3, back_model.GetIndexOfNextChapterStop(4, false)); |
| 501 EXPECT_EQ(1, back_model.GetIndexOfNextChapterStop(3, false)); | 501 EXPECT_EQ(1, back_model.GetIndexOfNextChapterStop(3, false)); |
| 502 EXPECT_EQ(1, back_model.GetIndexOfNextChapterStop(2, false)); | 502 EXPECT_EQ(1, back_model.GetIndexOfNextChapterStop(2, false)); |
| 503 EXPECT_EQ(-1, back_model.GetIndexOfNextChapterStop(1, false)); | 503 EXPECT_EQ(-1, back_model.GetIndexOfNextChapterStop(1, false)); |
| 504 } | 504 } |
| 505 contents->CloseContents(); | 505 contents->CloseContents(); |
| 506 } | 506 } |
| 507 | 507 |
| OLD | NEW |