Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_POLICY_CONTROLLER_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_POLICY_CONTROLLER_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_POLICY_CONTROLLER_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_POLICY_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 // currently only available on NTP. | 49 // currently only available on NTP. |
| 50 bool IsShownAsRecentlyVisitedSite(const std::string& name_space) const; | 50 bool IsShownAsRecentlyVisitedSite(const std::string& name_space) const; |
| 51 const std::vector<std::string>& GetNamespacesShownAsRecentlyVisitedSite() | 51 const std::vector<std::string>& GetNamespacesShownAsRecentlyVisitedSite() |
| 52 const; | 52 const; |
| 53 | 53 |
| 54 // Returns whether pages for |name_space| should never be shown outside the | 54 // Returns whether pages for |name_space| should never be shown outside the |
| 55 // tab they were generated in. | 55 // tab they were generated in. |
| 56 bool IsRestrictedToOriginalTab(const std::string& name_space) const; | 56 bool IsRestrictedToOriginalTab(const std::string& name_space) const; |
| 57 const std::vector<std::string>& GetNamespacesRestrictedToOriginalTab() const; | 57 const std::vector<std::string>& GetNamespacesRestrictedToOriginalTab() const; |
| 58 | 58 |
| 59 // Returns whether to remove popup overlay that obstructs viewing normal | |
| 60 // content. | |
| 61 bool ShouldRemovePopupOverlay(const std::string& name_space) const; | |
|
fgorski
2017/01/19 17:59:08
I've just discussed this with Dmitry. 2 comments:
jianli
2017/01/19 23:56:10
Changed to pass the background save info in SavePa
| |
| 62 | |
| 59 void AddPolicyForTest(const std::string& name_space, | 63 void AddPolicyForTest(const std::string& name_space, |
| 60 const OfflinePageClientPolicyBuilder& builder); | 64 const OfflinePageClientPolicyBuilder& builder); |
| 61 | 65 |
| 62 private: | 66 private: |
| 63 // The map from name_space to a client policy. Will be generated | 67 // The map from name_space to a client policy. Will be generated |
| 64 // as pre-defined values for now. | 68 // as pre-defined values for now. |
| 65 std::map<std::string, OfflinePageClientPolicy> policies_; | 69 std::map<std::string, OfflinePageClientPolicy> policies_; |
| 66 | 70 |
| 67 // Memoizing results. | 71 // Memoizing results. |
| 68 mutable std::unique_ptr<std::vector<std::string>> download_namespace_cache_; | 72 mutable std::unique_ptr<std::vector<std::string>> download_namespace_cache_; |
| 69 mutable std::unique_ptr<std::vector<std::string>> recent_tab_namespace_cache_; | 73 mutable std::unique_ptr<std::vector<std::string>> recent_tab_namespace_cache_; |
| 70 mutable std::unique_ptr<std::vector<std::string>> show_in_original_tab_cache_; | 74 mutable std::unique_ptr<std::vector<std::string>> show_in_original_tab_cache_; |
| 71 | 75 |
| 72 DISALLOW_COPY_AND_ASSIGN(ClientPolicyController); | 76 DISALLOW_COPY_AND_ASSIGN(ClientPolicyController); |
| 73 }; | 77 }; |
| 74 | 78 |
| 75 } // namespace offline_pages | 79 } // namespace offline_pages |
| 76 | 80 |
| 77 #endif // COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_POLICY_CONTROLLER_H_ | 81 #endif // COMPONENTS_OFFLINE_PAGES_CORE_CLIENT_POLICY_CONTROLLER_H_ |
| OLD | NEW |