| 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 CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ |
| 6 #define CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ | 6 #define CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 // This class is responsible for fetching the resources required to check and | 75 // This class is responsible for fetching the resources required to check and |
| 76 // install a site. | 76 // install a site. |
| 77 class InstallableManager | 77 class InstallableManager |
| 78 : public content::WebContentsObserver, | 78 : public content::WebContentsObserver, |
| 79 public content::WebContentsUserData<InstallableManager> { | 79 public content::WebContentsUserData<InstallableManager> { |
| 80 public: | 80 public: |
| 81 explicit InstallableManager(content::WebContents* web_contents); | 81 explicit InstallableManager(content::WebContents* web_contents); |
| 82 ~InstallableManager() override; | 82 ~InstallableManager() override; |
| 83 | 83 |
| 84 // Returns true if the overall security state of |web_contents| is sufficient |
| 85 // to be considered installable. |
| 86 static bool IsContentSecure(content::WebContents* web_contents); |
| 87 |
| 84 // Returns the minimum icon size in pixels for a site to be installable. | 88 // Returns the minimum icon size in pixels for a site to be installable. |
| 85 // TODO(dominickn): consolidate this concept with minimum_icon_size_in_px | 89 // TODO(dominickn): consolidate this concept with minimum_icon_size_in_px |
| 86 // across all platforms. | 90 // across all platforms. |
| 87 static int GetMinimumIconSizeInPx(); | 91 static int GetMinimumIconSizeInPx(); |
| 88 | 92 |
| 89 // Get the installable data, fetching the resources specified in |params|. | 93 // Get the installable data, fetching the resources specified in |params|. |
| 90 // |callback| is invoked synchronously (i.e. no via PostTask on the UI thread | 94 // |callback| is invoked synchronously (i.e. no via PostTask on the UI thread |
| 91 // when the data is ready; the synchronous execution ensures that the | 95 // when the data is ready; the synchronous execution ensures that the |
| 92 // references |callback| receives in its InstallableData argument are valid. | 96 // references |callback| receives in its InstallableData argument are valid. |
| 93 // | 97 // |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 std::map<IconParams, IconProperty> icons_; | 186 std::map<IconParams, IconProperty> icons_; |
| 183 | 187 |
| 184 bool is_active_; | 188 bool is_active_; |
| 185 | 189 |
| 186 base::WeakPtrFactory<InstallableManager> weak_factory_; | 190 base::WeakPtrFactory<InstallableManager> weak_factory_; |
| 187 | 191 |
| 188 DISALLOW_COPY_AND_ASSIGN(InstallableManager); | 192 DISALLOW_COPY_AND_ASSIGN(InstallableManager); |
| 189 }; | 193 }; |
| 190 | 194 |
| 191 #endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ | 195 #endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ |
| OLD | NEW |