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

Unified Diff: ui/views/devtools_observer.h

Issue 2500623002: Add ViewObserver to View for view updates (Closed)
Patch Set: Ensure single call of OnViewHierarchyChanged Created 4 years, 1 month 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
« no previous file with comments | « ui/views/BUILD.gn ('k') | ui/views/view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/devtools_observer.h
diff --git a/ui/views/devtools_observer.h b/ui/views/devtools_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..20242b887c8e094b3452478521fbed59fa4575cc
--- /dev/null
+++ b/ui/views/devtools_observer.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
sadrul 2016/11/18 19:07:51 No (c)
Sarmad Hashmi 2016/11/19 00:29:51 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_VIEWS_DEVTOOLS_OBSERVER_H_
+#define UI_VIEWS_DEVTOOLS_OBSERVER_H_
+
+#include "ui/views/view.h"
+#include "ui/views/views_export.h"
+
+namespace gfx {
+class Rect;
+}
+
+namespace views {
+
+// DevTools specific observer for View changes.
+class VIEWS_EXPORT DevToolsObserver {
+ public:
+ // Called whenever target |view| is being moved. If |old_parent| is NULL,
+ // the target is being added. If the |new_parent| is NULL, then the target
+ // is being removed.
+ virtual void OnViewHierarchyChanged(View* target,
+ View* old_parent,
+ View* new_parent) {}
+
+ virtual void OnViewVisibilityChanged(View* view, bool visible) {}
+
+ virtual void OnViewEnabledChanged(View* view, int index) {}
+
+ virtual void OnViewBoundsChanged(View* view, const gfx::Rect& new_bounds) {}
+
+ // Invoked whenever a child is moved to another index. This is called on the
+ // parent view. |view| is the child view being reordered to the index.
+ virtual void OnChildViewReordered(View* view, int index) {}
+
+ protected:
+ virtual ~DevToolsObserver() {}
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_DEVTOOLS_OBSERVER_H_
« no previous file with comments | « ui/views/BUILD.gn ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698