Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: chrome/browser/dom_ui/foreign_session_handler.cc

Issue 4158009: Session sync integration tests. Left out many client for now, since even... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sessions/session_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sessions/session_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698