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/dom_ui/foreign_session_handler.h" | 5 #include "chrome/browser/dom_ui/foreign_session_handler.h" |
6 | 6 |
7 #include "base/scoped_vector.h" | 7 #include "base/scoped_vector.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
10 #include "chrome/browser/dom_ui/value_helper.h" | 10 #include "chrome/browser/dom_ui/value_helper.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 if (entry->type == TabRestoreService::WINDOW && | 135 if (entry->type == TabRestoreService::WINDOW && |
136 ValueHelper::WindowToValue( | 136 ValueHelper::WindowToValue( |
137 *static_cast<TabRestoreService::Window*>(entry), | 137 *static_cast<TabRestoreService::Window*>(entry), |
138 window_data.get())) { | 138 window_data.get())) { |
139 // The javascript checks if the session id is a valid session id, | 139 // The javascript checks if the session id is a valid session id, |
140 // when rendering session information to the new tab page, and it | 140 // when rendering session information to the new tab page, and it |
141 // sends the sessionTag back when we need to restore a session. | 141 // sends the sessionTag back when we need to restore a session. |
142 | 142 |
143 // TODO(zea): sessionTag is per client, it might be better per window. | 143 // TODO(zea): sessionTag is per client, it might be better per window. |
144 window_data->SetString("sessionTag", | 144 window_data->SetString("sessionTag", |
145 foreign_session->foreign_tession_tag); | 145 foreign_session->foreign_session_tag); |
146 window_data->SetInteger("sessionId", entry->id); | 146 window_data->SetInteger("sessionId", entry->id); |
147 | 147 |
148 // Give ownership to |list_value|. | 148 // Give ownership to |list_value|. |
149 window_list->Append(window_data.release()); | 149 window_list->Append(window_data.release()); |
150 } | 150 } |
151 } | 151 } |
152 added_count++; | 152 added_count++; |
153 | 153 |
154 // Give ownership to |client_list| | 154 // Give ownership to |client_list| |
155 client_list.Append(window_list.release()); | 155 client_list.Append(window_list.release()); |
156 } | 156 } |
157 dom_ui_->CallJavascriptFunction(L"foreignSessions", client_list); | 157 dom_ui_->CallJavascriptFunction(L"foreignSessions", client_list); |
158 } | 158 } |
159 | 159 |
160 } // namespace browser_sync | 160 } // namespace browser_sync |
OLD | NEW |