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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 bool pinned_state; | 132 bool pinned_state; |
133 }; | 133 }; |
134 | 134 |
135 // Returns the show state to store to disk based |state|. | 135 // Returns the show state to store to disk based |state|. |
136 ui::WindowShowState AdjustShowState(ui::WindowShowState state) { | 136 ui::WindowShowState AdjustShowState(ui::WindowShowState state) { |
137 switch (state) { | 137 switch (state) { |
138 case ui::SHOW_STATE_NORMAL: | 138 case ui::SHOW_STATE_NORMAL: |
139 case ui::SHOW_STATE_MINIMIZED: | 139 case ui::SHOW_STATE_MINIMIZED: |
140 case ui::SHOW_STATE_MAXIMIZED: | 140 case ui::SHOW_STATE_MAXIMIZED: |
141 case ui::SHOW_STATE_FULLSCREEN: | 141 case ui::SHOW_STATE_FULLSCREEN: |
| 142 case ui::SHOW_STATE_DETACHED: |
142 return state; | 143 return state; |
143 | 144 |
144 case ui::SHOW_STATE_DEFAULT: | 145 case ui::SHOW_STATE_DEFAULT: |
145 case ui::SHOW_STATE_INACTIVE: | 146 case ui::SHOW_STATE_INACTIVE: |
146 case ui::SHOW_STATE_END: | 147 case ui::SHOW_STATE_END: |
147 return ui::SHOW_STATE_NORMAL; | 148 return ui::SHOW_STATE_NORMAL; |
148 } | 149 } |
149 return ui::SHOW_STATE_NORMAL; | 150 return ui::SHOW_STATE_NORMAL; |
150 } | 151 } |
151 | 152 |
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1759 contents->GetController().GetDefaultSessionStorageNamespace(); | 1760 contents->GetController().GetDefaultSessionStorageNamespace(); |
1760 session_storage_namespace->SetShouldPersist(false); | 1761 session_storage_namespace->SetShouldPersist(false); |
1761 SessionTabHelper* session_tab_helper = | 1762 SessionTabHelper* session_tab_helper = |
1762 SessionTabHelper::FromWebContents(contents); | 1763 SessionTabHelper::FromWebContents(contents); |
1763 TabClosed(session_tab_helper->window_id(), | 1764 TabClosed(session_tab_helper->window_id(), |
1764 session_tab_helper->session_id(), | 1765 session_tab_helper->session_id(), |
1765 contents->GetClosedByUserGesture()); | 1766 contents->GetClosedByUserGesture()); |
1766 RecordSessionUpdateHistogramData(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 1767 RecordSessionUpdateHistogramData(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
1767 &last_updated_tab_closed_time_); | 1768 &last_updated_tab_closed_time_); |
1768 } | 1769 } |
OLD | NEW |