Chromium Code Reviews| 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 2608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2619 // switch back to this tab. | 2619 // switch back to this tab. |
| 2620 window_->GetLocationBar()->SaveStateToContents(contents->tab_contents()); | 2620 window_->GetLocationBar()->SaveStateToContents(contents->tab_contents()); |
| 2621 } | 2621 } |
| 2622 | 2622 |
| 2623 void Browser::TabSelectedAt(TabContentsWrapper* old_contents, | 2623 void Browser::TabSelectedAt(TabContentsWrapper* old_contents, |
| 2624 TabContentsWrapper* new_contents, | 2624 TabContentsWrapper* new_contents, |
| 2625 int index, | 2625 int index, |
| 2626 bool user_gesture) { | 2626 bool user_gesture) { |
| 2627 DCHECK(old_contents != new_contents); | 2627 DCHECK(old_contents != new_contents); |
| 2628 | 2628 |
| 2629 #if defined(OS_CHROMEOS) | |
|
brettw
2011/01/12 07:22:58
This kind of thing in browser.cc gives Ben hives a
Ben Goodger (Google)
2011/01/12 15:34:11
There are a couple of approaches here I can think
| |
| 2630 // On ChromeOS, we want to automatically reload tabs that are killed | |
| 2631 // when the user selects them. | |
| 2632 if (user_gesture && | |
| 2633 new_contents->tab_contents()->crashed_status() == | |
| 2634 base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { | |
| 2635 Reload(CURRENT_TAB); | |
| 2636 return; | |
| 2637 } | |
| 2638 #endif | |
| 2639 | |
| 2629 // If we have any update pending, do it now. | 2640 // If we have any update pending, do it now. |
| 2630 if (!chrome_updater_factory_.empty() && old_contents) | 2641 if (!chrome_updater_factory_.empty() && old_contents) |
| 2631 ProcessPendingUIUpdates(); | 2642 ProcessPendingUIUpdates(); |
| 2632 | 2643 |
| 2633 // Propagate the profile to the location bar. | 2644 // Propagate the profile to the location bar. |
| 2634 UpdateToolbar(true); | 2645 UpdateToolbar(true); |
| 2635 | 2646 |
| 2636 // Update reload/stop state. | 2647 // Update reload/stop state. |
| 2637 UpdateReloadStopState(new_contents->tab_contents()->is_loading(), true); | 2648 UpdateReloadStopState(new_contents->tab_contents()->is_loading(), true); |
| 2638 | 2649 |
| (...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4235 // The page transition below is only for the purpose of inserting the tab. | 4246 // The page transition below is only for the purpose of inserting the tab. |
| 4236 browser->AddTab(view_source_contents, PageTransition::LINK); | 4247 browser->AddTab(view_source_contents, PageTransition::LINK); |
| 4237 } | 4248 } |
| 4238 | 4249 |
| 4239 if (profile_->HasSessionService()) { | 4250 if (profile_->HasSessionService()) { |
| 4240 SessionService* session_service = profile_->GetSessionService(); | 4251 SessionService* session_service = profile_->GetSessionService(); |
| 4241 if (session_service) | 4252 if (session_service) |
| 4242 session_service->TabRestored(&view_source_contents->controller(), false); | 4253 session_service->TabRestored(&view_source_contents->controller(), false); |
| 4243 } | 4254 } |
| 4244 } | 4255 } |
| OLD | NEW |