OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser.h" | 5 #include "chrome/browser/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 3248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3259 | 3259 |
3260 /////////////////////////////////////////////////////////////////////////////// | 3260 /////////////////////////////////////////////////////////////////////////////// |
3261 // Browser, MatchPreviewDelegate implementation: | 3261 // Browser, MatchPreviewDelegate implementation: |
3262 | 3262 |
3263 void Browser::ShowMatchPreview() { | 3263 void Browser::ShowMatchPreview() { |
3264 DCHECK(match_preview_->tab_contents() == GetSelectedTabContents()); | 3264 DCHECK(match_preview_->tab_contents() == GetSelectedTabContents()); |
3265 window_->ShowMatchPreview(); | 3265 window_->ShowMatchPreview(); |
3266 } | 3266 } |
3267 | 3267 |
3268 void Browser::HideMatchPreview() { | 3268 void Browser::HideMatchPreview() { |
3269 if (match_preview_->tab_contents() == GetSelectedTabContents()) | 3269 window_->HideMatchPreview(); |
3270 window_->HideMatchPreview(); | |
3271 } | 3270 } |
3272 | 3271 |
3273 void Browser::CommitMatchPreview() { | 3272 void Browser::CommitMatchPreview() { |
3274 TabContents* tab_contents = match_preview_->tab_contents(); | 3273 TabContents* tab_contents = match_preview_->tab_contents(); |
3275 int index = tabstrip_model_->GetIndexOfTabContents(tab_contents); | 3274 int index = tabstrip_model_->GetIndexOfTabContents(tab_contents); |
3276 DCHECK_NE(-1, index); | 3275 DCHECK_NE(-1, index); |
3277 scoped_ptr<TabContents> preview_contents( | 3276 scoped_ptr<TabContents> preview_contents( |
3278 match_preview()->ReleasePreviewContents(true)); | 3277 match_preview()->ReleasePreviewContents(true)); |
3279 preview_contents->controller().CopyStateFromAndPrune( | 3278 preview_contents->controller().CopyStateFromAndPrune( |
3280 tab_contents->controller()); | 3279 tab_contents->controller()); |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4141 } | 4140 } |
4142 | 4141 |
4143 void Browser::TabRestoreServiceDestroyed(TabRestoreService* service) { | 4142 void Browser::TabRestoreServiceDestroyed(TabRestoreService* service) { |
4144 if (!tab_restore_service_) | 4143 if (!tab_restore_service_) |
4145 return; | 4144 return; |
4146 | 4145 |
4147 DCHECK_EQ(tab_restore_service_, service); | 4146 DCHECK_EQ(tab_restore_service_, service); |
4148 tab_restore_service_->RemoveObserver(this); | 4147 tab_restore_service_->RemoveObserver(this); |
4149 tab_restore_service_ = NULL; | 4148 tab_restore_service_ = NULL; |
4150 } | 4149 } |
OLD | NEW |