Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(734)

Unified Diff: blimp/engine/feature/engine_settings_feature.h

Issue 1810213009: blimp: Add settings to allow the client to download the whole page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@record_full_document
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/engine/feature/engine_settings_feature.h
diff --git a/blimp/engine/feature/engine_settings_feature.h b/blimp/engine/feature/engine_settings_feature.h
new file mode 100644
index 0000000000000000000000000000000000000000..6dec59ab1093af0492e34b8a1a198c4d65670c3b
--- /dev/null
+++ b/blimp/engine/feature/engine_settings_feature.h
@@ -0,0 +1,64 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
haibinlu 2016/03/21 18:25:22 2016
Khushal 2016/03/22 04:11:43 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BLIMP_ENGINE_FEATURE_ENGINE_SETTINGS_FEATURE_H_
+#define BLIMP_ENGINE_FEATURE_ENGINE_SETTINGS_FEATURE_H_
+
+#include "base/macros.h"
+#include "base/observer_list.h"
+#include "blimp/net/blimp_message_processor.h"
+#include "content/public/browser/render_view_host.h"
+
+namespace blimp {
+class EngineSettingsMessage;
+
+// The feature is used to send and receive global settings from the client.
+class EngineSettingsFeature : public BlimpMessageProcessor {
+ public:
+ // An observer interested in knowing when the engine settings have changed.
+ class Observer {
+ public:
+ // Called when the WebPreferences set from the client have changed.
haibinlu 2016/03/21 18:25:22 can you list a few web preferences in the method d
Khushal 2016/03/22 04:11:43 Done.
+ virtual void OnWebPreferencesChanged() {}
+ };
+
+ EngineSettingsFeature();
+ ~EngineSettingsFeature() override;
+
+ // Set the BlimpMessageProcessor that will be used to send
+ // BlimpMessage::SETTINGS messages to the client.
+ void set_outgoing_message_processor(
haibinlu 2016/03/21 18:25:22 remove? since Engine does not send settings to Cli
Khushal 2016/03/22 04:11:43 Done.
+ scoped_ptr<BlimpMessageProcessor> processor);
+
+ void AddObserver(Observer* observer);
+ void RemoveObserver(Observer* observer);
+
+ // Called to update the WebPreferences for the RenderViewHost.
haibinlu 2016/03/21 18:25:23 this method goes to SettingsManager if we go with
Khushal 2016/03/22 04:11:43 Done.
+ void UpdateWebkitPreferences(
+ content::RenderViewHost* render_view_host);
+
+ private:
+ // BlimpMessageProcessor implementation.
+ void ProcessMessage(scoped_ptr<BlimpMessage> message,
+ const net::CompletionCallback& callback) override;
+
+ void ProcessWebPreferences(const EngineSettingsMessage& settings);
+
+ // Used to send BlimpMessage::TAB_CONTROL messages to the engine.
haibinlu 2016/03/21 18:25:23 Settings message
+ scoped_ptr<BlimpMessageProcessor> outgoing_message_processor_;
+
+ // Used to cache settings received from the engine to avoid unnecessarily
+ // notifying the observers.
+
+ // -------WebPreferences-------
+ bool record_whole_document_;
+
+ base::ObserverList<Observer> observer_list_;
+
+ DISALLOW_COPY_AND_ASSIGN(EngineSettingsFeature);
+};
+
+} // namespace blimp
+
+#endif // BLIMP_ENGINE_FEATURE_ENGINE_SETTINGS_FEATURE_H_

Powered by Google App Engine
This is Rietveld 408576698