summaryrefslogtreecommitdiffstats
path: root/views/examples/link_example.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/examples/link_example.cc')
-rw-r--r--views/examples/link_example.cc34
1 files changed, 34 insertions, 0 deletions
diff --git a/views/examples/link_example.cc b/views/examples/link_example.cc
new file mode 100644
index 0000000..fd08999
--- /dev/null
+++ b/views/examples/link_example.cc
@@ -0,0 +1,34 @@
+// 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/link_example.h"
+
+#include "views/layout/fill_layout.h"
+#include "views/view.h"
+
+namespace examples {
+
+LinkExample::LinkExample(ExamplesMain* main) : ExampleBase(main) {
+}
+
+LinkExample::~LinkExample() {
+}
+
+std::wstring LinkExample::GetExampleTitle() {
+ return L"Link";
+}
+
+void LinkExample::CreateExampleView(views::View* container) {
+ link_ = new views::Link(L"Click me!");
+ link_->SetController(this);
+
+ container->SetLayoutManager(new views::FillLayout);
+ container->AddChildView(link_);
+}
+
+void LinkExample::LinkActivated(views::Link* source, int event_flags) {
+ PrintStatus(L"Link clicked");
+}
+
+} // namespace examples