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

Unified Diff: views/examples/example_base.cc

Issue 8555013: views: Move examples/ directory to ui/views/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « views/examples/example_base.h ('k') | views/examples/example_combobox_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/examples/example_base.cc
diff --git a/views/examples/example_base.cc b/views/examples/example_base.cc
deleted file mode 100644
index 7a765bf48e36e44baddc83c09f7b205a07de4a8b..0000000000000000000000000000000000000000
--- a/views/examples/example_base.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// 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.
-
-#include "views/examples/example_base.h"
-
-#include <stdarg.h>
-
-#include "base/compiler_specific.h"
-#include "base/stringprintf.h"
-#include "views/examples/examples_main.h"
-
-namespace {
-
-// Some of GTK based view classes require NativeWidgetGtk in the view
-// parent chain. This class is used to defer the creation of such
-// views until a NativeWidgetGtk is added to the view hierarchy.
-class ContainerView : public views::View {
- public:
- explicit ContainerView(examples::ExampleBase* base)
- : example_view_created_(false),
- example_base_(base) {
- }
-
- private:
- // Overridden from views::View:
- virtual void ViewHierarchyChanged(bool is_add,
- views::View* parent,
- views::View* child) OVERRIDE {
- views::View::ViewHierarchyChanged(is_add, parent, child);
- // We're not using child == this because a Widget may not be
- // availalbe when this is added to the hierarchy.
- if (is_add && GetWidget() && !example_view_created_) {
- example_view_created_ = true;
- example_base_->CreateExampleView(this);
- }
- }
-
- // True if the example view has already been created, or false otherwise.
- bool example_view_created_;
-
- examples::ExampleBase* example_base_;
-
- DISALLOW_COPY_AND_ASSIGN(ContainerView);
-};
-
-} // namespace
-
-namespace examples {
-
-ExampleBase::~ExampleBase() {}
-
-ExampleBase::ExampleBase(ExamplesMain* main, const char* title)
- : main_(main), example_title_(title) {
- container_ = new ContainerView(this);
-}
-
-// Prints a message in the status area, at the bottom of the window.
-void ExampleBase::PrintStatus(const char* format, ...) {
- va_list ap;
- va_start(ap, format);
- std::string msg;
- base::StringAppendV(&msg, format, ap);
- main_->SetStatus(msg);
-}
-
-} // namespace examples
« no previous file with comments | « views/examples/example_base.h ('k') | views/examples/example_combobox_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698