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

Unified Diff: components/enhanced_bookmarks/enhanced_bookmark_utils.cc

Issue 1143153010: [Android] Add enhanced bookmarks grid/list view experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: indent fix Created 5 years, 7 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: components/enhanced_bookmarks/enhanced_bookmark_utils.cc
diff --git a/components/enhanced_bookmarks/enhanced_bookmark_utils.cc b/components/enhanced_bookmarks/enhanced_bookmark_utils.cc
index 1ca96cadea4b7a8319649919413b1db0526f8a6e..77adfe91e65fa7c6779617e6761936ea6efaea67 100644
--- a/components/enhanced_bookmarks/enhanced_bookmark_utils.cc
+++ b/components/enhanced_bookmarks/enhanced_bookmark_utils.cc
@@ -5,12 +5,15 @@
#include "components/enhanced_bookmarks/enhanced_bookmark_utils.h"
#include "components/bookmarks/browser/bookmark_model.h"
+#include "components/variations/variations_associated_data.h"
using bookmarks::BookmarkModel;
using bookmarks::BookmarkNode;
namespace enhanced_bookmarks {
+const char kFieldTrialName[] = "EnhancedBookmarks";
+
std::vector<const BookmarkNode*> PrimaryPermanentNodes(BookmarkModel* model) {
DCHECK(model->loaded());
std::vector<const BookmarkNode*> nodes;
@@ -63,4 +66,16 @@ const BookmarkNode* RootLevelFolderForNode(const BookmarkNode* node,
return top;
}
+ViewMode GetDefaultViewMode() {
+ std::string default_view_mode = variations::GetVariationParamValue(
+ enhanced_bookmarks::kFieldTrialName, "DefaultViewMode");
+
+ if (default_view_mode == "List") return ViewMode::LIST;
+
+ // Below line was ommitted because the default is ViewMode::GRID anyways.
+ // if (default_view_mode == "Grid") return ViewMode::GRID;
Theresa 2015/05/28 20:13:08 If we change the default to list (or something els
Kibeom Kim (inactive) 2015/05/29 00:11:04 Sorry. The comment and the structure was confusing
+
+ return ViewMode::GRID;
+}
+
} // namespace enhanced_bookmarks

Powered by Google App Engine
This is Rietveld 408576698