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

Unified Diff: views/examples/double_split_view_example.h

Issue 7846010: Fixed crash when a SinglesplitView gets embdedded inside SingleSplitView (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 3 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: views/examples/double_split_view_example.h
diff --git a/views/examples/double_split_view_example.h b/views/examples/double_split_view_example.h
new file mode 100644
index 0000000000000000000000000000000000000000..a664b0af95601b7839aa5c071b0fa9319e9eb922
--- /dev/null
+++ b/views/examples/double_split_view_example.h
@@ -0,0 +1,51 @@
+// 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 VIEWS_EXAMPLES_DOUBLE_SPLIT_VIEW_EXAMPLE_H_
+#define VIEWS_EXAMPLES_DOUBLE_SPLIT_VIEW_EXAMPLE_H_
+#pragma once
+
+#include "views/controls/single_split_view.h"
+#include "views/examples/example_base.h"
+
+namespace examples {
+
+class DoubleSplitViewExample : public ExampleBase {
+ public:
+ explicit DoubleSplitViewExample(ExamplesMain* main);
+ virtual ~DoubleSplitViewExample();
+
+ // Overridden from ExampleBase:
+ virtual std::wstring GetExampleTitle();
sky 2011/09/08 14:27:11 OVERRIDE on both of these.
Gajen 2011/09/09 13:58:02 Done.
+ virtual void CreateExampleView(views::View* container);
+
+ private:
+ // DoubleSplitViews's content, which draws gradient color on background.
+ class SplittedView : public views::View {
tfarina 2011/09/08 20:39:45 Could you move this class to an unnamed namespace
Gajen 2011/09/09 13:58:02 Done.
+ public:
+ SplittedView();
+ virtual ~SplittedView();
+
+ void SetColor(SkColor from, SkColor to);
+
+ // Overridden from views::View:
+ virtual gfx::Size GetPreferredSize();
sky 2011/09/08 14:27:11 OVERRIDE on all of these.
Gajen 2011/09/09 13:58:02 Done.
+ virtual gfx::Size GetMinimumSize();
+ virtual void Layout();
+
+
sky 2011/09/08 14:27:11 remove this.
Gajen 2011/09/09 13:58:02 Done.
+ private:
+ DISALLOW_COPY_AND_ASSIGN(SplittedView);
+ };
+
+ // The SinleSplitViews to be embedded.
+ views::SingleSplitView* outer_single_split_view_;
+ views::SingleSplitView* inner_single_split_view_;
+
+ DISALLOW_COPY_AND_ASSIGN(DoubleSplitViewExample);
+};
+
+} // namespace examples
+
+#endif // VIEWS_EXAMPLES_DOUBLE_SPLIT_VIEW_EXAMPLE_H_

Powered by Google App Engine
This is Rietveld 408576698