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 |