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

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

Issue 8373010: Fixing visibility transitions for Instant. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Addressing Sreeram's comments. Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 4293 matching lines...) Expand 10 before | Expand all | Expand 10 after
4304 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, 4304 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS,
4305 show_main_ui && profile_->GetOriginalProfile()->IsSyncAccessible()); 4305 show_main_ui && profile_->GetOriginalProfile()->IsSyncAccessible());
4306 } 4306 }
4307 4307
4308 /////////////////////////////////////////////////////////////////////////////// 4308 ///////////////////////////////////////////////////////////////////////////////
4309 // Browser, InstantDelegate implementation: 4309 // Browser, InstantDelegate implementation:
4310 4310
4311 void Browser::ShowInstant(TabContentsWrapper* preview_contents) { 4311 void Browser::ShowInstant(TabContentsWrapper* preview_contents) {
4312 DCHECK(instant_->tab_contents() == GetSelectedTabContentsWrapper()); 4312 DCHECK(instant_->tab_contents() == GetSelectedTabContentsWrapper());
4313 window_->ShowInstant(preview_contents); 4313 window_->ShowInstant(preview_contents);
4314
4315 GetSelectedTabContents()->HideContents();
4316 preview_contents->tab_contents()->ShowContents();
4314 } 4317 }
4315 4318
4316 void Browser::HideInstant() { 4319 void Browser::HideInstant() {
4317 window_->HideInstant(); 4320 window_->HideInstant();
4321 GetSelectedTabContents()->ShowContents();
sky 2011/10/26 00:01:06 What is the event ordering on a tab switch? I want
4322 if (instant_->GetPreviewContents())
4323 instant_->GetPreviewContents()->tab_contents()->HideContents();
4318 } 4324 }
4319 4325
4320 void Browser::CommitInstant(TabContentsWrapper* preview_contents) { 4326 void Browser::CommitInstant(TabContentsWrapper* preview_contents) {
4321 TabContentsWrapper* tab_contents = instant_->tab_contents(); 4327 TabContentsWrapper* tab_contents = instant_->tab_contents();
4322 int index = 4328 int index =
4323 tab_handler_->GetTabStripModel()->GetIndexOfTabContents(tab_contents); 4329 tab_handler_->GetTabStripModel()->GetIndexOfTabContents(tab_contents);
4324 DCHECK_NE(TabStripModel::kNoTab, index); 4330 DCHECK_NE(TabStripModel::kNoTab, index);
4325 // TabStripModel takes ownership of preview_contents. 4331 // TabStripModel takes ownership of preview_contents.
4326 tab_handler_->GetTabStripModel()->ReplaceTabContentsAt( 4332 tab_handler_->GetTabStripModel()->ReplaceTabContentsAt(
4327 index, preview_contents); 4333 index, preview_contents);
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after
5499 } 5505 }
5500 5506
5501 void Browser::UpdateFullscreenExitBubbleContent() { 5507 void Browser::UpdateFullscreenExitBubbleContent() {
5502 GURL url; 5508 GURL url;
5503 if (fullscreened_tab_) 5509 if (fullscreened_tab_)
5504 url = fullscreened_tab_->tab_contents()->GetURL(); 5510 url = fullscreened_tab_->tab_contents()->GetURL();
5505 5511
5506 window_->UpdateFullscreenExitBubbleContent( 5512 window_->UpdateFullscreenExitBubbleContent(
5507 url, GetFullscreenExitBubbleType()); 5513 url, GetFullscreenExitBubbleType());
5508 } 5514 }
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_loader.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698