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

Unified Diff: chrome/browser/sync/glue/synced_session.h

Issue 10695192: Add DeviceTypeAsString to SyncedSession. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated comment to match real usage. Created 8 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/foreign_session_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/synced_session.h
diff --git a/chrome/browser/sync/glue/synced_session.h b/chrome/browser/sync/glue/synced_session.h
index 60927c454305b6c3e6bd44e7e6aa99e492a8005d..e7aada601c5deaed8a62b72f1eaae7723d230ab3 100644
--- a/chrome/browser/sync/glue/synced_session.h
+++ b/chrome/browser/sync/glue/synced_session.h
@@ -93,6 +93,30 @@ struct SyncedSession {
// itself and free'd on destruction.
SyncedWindowMap windows;
+ // Converts the DeviceType enum value to a string. This is used
+ // in the NTP handler for foreign sessions for matching session
+ // types to an icon style.
+ std::string DeviceTypeAsString() const {
+ switch (device_type) {
+ case SyncedSession::TYPE_WIN:
+ return "win";
+ case SyncedSession::TYPE_MACOSX:
+ return "macosx";
+ case SyncedSession::TYPE_LINUX:
+ return "linux";
+ case SyncedSession::TYPE_CHROMEOS:
+ return "chromeos";
+ case SyncedSession::TYPE_OTHER:
+ return "other";
+ case SyncedSession::TYPE_PHONE:
+ return "phone";
+ case SyncedSession::TYPE_TABLET:
+ return "tablet";
+ default:
+ return "";
+ }
+ }
+
private:
DISALLOW_COPY_AND_ASSIGN(SyncedSession);
};
« no previous file with comments | « no previous file | chrome/browser/ui/webui/ntp/foreign_session_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698