| OLD | NEW |
| 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/ui/browser.h" | 5 #include "chrome/browser/ui/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 3362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3373 void Browser::PrepareForInstant() { | 3373 void Browser::PrepareForInstant() { |
| 3374 window_->PrepareForInstant(); | 3374 window_->PrepareForInstant(); |
| 3375 } | 3375 } |
| 3376 | 3376 |
| 3377 void Browser::ShowInstant(TabContentsWrapper* preview_contents) { | 3377 void Browser::ShowInstant(TabContentsWrapper* preview_contents) { |
| 3378 DCHECK(instant_->tab_contents() == GetSelectedTabContentsWrapper()); | 3378 DCHECK(instant_->tab_contents() == GetSelectedTabContentsWrapper()); |
| 3379 window_->ShowInstant(preview_contents->tab_contents()); | 3379 window_->ShowInstant(preview_contents->tab_contents()); |
| 3380 } | 3380 } |
| 3381 | 3381 |
| 3382 void Browser::HideInstant() { | 3382 void Browser::HideInstant() { |
| 3383 window_->HideInstant(); | 3383 window_->HideInstant(instant_->is_active()); |
| 3384 } | 3384 } |
| 3385 | 3385 |
| 3386 void Browser::CommitInstant(TabContentsWrapper* preview_contents) { | 3386 void Browser::CommitInstant(TabContentsWrapper* preview_contents) { |
| 3387 TabContentsWrapper* tab_contents = instant_->tab_contents(); | 3387 TabContentsWrapper* tab_contents = instant_->tab_contents(); |
| 3388 int index = | 3388 int index = |
| 3389 tab_handler_->GetTabStripModel()->GetIndexOfTabContents(tab_contents); | 3389 tab_handler_->GetTabStripModel()->GetIndexOfTabContents(tab_contents); |
| 3390 DCHECK_NE(TabStripModel::kNoTab, index); | 3390 DCHECK_NE(TabStripModel::kNoTab, index); |
| 3391 preview_contents->controller().CopyStateFromAndPrune( | 3391 preview_contents->controller().CopyStateFromAndPrune( |
| 3392 &tab_contents->controller()); | 3392 &tab_contents->controller()); |
| 3393 // TabStripModel takes ownership of preview_contents. | 3393 // TabStripModel takes ownership of preview_contents. |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4159 return false; | 4159 return false; |
| 4160 } | 4160 } |
| 4161 | 4161 |
| 4162 void Browser::CreateInstantIfNecessary() { | 4162 void Browser::CreateInstantIfNecessary() { |
| 4163 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && | 4163 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && |
| 4164 !profile()->IsOffTheRecord()) { | 4164 !profile()->IsOffTheRecord()) { |
| 4165 instant_.reset(new InstantController(profile_, this)); | 4165 instant_.reset(new InstantController(profile_, this)); |
| 4166 instant_unload_handler_.reset(new InstantUnloadHandler(this)); | 4166 instant_unload_handler_.reset(new InstantUnloadHandler(this)); |
| 4167 } | 4167 } |
| 4168 } | 4168 } |
| OLD | NEW |