Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/offline_pages/offline_page_feature.h" | 5 #include "components/offline_pages/offline_page_feature.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 } | 64 } |
| 65 return FeatureMode::DISABLED; | 65 return FeatureMode::DISABLED; |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool IsOfflinePagesEnabled() { | 68 bool IsOfflinePagesEnabled() { |
| 69 FeatureMode mode = GetOfflinePageFeatureMode(); | 69 FeatureMode mode = GetOfflinePageFeatureMode(); |
| 70 return mode == FeatureMode::ENABLED_AS_BOOKMARKS || | 70 return mode == FeatureMode::ENABLED_AS_BOOKMARKS || |
| 71 mode == FeatureMode::ENABLED_AS_SAVED_PAGES; | 71 mode == FeatureMode::ENABLED_AS_SAVED_PAGES; |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool IsOffliningRecentPagesEnabled() { | |
| 75 bool hasDisableSwitch = base::CommandLine::ForCurrentProcess()->HasSwitch( | |
|
jianli
2016/03/02 00:52:31
nit: C++ style
| |
| 76 switches::kDisableOffliningRecentPages); | |
| 77 bool hasEnableSwitch = base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 78 switches::kEnableOffliningRecentPages); | |
| 79 | |
| 80 // Default is 'disable'. | |
| 81 return !hasDisableSwitch && hasEnableSwitch && IsOfflinePagesEnabled(); | |
| 82 } | |
| 83 | |
| 84 | |
| 74 } // namespace offline_pages | 85 } // namespace offline_pages |
| 75 | 86 |
| 76 #endif | 87 #endif |
| OLD | NEW |