| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_WEB_RESOURCE_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H_ | 5 #ifndef CHROME_BROWSER_WEB_RESOURCE_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H_ |
| 6 #define CHROME_BROWSER_WEB_RESOURCE_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H_ | 6 #define CHROME_BROWSER_WEB_RESOURCE_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/web_resource/eula_accepted_notifier.h" | 8 #include "chrome/browser/web_resource/eula_accepted_notifier.h" |
| 9 #include "net/base/network_change_notifier.h" | 9 #include "net/base/network_change_notifier.h" |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // Notifies the observer if all criteria needed for resource requests are met. | 74 // Notifies the observer if all criteria needed for resource requests are met. |
| 75 // This is protected so it can be called from subclasses for testing. | 75 // This is protected so it can be called from subclasses for testing. |
| 76 void MaybeNotifyObserver(); | 76 void MaybeNotifyObserver(); |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 // Creates the EulaAcceptNotifier or NULL if one is not needed. Virtual so | 79 // Creates the EulaAcceptNotifier or NULL if one is not needed. Virtual so |
| 80 // that it can be overridden by test subclasses. | 80 // that it can be overridden by test subclasses. |
| 81 virtual EulaAcceptedNotifier* CreateEulaNotifier(); | 81 virtual EulaAcceptedNotifier* CreateEulaNotifier(); |
| 82 | 82 |
| 83 // EulaAcceptedNotifier::Observer overrides: | 83 // EulaAcceptedNotifier::Observer overrides: |
| 84 virtual void OnEulaAccepted() OVERRIDE; | 84 virtual void OnEulaAccepted() override; |
| 85 | 85 |
| 86 // net::NetworkChangeNotifier::ConnectionTypeObserver overrides: | 86 // net::NetworkChangeNotifier::ConnectionTypeObserver overrides: |
| 87 virtual void OnConnectionTypeChanged( | 87 virtual void OnConnectionTypeChanged( |
| 88 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; | 88 net::NetworkChangeNotifier::ConnectionType type) override; |
| 89 | 89 |
| 90 // Tracks whether or not the observer/service depending on this class actually | 90 // Tracks whether or not the observer/service depending on this class actually |
| 91 // requested permission to make a request or not. If it did not, then this | 91 // requested permission to make a request or not. If it did not, then this |
| 92 // class should not notify it even if the criteria is met. | 92 // class should not notify it even if the criteria is met. |
| 93 bool observer_requested_permission_; | 93 bool observer_requested_permission_; |
| 94 | 94 |
| 95 // Tracks network connectivity criteria. | 95 // Tracks network connectivity criteria. |
| 96 bool waiting_for_network_; | 96 bool waiting_for_network_; |
| 97 | 97 |
| 98 // Tracks EULA acceptance criteria. | 98 // Tracks EULA acceptance criteria. |
| 99 bool waiting_for_user_to_accept_eula_; | 99 bool waiting_for_user_to_accept_eula_; |
| 100 | 100 |
| 101 // Platform-specific notifier of EULA acceptance, or NULL if not needed. | 101 // Platform-specific notifier of EULA acceptance, or NULL if not needed. |
| 102 scoped_ptr<EulaAcceptedNotifier> eula_notifier_; | 102 scoped_ptr<EulaAcceptedNotifier> eula_notifier_; |
| 103 | 103 |
| 104 // Observing service interested in request permissions. | 104 // Observing service interested in request permissions. |
| 105 Observer* observer_; | 105 Observer* observer_; |
| 106 | 106 |
| 107 DISALLOW_COPY_AND_ASSIGN(ResourceRequestAllowedNotifier); | 107 DISALLOW_COPY_AND_ASSIGN(ResourceRequestAllowedNotifier); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 #endif // CHROME_BROWSER_WEB_RESOURCE_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H_ | 110 #endif // CHROME_BROWSER_WEB_RESOURCE_RESOURCE_REQUEST_ALLOWED_NOTIFIER_H_ |
| OLD | NEW |