Chromium Code Reviews| 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 4293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 instant_->tab_contents()->tab_contents()->HideContents(); | |
|
sreeram
2011/10/25 23:26:48
Why not just: GetSelectedTabContents()->HideConten
Shishir
2011/10/25 23:46:26
Done.
| |
| 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 instant_->tab_contents()->tab_contents()->ShowContents(); | |
|
sreeram
2011/10/25 23:26:48
Same as before, why not just use GetSelectedTabCon
Shishir
2011/10/25 23:46:26
Done.
| |
| 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 Loading... | |
| 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 } |
| OLD | NEW |