| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/examples/link_example.h" | 5 #include "ui/views/examples/link_example.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "views/controls/link.h" | 8 #include "views/controls/link.h" |
| 9 #include "views/layout/fill_layout.h" | 9 #include "views/layout/fill_layout.h" |
| 10 #include "views/view.h" | 10 #include "views/view.h" |
| 11 | 11 |
| 12 namespace examples { | 12 namespace examples { |
| 13 | 13 |
| 14 LinkExample::LinkExample(ExamplesMain* main) | 14 LinkExample::LinkExample(ExamplesMain* main) |
| 15 : ExampleBase(main, "Link") { | 15 : ExampleBase(main, "Link") { |
| 16 } | 16 } |
| 17 | 17 |
| 18 LinkExample::~LinkExample() { | 18 LinkExample::~LinkExample() { |
| 19 } | 19 } |
| 20 | 20 |
| 21 void LinkExample::CreateExampleView(views::View* container) { | 21 void LinkExample::CreateExampleView(views::View* container) { |
| 22 link_ = new views::Link(ASCIIToUTF16("Click me!")); | 22 link_ = new views::Link(ASCIIToUTF16("Click me!")); |
| 23 link_->set_listener(this); | 23 link_->set_listener(this); |
| 24 | 24 |
| 25 container->SetLayoutManager(new views::FillLayout); | 25 container->SetLayoutManager(new views::FillLayout); |
| 26 container->AddChildView(link_); | 26 container->AddChildView(link_); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void LinkExample::LinkClicked(views::Link* source, int event_flags) { | 29 void LinkExample::LinkClicked(views::Link* source, int event_flags) { |
| 30 PrintStatus("Link clicked"); | 30 PrintStatus("Link clicked"); |
| 31 } | 31 } |
| 32 | 32 |
| 33 } // namespace examples | 33 } // namespace examples |
| OLD | NEW |