| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sessions/session_service.h" | 5 #include "chrome/browser/sessions/session_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1580 } | 1580 } |
| 1581 | 1581 |
| 1582 bool SessionService::should_track_changes_for_browser_type(Browser::Type type, | 1582 bool SessionService::should_track_changes_for_browser_type(Browser::Type type, |
| 1583 AppType app_type) { | 1583 AppType app_type) { |
| 1584 #if defined(OS_CHROMEOS) | 1584 #if defined(OS_CHROMEOS) |
| 1585 // Restore app popups for chromeos alone. | 1585 // Restore app popups for chromeos alone. |
| 1586 if (type == Browser::TYPE_POPUP && app_type == TYPE_APP) | 1586 if (type == Browser::TYPE_POPUP && app_type == TYPE_APP) |
| 1587 return true; | 1587 return true; |
| 1588 #endif | 1588 #endif |
| 1589 | 1589 |
| 1590 return type == Browser::TYPE_TABBED || | 1590 return type == Browser::TYPE_TABBED; |
| 1591 (type == Browser::TYPE_POPUP && browser_defaults::kRestorePopups); | |
| 1592 } | 1591 } |
| 1593 | 1592 |
| 1594 SessionService::WindowType SessionService::WindowTypeForBrowserType( | 1593 SessionService::WindowType SessionService::WindowTypeForBrowserType( |
| 1595 Browser::Type type) { | 1594 Browser::Type type) { |
| 1596 switch (type) { | 1595 switch (type) { |
| 1597 case Browser::TYPE_POPUP: | 1596 case Browser::TYPE_POPUP: |
| 1598 return TYPE_POPUP; | 1597 return TYPE_POPUP; |
| 1599 case Browser::TYPE_TABBED: | 1598 case Browser::TYPE_TABBED: |
| 1600 return TYPE_TABBED; | 1599 return TYPE_TABBED; |
| 1601 default: | 1600 default: |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1805 return; | 1804 return; |
| 1806 } | 1805 } |
| 1807 | 1806 |
| 1808 // Check for any open windows for the current profile that we aren't tracking. | 1807 // Check for any open windows for the current profile that we aren't tracking. |
| 1809 for (chrome::BrowserIterator it; !it.done(); it.Next()) { | 1808 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
| 1810 if ((*it)->profile() == profile()) | 1809 if ((*it)->profile() == profile()) |
| 1811 return; | 1810 return; |
| 1812 } | 1811 } |
| 1813 DeleteSessionOnlyData(profile()); | 1812 DeleteSessionOnlyData(profile()); |
| 1814 } | 1813 } |
| OLD | NEW |