| OLD | NEW |
| 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 4369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4380 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, | 4380 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, |
| 4381 show_main_ui && profile_->GetOriginalProfile()->IsSyncAccessible()); | 4381 show_main_ui && profile_->GetOriginalProfile()->IsSyncAccessible()); |
| 4382 } | 4382 } |
| 4383 | 4383 |
| 4384 /////////////////////////////////////////////////////////////////////////////// | 4384 /////////////////////////////////////////////////////////////////////////////// |
| 4385 // Browser, InstantDelegate implementation: | 4385 // Browser, InstantDelegate implementation: |
| 4386 | 4386 |
| 4387 void Browser::ShowInstant(TabContentsWrapper* preview_contents) { | 4387 void Browser::ShowInstant(TabContentsWrapper* preview_contents) { |
| 4388 DCHECK(instant_->tab_contents() == GetSelectedTabContentsWrapper()); | 4388 DCHECK(instant_->tab_contents() == GetSelectedTabContentsWrapper()); |
| 4389 window_->ShowInstant(preview_contents); | 4389 window_->ShowInstant(preview_contents); |
| 4390 |
| 4391 GetSelectedTabContents()->HideContents(); |
| 4392 preview_contents->tab_contents()->ShowContents(); |
| 4390 } | 4393 } |
| 4391 | 4394 |
| 4392 void Browser::HideInstant() { | 4395 void Browser::HideInstant() { |
| 4393 window_->HideInstant(); | 4396 window_->HideInstant(); |
| 4397 if (GetSelectedTabContents()) |
| 4398 GetSelectedTabContents()->ShowContents(); |
| 4399 if (instant_->GetPreviewContents()) |
| 4400 instant_->GetPreviewContents()->tab_contents()->HideContents(); |
| 4394 } | 4401 } |
| 4395 | 4402 |
| 4396 void Browser::CommitInstant(TabContentsWrapper* preview_contents) { | 4403 void Browser::CommitInstant(TabContentsWrapper* preview_contents) { |
| 4397 TabContentsWrapper* tab_contents = instant_->tab_contents(); | 4404 TabContentsWrapper* tab_contents = instant_->tab_contents(); |
| 4398 int index = | 4405 int index = |
| 4399 tab_handler_->GetTabStripModel()->GetIndexOfTabContents(tab_contents); | 4406 tab_handler_->GetTabStripModel()->GetIndexOfTabContents(tab_contents); |
| 4400 DCHECK_NE(TabStripModel::kNoTab, index); | 4407 DCHECK_NE(TabStripModel::kNoTab, index); |
| 4401 // TabStripModel takes ownership of preview_contents. | 4408 // TabStripModel takes ownership of preview_contents. |
| 4402 tab_handler_->GetTabStripModel()->ReplaceTabContentsAt( | 4409 tab_handler_->GetTabStripModel()->ReplaceTabContentsAt( |
| 4403 index, preview_contents); | 4410 index, preview_contents); |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5500 } | 5507 } |
| 5501 | 5508 |
| 5502 void Browser::UpdateFullscreenExitBubbleContent() { | 5509 void Browser::UpdateFullscreenExitBubbleContent() { |
| 5503 GURL url; | 5510 GURL url; |
| 5504 if (fullscreened_tab_) | 5511 if (fullscreened_tab_) |
| 5505 url = fullscreened_tab_->tab_contents()->GetURL(); | 5512 url = fullscreened_tab_->tab_contents()->GetURL(); |
| 5506 | 5513 |
| 5507 window_->UpdateFullscreenExitBubbleContent( | 5514 window_->UpdateFullscreenExitBubbleContent( |
| 5508 url, GetFullscreenExitBubbleType()); | 5515 url, GetFullscreenExitBubbleType()); |
| 5509 } | 5516 } |
| OLD | NEW |