| OLD | NEW |
| 1 // This file is generated | 1 // This file is generated |
| 2 | 2 |
| 3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 3 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 4 // Use of this source code is governed by a BSD-style license that can be | 4 // Use of this source code is governed by a BSD-style license that can be |
| 5 // found in the LICENSE file. | 5 // found in the LICENSE file. |
| 6 | 6 |
| 7 #ifndef HEADLESS_PUBLIC_DOMAINS_{{domain.domain | camelcase_to_hacker_style | up
per}}_H_ | 7 #ifndef HEADLESS_PUBLIC_DOMAINS_{{domain.domain | camelcase_to_hacker_style | up
per}}_H_ |
| 8 #define HEADLESS_PUBLIC_DOMAINS_{{domain.domain | camelcase_to_hacker_style | up
per}}_H_ | 8 #define HEADLESS_PUBLIC_DOMAINS_{{domain.domain | camelcase_to_hacker_style | up
per}}_H_ |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 {# Generate event dispatchers. #} | 113 {# Generate event dispatchers. #} |
| 114 {% for event in domain.events %} | 114 {% for event in domain.events %} |
| 115 void Dispatch{{event.name | to_title_case}}Event(const base::Value& params); | 115 void Dispatch{{event.name | to_title_case}}Event(const base::Value& params); |
| 116 {% endfor %} | 116 {% endfor %} |
| 117 | 117 |
| 118 internal::MessageDispatcher* dispatcher_; // Not owned. | 118 internal::MessageDispatcher* dispatcher_; // Not owned. |
| 119 {% if "events" in domain %} | 119 {% if "events" in domain %} |
| 120 base::ObserverList<ExperimentalObserver> observers_; | 120 base::ObserverList<ExperimentalObserver> observers_; |
| 121 {% endif %} | 121 {% endif %} |
| 122 | 122 |
| 123 {% if "events" in domain %} |
| 124 protected: |
| 125 void RegisterEventHandlersIfNeeded(); |
| 126 |
| 127 {% endif %} |
| 123 private: | 128 private: |
| 129 {% if "events" in domain %} |
| 130 bool event_handlers_registered_ = false; |
| 131 |
| 132 {% endif %} |
| 124 DISALLOW_COPY_AND_ASSIGN(Domain); | 133 DISALLOW_COPY_AND_ASSIGN(Domain); |
| 125 }; | 134 }; |
| 126 | 135 |
| 127 class ExperimentalDomain : public Domain { | 136 class ExperimentalDomain : public Domain { |
| 128 public: | 137 public: |
| 129 ExperimentalDomain(internal::MessageDispatcher* dispatcher); | 138 ExperimentalDomain(internal::MessageDispatcher* dispatcher); |
| 130 ~ExperimentalDomain(); | 139 ~ExperimentalDomain(); |
| 131 | 140 |
| 132 {% if "events" in domain %} | 141 {% if "events" in domain %} |
| 133 // Add or remove an observer. |observer| must be removed before being | 142 // Add or remove an observer. |observer| must be removed before being |
| (...skipping 12 matching lines...) Expand all Loading... |
| 146 {% endfor %} | 155 {% endfor %} |
| 147 | 156 |
| 148 private: | 157 private: |
| 149 DISALLOW_COPY_AND_ASSIGN(ExperimentalDomain); | 158 DISALLOW_COPY_AND_ASSIGN(ExperimentalDomain); |
| 150 }; | 159 }; |
| 151 | 160 |
| 152 } // namespace {{domain.domain | camelcase_to_hacker_style}} | 161 } // namespace {{domain.domain | camelcase_to_hacker_style}} |
| 153 } // namespace headless | 162 } // namespace headless |
| 154 | 163 |
| 155 #endif // HEADLESS_PUBLIC_DOMAINS_{{domain.domain | camelcase_to_hacker_style |
upper}}_H_ | 164 #endif // HEADLESS_PUBLIC_DOMAINS_{{domain.domain | camelcase_to_hacker_style |
upper}}_H_ |
| OLD | NEW |