| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/sessions/session_service_commands.h" | 5 #include "components/sessions/session_service_commands.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
| 10 #include "components/sessions/base_session_service_commands.h" | 10 #include "components/sessions/base_session_service_commands.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 PERSISTED_SHOW_STATE_FULLSCREEN = 5, | 100 PERSISTED_SHOW_STATE_FULLSCREEN = 5, |
| 101 PERSISTED_SHOW_STATE_DETACHED_DEPRECATED = 6, | 101 PERSISTED_SHOW_STATE_DETACHED_DEPRECATED = 6, |
| 102 PERSISTED_SHOW_STATE_END = 6 | 102 PERSISTED_SHOW_STATE_END = 6 |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 typedef std::map<SessionID::id_type, SessionTab*> IdToSessionTab; | 105 typedef std::map<SessionID::id_type, SessionTab*> IdToSessionTab; |
| 106 typedef std::map<SessionID::id_type, SessionWindow*> IdToSessionWindow; | 106 typedef std::map<SessionID::id_type, SessionWindow*> IdToSessionWindow; |
| 107 | 107 |
| 108 // Assert to ensure PersistedWindowShowState is updated if ui::WindowShowState | 108 // Assert to ensure PersistedWindowShowState is updated if ui::WindowShowState |
| 109 // is changed. | 109 // is changed. |
| 110 COMPILE_ASSERT(ui::SHOW_STATE_END == | 110 static_assert(ui::SHOW_STATE_END == |
| 111 static_cast<ui::WindowShowState>(PERSISTED_SHOW_STATE_END), | 111 static_cast<ui::WindowShowState>(PERSISTED_SHOW_STATE_END), |
| 112 persisted_show_state_mismatch); | 112 "SHOW_STATE_END must equal PERSISTED_SHOW_STATE_END"); |
| 113 | 113 |
| 114 // Returns the show state to store to disk based |state|. | 114 // Returns the show state to store to disk based |state|. |
| 115 PersistedWindowShowState ShowStateToPersistedShowState( | 115 PersistedWindowShowState ShowStateToPersistedShowState( |
| 116 ui::WindowShowState state) { | 116 ui::WindowShowState state) { |
| 117 switch (state) { | 117 switch (state) { |
| 118 case ui::SHOW_STATE_NORMAL: | 118 case ui::SHOW_STATE_NORMAL: |
| 119 return PERSISTED_SHOW_STATE_NORMAL; | 119 return PERSISTED_SHOW_STATE_NORMAL; |
| 120 case ui::SHOW_STATE_MINIMIZED: | 120 case ui::SHOW_STATE_MINIMIZED: |
| 121 return PERSISTED_SHOW_STATE_MINIMIZED; | 121 return PERSISTED_SHOW_STATE_MINIMIZED; |
| 122 case ui::SHOW_STATE_MAXIMIZED: | 122 case ui::SHOW_STATE_MAXIMIZED: |
| (...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 AddTabsToWindows(&tabs, &windows); | 828 AddTabsToWindows(&tabs, &windows); |
| 829 SortTabsBasedOnVisualOrderAndPrune(&windows, valid_windows); | 829 SortTabsBasedOnVisualOrderAndPrune(&windows, valid_windows); |
| 830 UpdateSelectedTabIndex(valid_windows); | 830 UpdateSelectedTabIndex(valid_windows); |
| 831 } | 831 } |
| 832 STLDeleteValues(&tabs); | 832 STLDeleteValues(&tabs); |
| 833 // Don't delete contents of windows, that is done by the caller as all | 833 // Don't delete contents of windows, that is done by the caller as all |
| 834 // valid windows are added to valid_windows. | 834 // valid windows are added to valid_windows. |
| 835 } | 835 } |
| 836 | 836 |
| 837 } // namespace sessions | 837 } // namespace sessions |
| OLD | NEW |