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

Side by Side Diff: chrome/browser/sync/glue/session_model_associator.h

Issue 9664008: Add Phone/Tablet device types for syncing session from Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self-review Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync/glue/session_model_associator.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_
6 #define CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/format_macros.h" 15 #include "base/format_macros.h"
16 #include "base/gtest_prod_util.h" 16 #include "base/gtest_prod_util.h"
17 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
18 #include "base/stringprintf.h" 18 #include "base/stringprintf.h"
19 #include "base/threading/non_thread_safe.h" 19 #include "base/threading/non_thread_safe.h"
20 #include "base/time.h" 20 #include "base/time.h"
21 #include "base/utf_string_conversions.h" 21 #include "base/utf_string_conversions.h"
22 #include "chrome/browser/sessions/session_id.h" 22 #include "chrome/browser/sessions/session_id.h"
23 #include "chrome/browser/sessions/session_service.h" 23 #include "chrome/browser/sessions/session_service.h"
24 #include "chrome/browser/sessions/session_types.h" 24 #include "chrome/browser/sessions/session_types.h"
25 #include "chrome/browser/sync/glue/model_associator.h" 25 #include "chrome/browser/sync/glue/model_associator.h"
26 #include "chrome/browser/sync/glue/synced_session_tracker.h" 26 #include "chrome/browser/sync/glue/synced_session_tracker.h"
27 #include "chrome/browser/sync/glue/synced_tab_delegate.h" 27 #include "chrome/browser/sync/glue/synced_tab_delegate.h"
28 #include "chrome/browser/sync/glue/synced_window_delegate.h" 28 #include "chrome/browser/sync/glue/synced_window_delegate.h"
29 #include "chrome/browser/sync/protocol/session_specifics.pb.h"
29 #include "chrome/browser/sync/syncable/model_type.h" 30 #include "chrome/browser/sync/syncable/model_type.h"
30 31
31 class Profile; 32 class Profile;
32 class ProfileSyncService; 33 class ProfileSyncService;
33 34
34 namespace sync_api { 35 namespace sync_api {
35 class BaseTransaction; 36 class BaseTransaction;
36 class ReadNode; 37 class ReadNode;
37 class WriteTransaction; 38 class WriteTransaction;
38 } // namespace sync_api 39 } // namespace sync_api
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 // Returns true if this tab belongs to this profile and belongs to a window, 421 // Returns true if this tab belongs to this profile and belongs to a window,
421 // false otherwise. 422 // false otherwise.
422 bool IsValidTab(const SyncedTabDelegate& tab) const; 423 bool IsValidTab(const SyncedTabDelegate& tab) const;
423 424
424 // Having a valid entry is defined as the url being valid and and having a 425 // Having a valid entry is defined as the url being valid and and having a
425 // syncable scheme (non chrome:// and file:// url's). In other words, we don't 426 // syncable scheme (non chrome:// and file:// url's). In other words, we don't
426 // want to sync a tab that is nothing but chrome:// and file:// navigations or 427 // want to sync a tab that is nothing but chrome:// and file:// navigations or
427 // invalid url's. 428 // invalid url's.
428 bool TabHasValidEntry(const SyncedTabDelegate& tab) const; 429 bool TabHasValidEntry(const SyncedTabDelegate& tab) const;
429 430
431 // Returns the type of the device hosting this session.
432 sync_pb::SessionHeader::DeviceType GetLocalDeviceType();
Nicolas Zea 2012/03/14 18:27:14 Does this have to be exposed via header? If so, pe
Yaron 2012/03/14 19:01:01 Done.
433
430 // For testing only. 434 // For testing only.
431 void QuitLoopForSubtleTesting(); 435 void QuitLoopForSubtleTesting();
432 436
433 // Unique client tag. 437 // Unique client tag.
434 std::string current_machine_tag_; 438 std::string current_machine_tag_;
435 439
436 // User-visible machine name. 440 // User-visible machine name.
437 std::string current_session_name_; 441 std::string current_session_name_;
438 442
439 // Pool of all used/available sync nodes associated with tabs. 443 // Pool of all used/available sync nodes associated with tabs.
(...skipping 25 matching lines...) Expand all
465 469
466 // Profile being synced. 470 // Profile being synced.
467 const Profile* const profile_; 471 const Profile* const profile_;
468 472
469 DISALLOW_COPY_AND_ASSIGN(SessionModelAssociator); 473 DISALLOW_COPY_AND_ASSIGN(SessionModelAssociator);
470 }; 474 };
471 475
472 } // namespace browser_sync 476 } // namespace browser_sync
473 477
474 #endif // CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_ 478 #endif // CHROME_BROWSER_SYNC_GLUE_SESSION_MODEL_ASSOCIATOR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/glue/session_model_associator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698