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

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

Issue 3453016: Fixes bug where match preview wouldn't get hidden if match preview was (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/tab_contents/match_preview.cc » ('j') | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/tab_contents/match_preview.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698