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

Unified Diff: chrome/browser/ui/webui/options2/chromeos/core_chromeos_options_handler.h

Issue 8895023: Options2: Pull the trigger. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DIAF. Created 9 years 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: chrome/browser/ui/webui/options2/chromeos/core_chromeos_options_handler.h
diff --git a/chrome/browser/ui/webui/options2/chromeos/core_chromeos_options_handler.h b/chrome/browser/ui/webui/options2/chromeos/core_chromeos_options_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..48aa029029885a2899b8f55df53a8ff6050afce8
--- /dev/null
+++ b/chrome/browser/ui/webui/options2/chromeos/core_chromeos_options_handler.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_CORE_CHROMEOS_OPTIONS_HANDLER_H_
+#define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_CORE_CHROMEOS_OPTIONS_HANDLER_H_
+#pragma once
+
+#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/ui/webui/options2/core_options_handler.h"
+
+class PrefSetObserver;
+
+namespace chromeos {
+
+// CoreChromeOSOptionsHandler handles ChromeOS settings.
+class CoreChromeOSOptionsHandler : public CoreOptionsHandler {
+ public:
+ CoreChromeOSOptionsHandler();
+ virtual ~CoreChromeOSOptionsHandler();
+
+ protected:
+ // ::CoreOptionsHandler overrides
+ virtual void Initialize() OVERRIDE;
+ virtual base::Value* FetchPref(const std::string& pref_name) OVERRIDE;
+ virtual void ObservePref(const std::string& pref_name) OVERRIDE;
+ virtual void SetPref(const std::string& pref_name,
+ const base::Value* value,
+ const std::string& metric) OVERRIDE;
+ virtual void StopObservingPref(const std::string& path) OVERRIDE;
+
+ // content::NotificationObserver implementation.
+ virtual void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) OVERRIDE;
+
+ private:
+ // Notifies registered JS callbacks on ChromeOS setting change.
+ void NotifySettingsChanged(const std::string* setting_name);
+ void NotifyProxyPrefsChanged();
+
+ // Keeps the track of change caused by the handler to make sure
+ // it does not signal itself again.
+ bool handling_change_;
+
+ scoped_ptr<PrefSetObserver> proxy_prefs_;
+ base::WeakPtrFactory<CoreChromeOSOptionsHandler> pointer_factory_;
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_CORE_CHROMEOS_OPTIONS_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698