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

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 11233076: Fix spurious visibility events when committing Instant. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/views/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1373 return contents_container_; 1373 return contents_container_;
1374 } 1374 }
1375 1375
1376 ToolbarView* BrowserView::GetToolbarView() const { 1376 ToolbarView* BrowserView::GetToolbarView() const {
1377 return toolbar_; 1377 return toolbar_;
1378 } 1378 }
1379 1379
1380 /////////////////////////////////////////////////////////////////////////////// 1380 ///////////////////////////////////////////////////////////////////////////////
1381 // BrowserView, TabStripModelObserver implementation: 1381 // BrowserView, TabStripModelObserver implementation:
1382 1382
1383 void BrowserView::TabInsertedAt(TabContents* contents, int index, bool active) {
sky 2012/10/24 03:51:16 Why can't we wait until ActiveTabChanged?
sreeram 2012/10/24 16:46:45 I suppose we could. However, I plan to add support
sky 2012/10/24 20:49:26 I don't like adding another method that overlaps w
sreeram 2012/10/25 00:44:33 Done. In fact, I realized that pretty much everyth
1384 if (contents_->preview_web_contents() == contents->web_contents() && active) {
1385 #if defined(USE_AURA)
1386 if (search_view_controller_.get())
1387 search_view_controller_->WillCommitInstant();
1388 #endif
1389 contents_container_ = preview_controller_->release_preview_container();
1390 contents_->MakePreviewContentsActiveContents();
1391 }
1392 }
1393
1383 void BrowserView::TabDetachedAt(TabContents* contents, int index) { 1394 void BrowserView::TabDetachedAt(TabContents* contents, int index) {
1384 // We use index here rather than comparing |contents| because by this time 1395 // We use index here rather than comparing |contents| because by this time
1385 // the model has already removed |contents| from its list, so 1396 // the model has already removed |contents| from its list, so
1386 // browser_->GetActiveWebContents() will return NULL or something else. 1397 // browser_->GetActiveWebContents() will return NULL or something else.
1387 if (index == browser_->active_index()) { 1398 if (index == browser_->active_index()) {
1388 // We need to reset the current tab contents to NULL before it gets 1399 // We need to reset the current tab contents to NULL before it gets
1389 // freed. This is because the focus manager performs some operations 1400 // freed. This is because the focus manager performs some operations
1390 // on the selected WebContents when it is removed. 1401 // on the selected WebContents when it is removed.
1391 contents_container_->SetWebContents(NULL); 1402 contents_container_->SetWebContents(NULL);
1392 infobar_container_->ChangeTabContents(NULL); 1403 infobar_container_->ChangeTabContents(NULL);
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
2639 2650
2640 Browser* modal_browser = 2651 Browser* modal_browser =
2641 browser::FindBrowserWithWebContents(active_dialog->web_contents()); 2652 browser::FindBrowserWithWebContents(active_dialog->web_contents());
2642 if (modal_browser && (browser_ != modal_browser)) { 2653 if (modal_browser && (browser_ != modal_browser)) {
2643 modal_browser->window()->FlashFrame(true); 2654 modal_browser->window()->FlashFrame(true);
2644 modal_browser->window()->Activate(); 2655 modal_browser->window()->Activate();
2645 } 2656 }
2646 2657
2647 AppModalDialogQueue::GetInstance()->ActivateModalDialog(); 2658 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
2648 } 2659 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698