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

Unified Diff: chrome/browser/ui/webui/ntp/foreign_session_handler.h

Issue 11009013: NTP5: Starting implementation of a native menu for showing other device sessions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
Index: chrome/browser/ui/webui/ntp/foreign_session_handler.h
diff --git a/chrome/browser/ui/webui/ntp/foreign_session_handler.h b/chrome/browser/ui/webui/ntp/foreign_session_handler.h
index 7d540639c253b40304f8552d9ccc67b86f708906..b7df92ef70cbf4b7653a2d5ce82e60fadf4237b7 100644
--- a/chrome/browser/ui/webui/ntp/foreign_session_handler.h
+++ b/chrome/browser/ui/webui/ntp/foreign_session_handler.h
@@ -12,6 +12,7 @@
#include "chrome/browser/sync/glue/session_model_associator.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_message_handler.h"
namespace browser_sync {
@@ -19,6 +20,9 @@ namespace browser_sync {
class ForeignSessionHandler : public content::WebUIMessageHandler,
public content::NotificationObserver {
public:
+ // Invalid value, used to note that we don't have a tab or window number.
+ static const int kInvalidId = -1;
+
// WebUIMessageHandler implementation.
virtual void RegisterMessages() OVERRIDE;
@@ -27,6 +31,19 @@ class ForeignSessionHandler : public content::WebUIMessageHandler,
static void RegisterUserPrefs(PrefService* prefs);
+ static void OpenForeignSession(content::WebUI* web_ui,
+ const std::string& session_string_value,
+ SessionID::id_type window_num,
+ SessionID::id_type tab_id,
+ const WindowOpenDisposition& disposition);
+
+ // Helper method to create JSON compatible objects from Session objects.
+ static bool SessionTabToValue(const SessionTab& tab,
+ DictionaryValue* dictionary);
+
+ // Returns a pointer to the current session model associator or NULL.
+ static SessionModelAssociator* GetModelAssociator(content::WebUI* web_ui);
+
private:
// Used to register ForeignSessionHandler for notifications.
void Init();
@@ -36,9 +53,6 @@ class ForeignSessionHandler : public content::WebUIMessageHandler,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- // Returns a pointer to the current session model associator or NULL.
- SessionModelAssociator* GetModelAssociator();
-
// Returns true if tab sync is enabled for this profile, otherwise false.
bool IsTabSyncEnabled();
@@ -57,8 +71,12 @@ class ForeignSessionHandler : public content::WebUIMessageHandler,
void HandleSetForeignSessionCollapsed(const ListValue* args);
- // Helper methods to create JSON compatible objects from Session objects.
- bool SessionTabToValue(const SessionTab& tab, DictionaryValue* dictionary);
+ // Show a menu containing the most recent device session.
+ // TODO(jeremycho): Do not submit. Just for testing. Use
+ // http://codereview.chromium.org/11003002/ once it's submitted.
+ void HandleShowOtherDevice(const ListValue* args);
+
+ // Helper method to create JSON compatible objects from Session objects.
bool SessionWindowToValue(const SessionWindow& window,
DictionaryValue* dictionary);

Powered by Google App Engine
This is Rietveld 408576698