summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/bookmarks/bookmark_model.cc7
-rw-r--r--chrome/browser/bookmarks/bookmark_model.h3
-rw-r--r--chrome/browser/sync/engine/download_updates_command.cc8
-rw-r--r--chrome/browser/sync/glue/bookmark_change_processor.cc3
-rw-r--r--chrome/browser/sync/glue/bookmark_model_associator.cc34
-rw-r--r--chrome/browser/sync/glue/bookmark_model_associator.h4
-rw-r--r--chrome/browser/sync/profile_sync_service_bookmark_unittest.cc2
-rw-r--r--chrome/common/chrome_switches.cc6
-rw-r--r--chrome/common/chrome_switches.h2
-rwxr-xr-xnet/tools/testserver/chromiumsync.py2
10 files changed, 15 insertions, 56 deletions
diff --git a/chrome/browser/bookmarks/bookmark_model.cc b/chrome/browser/bookmarks/bookmark_model.cc
index 2d735bc..b0dfada 100644
--- a/chrome/browser/bookmarks/bookmark_model.cc
+++ b/chrome/browser/bookmarks/bookmark_model.cc
@@ -108,8 +108,6 @@ class MobileNode : public BookmarkNode {
explicit MobileNode(int64 id);
virtual ~MobileNode();
- void set_visible(bool value) { visible_ = value; }
-
// BookmarkNode overrides:
virtual bool IsVisible() const OVERRIDE;
@@ -548,11 +546,6 @@ void BookmarkModel::ClearStore() {
store_ = NULL;
}
-void BookmarkModel::SetMobileFolderVisible(bool value) {
- DCHECK(loaded_);
- static_cast<MobileNode*>(mobile_node_)->set_visible(value);
-}
-
bool BookmarkModel::IsBookmarkedNoLock(const GURL& url) {
BookmarkNode tmp_node(url);
return (nodes_ordered_by_url_set_.find(&tmp_node) !=
diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h
index 1b7eec8..e6d7c8f 100644
--- a/chrome/browser/bookmarks/bookmark_model.h
+++ b/chrome/browser/bookmarks/bookmark_model.h
@@ -329,9 +329,6 @@ class BookmarkModel : public content::NotificationObserver,
return expanded_state_tracker_.get();
}
- // Sets whether the mobile folder is visible. This is set by sync.
- void SetMobileFolderVisible(bool value);
-
private:
friend class BookmarkCodecTest;
friend class BookmarkModelTest;
diff --git a/chrome/browser/sync/engine/download_updates_command.cc b/chrome/browser/sync/engine/download_updates_command.cc
index e712d9e..f0ceb30 100644
--- a/chrome/browser/sync/engine/download_updates_command.cc
+++ b/chrome/browser/sync/engine/download_updates_command.cc
@@ -6,13 +6,11 @@
#include <string>
-#include "base/command_line.h"
#include "chrome/browser/sync/engine/syncer.h"
#include "chrome/browser/sync/engine/syncer_proto_util.h"
#include "chrome/browser/sync/engine/syncproto.h"
#include "chrome/browser/sync/syncable/directory_manager.h"
#include "chrome/browser/sync/syncable/model_type_payload_map.h"
-#include "chrome/common/chrome_switches.h"
using syncable::ScopedDirLookup;
@@ -37,10 +35,8 @@ void DownloadUpdatesCommand::ExecuteImpl(SyncSession* session) {
ClientToServerMessage::GET_UPDATES);
GetUpdatesMessage* get_updates =
client_to_server_message.mutable_get_updates();
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kCreateMobileBookmarksFolder)) {
- get_updates->set_include_syncable_bookmarks(true);
- }
+ // TODO: make this default to true.
+ get_updates->set_include_syncable_bookmarks(true);
ScopedDirLookup dir(session->context()->directory_manager(),
session->context()->account_name());
diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc
index 9518686..a5e619a 100644
--- a/chrome/browser/sync/glue/bookmark_change_processor.cc
+++ b/chrome/browser/sync/glue/bookmark_change_processor.cc
@@ -451,9 +451,6 @@ void BookmarkChangeProcessor::ApplyChangesFromSyncModel(
foster_parent = NULL;
}
- // The visibility of the mobile node may need to change.
- model_associator_->UpdateMobileNodeVisibility();
-
// We are now ready to hear about bookmarks changes again.
model->AddObserver(this);
}
diff --git a/chrome/browser/sync/glue/bookmark_model_associator.cc b/chrome/browser/sync/glue/bookmark_model_associator.cc
index 8d3066a..bbdbff8 100644
--- a/chrome/browser/sync/glue/bookmark_model_associator.cc
+++ b/chrome/browser/sync/glue/bookmark_model_associator.cc
@@ -186,14 +186,6 @@ BookmarkModelAssociator::~BookmarkModelAssociator() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
-void BookmarkModelAssociator::UpdateMobileNodeVisibility() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK(bookmark_model_->IsLoaded());
-
- bookmark_model_->SetMobileFolderVisible(
- id_map_.find(bookmark_model_->mobile_node()->id()) != id_map_.end());
-}
-
bool BookmarkModelAssociator::DisassociateModels(SyncError* error) {
id_map_.clear();
id_map_inverse_.clear();
@@ -236,7 +228,6 @@ void BookmarkModelAssociator::Associate(const BookmarkNode* node,
id_map_inverse_[sync_id] = node;
dirty_associations_sync_ids_.insert(sync_id);
PostPersistAssociationsTask();
- UpdateMobileNodeVisibility();
}
void BookmarkModelAssociator::Disassociate(int64 sync_id) {
@@ -377,15 +368,10 @@ bool BookmarkModelAssociator::BuildAssociations(SyncError* error) {
error->Reset(FROM_HERE, kServerError, model_type());
return false;
}
- if (!AssociateTaggedPermanentNode(bookmark_model_->mobile_node(),
- kMobileBookmarksTag) &&
- // The mobile folder only need exist if kCreateMobileBookmarksFolder is
- // set.
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kCreateMobileBookmarksFolder)) {
- error->Reset(FROM_HERE, kServerError, model_type());
- return false;
- }
+ // The mobile folder isn't always present on the backend, so we don't fail if
+ // it doesn't exist.
+ ignore_result(AssociateTaggedPermanentNode(bookmark_model_->mobile_node(),
+ kMobileBookmarksTag));
int64 bookmark_bar_sync_id = GetSyncIdFromChromeId(
bookmark_model_->bookmark_bar_node()->id());
DCHECK_NE(bookmark_bar_sync_id, sync_api::kInvalidId);
@@ -394,10 +380,6 @@ bool BookmarkModelAssociator::BuildAssociations(SyncError* error) {
DCHECK_NE(other_bookmarks_sync_id, sync_api::kInvalidId);
int64 mobile_bookmarks_sync_id = GetSyncIdFromChromeId(
bookmark_model_->mobile_node()->id());
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kCreateMobileBookmarksFolder)) {
- DCHECK_NE(sync_api::kInvalidId, mobile_bookmarks_sync_id);
- }
std::stack<int64> dfs_stack;
if (mobile_bookmarks_sync_id != sync_api::kInvalidId)
@@ -541,11 +523,9 @@ bool BookmarkModelAssociator::LoadAssociations() {
return false;
}
int64 mobile_bookmarks_id = -1;
- if (!GetSyncIdForTaggedNode(kMobileBookmarksTag, &mobile_bookmarks_id) &&
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kCreateMobileBookmarksFolder)) {
- return false;
- }
+ // Can't fail here as the mobile folder may not exist.
+ ignore_result(
+ GetSyncIdForTaggedNode(kMobileBookmarksTag, &mobile_bookmarks_id));
// Build a bookmark node ID index since we are going to repeatedly search for
// bookmark nodes by their IDs.
diff --git a/chrome/browser/sync/glue/bookmark_model_associator.h b/chrome/browser/sync/glue/bookmark_model_associator.h
index e83b05a..400b98e 100644
--- a/chrome/browser/sync/glue/bookmark_model_associator.h
+++ b/chrome/browser/sync/glue/bookmark_model_associator.h
@@ -40,10 +40,6 @@ class BookmarkModelAssociator
UnrecoverableErrorHandler* unrecoverable_error_handler);
virtual ~BookmarkModelAssociator();
- // Invokes BookmarkModel::SetMobileFolderVisible() based on whether the mobile
- // node exists.
- void UpdateMobileNodeVisibility();
-
// AssociatorInterface implementation.
//
// AssociateModels iterates through both the sync and the browser
diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
index 1b87769..57bdf2f 100644
--- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc
@@ -296,8 +296,6 @@ class ProfileSyncServiceBookmarkTest : public testing::Test {
virtual void SetUp() {
test_user_share_.SetUp();
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kCreateMobileBookmarksFolder);
}
virtual void TearDown() {
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index c595d6c..3928cf0 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -190,9 +190,6 @@ const char kCrashOnHangThreads[] = "crash-on-hang-threads";
// other threads are not responsive.
const char kCrashOnLive[] = "crash-on-live";
-// If true the mobile bookmarks folder is created on the sync side.
-const char kCreateMobileBookmarksFolder[] = "create-mobile-bookmarks-folder";
-
// Path to the inspector files on disk (allows reloading of devtool files
// without having to restart the browser).
const char kDebugDevToolsFrontend[] = "debug-devtools-frontend";
@@ -570,6 +567,9 @@ const char kEnableSyncTabsForOtherClients[] =
// Enables context menu for selecting groups of tabs.
const char kEnableTabGroupsContextMenu[] = "enable-tab-groups-context-menu";
+// Enables the "synced bookmarks" folder.
+const char kEnableSyncedBookmarksFolder[] = "enable-synced-bookmarks-folder";
+
// Spawns threads to watch for excessive delays in specified message loops.
// User should set breakpoints on Alarm() to examine problematic thread.
//
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 1c40904..961be54 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -64,7 +64,6 @@ extern const char kCountry[];
extern const char kCrashOnHangSeconds[];
extern const char kCrashOnHangThreads[];
extern const char kCrashOnLive[];
-extern const char kCreateMobileBookmarksFolder[];
extern const char kDebugDevToolsFrontend[];
extern const char kDebugEnableFrameToggle[];
extern const char kDebugPrint[];
@@ -163,6 +162,7 @@ extern const char kEnableSyncExtensionSettings[];
extern const char kEnableSyncOAuth[];
extern const char kEnableSyncTabs[];
extern const char kEnableSyncTabsForOtherClients[];
+extern const char kEnableSyncedBookmarksFolder[];
extern const char kEnableTabGroupsContextMenu[];
extern const char kEnableTopSites[];
extern const char kEnableWatchdog[];
diff --git a/net/tools/testserver/chromiumsync.py b/net/tools/testserver/chromiumsync.py
index cabbb7d..07497ea 100755
--- a/net/tools/testserver/chromiumsync.py
+++ b/net/tools/testserver/chromiumsync.py
@@ -394,6 +394,8 @@ class SyncDataModel(object):
parent_tag='google_chrome_bookmarks', sync_type=BOOKMARK),
PermanentItem('other_bookmarks', name='Other Bookmarks',
parent_tag='google_chrome_bookmarks', sync_type=BOOKMARK),
+ PermanentItem('synced_bookmarks', name='Mobile Bookmarks',
+ parent_tag='google_chrome_bookmarks', sync_type=BOOKMARK),
PermanentItem('google_chrome_preferences', name='Preferences',
parent_tag='google_chrome', sync_type=PREFERENCE),
PermanentItem('google_chrome_autofill', name='Autofill',