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

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: Use screenX instead of clientX. Created 8 years, 2 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 99adf4efa485b1474fd1ab29e1c51488f3a0b2ec..f8de12678a4bdb0316f147908a5f6893773a6d07 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();
@@ -61,8 +75,7 @@ class ForeignSessionHandler : public content::WebUIMessageHandler,
// This handler was introduced for NTP5.
void HandleShowOtherDeviceSessionPopup(const ListValue* args);
- // Helper methods to create JSON compatible objects from Session objects.
- bool SessionTabToValue(const SessionTab& tab, DictionaryValue* dictionary);
+ // 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