| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/example_base.h" | 5 #include "views/examples/example_base.h" |
| 6 | 6 |
| 7 #include <stdarg.h> | 7 #include <stdarg.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 // true if the example view has already been created, or false otherwise. | 47 // true if the example view has already been created, or false otherwise. |
| 48 bool example_view_created_; | 48 bool example_view_created_; |
| 49 | 49 |
| 50 examples::ExampleBase* example_base_; | 50 examples::ExampleBase* example_base_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(ContainerView); | 52 DISALLOW_COPY_AND_ASSIGN(ContainerView); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace | 55 } // namespace |
| 56 | 56 |
| 57 namespace views { | |
| 58 | |
| 59 // OS_CHROMEOS requires a MenuWrapper::CreateWrapper implementation. | |
| 60 // TODO(oshima): Fix chromium-os:7409 so that this isn't required. | |
| 61 #if defined(OS_CHROMEOS) | |
| 62 // static | |
| 63 MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { | |
| 64 return new NativeMenuGtk(menu); | |
| 65 } | |
| 66 #endif // OS_CHROMEOS | |
| 67 | |
| 68 } // namespace views | |
| 69 | |
| 70 namespace examples { | 57 namespace examples { |
| 71 | 58 |
| 72 ExampleBase::ExampleBase(ExamplesMain* main) | 59 ExampleBase::ExampleBase(ExamplesMain* main) |
| 73 : main_(main) { | 60 : main_(main) { |
| 74 container_ = new ContainerView(this); | 61 container_ = new ContainerView(this); |
| 75 } | 62 } |
| 76 | 63 |
| 77 // Prints a message in the status area, at the bottom of the window. | 64 // Prints a message in the status area, at the bottom of the window. |
| 78 void ExampleBase::PrintStatus(const wchar_t* format, ...) { | 65 void ExampleBase::PrintStatus(const wchar_t* format, ...) { |
| 79 va_list ap; | 66 va_list ap; |
| 80 va_start(ap, format); | 67 va_start(ap, format); |
| 81 std::wstring msg; | 68 std::wstring msg; |
| 82 base::StringAppendV(&msg, format, ap); | 69 base::StringAppendV(&msg, format, ap); |
| 83 main_->SetStatus(msg); | 70 main_->SetStatus(msg); |
| 84 } | 71 } |
| 85 | 72 |
| 86 } // namespace examples | 73 } // namespace examples |
| OLD | NEW |