| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef BLIMP_CLIENT_CORE_SETTINGS_SETTINGS_FEATURE_H_ | |
| 6 #define BLIMP_CLIENT_CORE_SETTINGS_SETTINGS_FEATURE_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "blimp/client/core/settings/settings_observer.h" | |
| 10 #include "blimp/net/blimp_message_processor.h" | |
| 11 | |
| 12 namespace blimp { | |
| 13 namespace client { | |
| 14 | |
| 15 class Settings; | |
| 16 | |
| 17 // The feature is used to send global settings to the engine. | |
| 18 class SettingsFeature : public BlimpMessageProcessor, public SettingsObserver { | |
| 19 public: | |
| 20 // Caller ensures |settings| outlives this object. | |
| 21 explicit SettingsFeature(Settings* settings); | |
| 22 ~SettingsFeature() override; | |
| 23 | |
| 24 // Set the BlimpMessageProcessor that will be used to send | |
| 25 // BlimpMessage::SETTINGS messages to the engine. | |
| 26 void set_outgoing_message_processor( | |
| 27 std::unique_ptr<BlimpMessageProcessor> processor); | |
| 28 | |
| 29 // BlimpMessageProcessor implementation. | |
| 30 void ProcessMessage(std::unique_ptr<BlimpMessage> message, | |
| 31 const net::CompletionCallback& callback) override; | |
| 32 | |
| 33 // SettingsObserver implementation. | |
| 34 void OnRecordWholeDocumentChanged(bool enable) override; | |
| 35 | |
| 36 // Send the necessary settings to the engine. | |
| 37 void PushSettings(); | |
| 38 | |
| 39 private: | |
| 40 // Used to send BlimpMessage::TAB_CONTROL messages to the engine. | |
| 41 std::unique_ptr<BlimpMessageProcessor> outgoing_message_processor_; | |
| 42 | |
| 43 Settings* settings_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(SettingsFeature); | |
| 46 }; | |
| 47 | |
| 48 } // namespace client | |
| 49 } // namespace blimp | |
| 50 | |
| 51 #endif // BLIMP_CLIENT_CORE_SETTINGS_SETTINGS_FEATURE_H_ | |
| OLD | NEW |