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 3358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3369 void Browser::PrepareForInstant() { | 3369 void Browser::PrepareForInstant() { |
3370 window_->PrepareForInstant(); | 3370 window_->PrepareForInstant(); |
3371 } | 3371 } |
3372 | 3372 |
3373 void Browser::ShowInstant(TabContentsWrapper* preview_contents) { | 3373 void Browser::ShowInstant(TabContentsWrapper* preview_contents) { |
3374 DCHECK(instant_->tab_contents() == GetSelectedTabContentsWrapper()); | 3374 DCHECK(instant_->tab_contents() == GetSelectedTabContentsWrapper()); |
3375 window_->ShowInstant(preview_contents->tab_contents()); | 3375 window_->ShowInstant(preview_contents->tab_contents()); |
3376 } | 3376 } |
3377 | 3377 |
3378 void Browser::HideInstant() { | 3378 void Browser::HideInstant() { |
3379 window_->HideInstant(); | 3379 window_->HideInstant(instant_->is_active()); |
3380 } | 3380 } |
3381 | 3381 |
3382 void Browser::CommitInstant(TabContentsWrapper* preview_contents) { | 3382 void Browser::CommitInstant(TabContentsWrapper* preview_contents) { |
3383 TabContentsWrapper* tab_contents = instant_->tab_contents(); | 3383 TabContentsWrapper* tab_contents = instant_->tab_contents(); |
3384 int index = | 3384 int index = |
3385 tab_handler_->GetTabStripModel()->GetIndexOfTabContents(tab_contents); | 3385 tab_handler_->GetTabStripModel()->GetIndexOfTabContents(tab_contents); |
3386 DCHECK_NE(TabStripModel::kNoTab, index); | 3386 DCHECK_NE(TabStripModel::kNoTab, index); |
3387 preview_contents->controller().CopyStateFromAndPrune( | 3387 preview_contents->controller().CopyStateFromAndPrune( |
3388 &tab_contents->controller()); | 3388 &tab_contents->controller()); |
3389 // TabStripModel takes ownership of preview_contents. | 3389 // TabStripModel takes ownership of preview_contents. |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4154 return false; | 4154 return false; |
4155 } | 4155 } |
4156 | 4156 |
4157 void Browser::CreateInstantIfNecessary() { | 4157 void Browser::CreateInstantIfNecessary() { |
4158 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && | 4158 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && |
4159 !profile()->IsOffTheRecord()) { | 4159 !profile()->IsOffTheRecord()) { |
4160 instant_.reset(new InstantController(profile_, this)); | 4160 instant_.reset(new InstantController(profile_, this)); |
4161 instant_unload_handler_.reset(new InstantUnloadHandler(this)); | 4161 instant_unload_handler_.reset(new InstantUnloadHandler(this)); |
4162 } | 4162 } |
4163 } | 4163 } |
OLD | NEW |