| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/examples_main.h" | 5 #include "views/examples/examples_main.h" |
| 6 | 6 |
| 7 #include "app/app_paths.h" | 7 #include "app/app_paths.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 views::GridLayout::USE_PREF, 0, 0); | 62 views::GridLayout::USE_PREF, 0, 0); |
| 63 | 63 |
| 64 views::TabbedPane* tabbed_pane = new views::TabbedPane(); | 64 views::TabbedPane* tabbed_pane = new views::TabbedPane(); |
| 65 status_label_ = new views::Label(); | 65 status_label_ = new views::Label(); |
| 66 | 66 |
| 67 layout->StartRow(1, 0); | 67 layout->StartRow(1, 0); |
| 68 layout->AddView(tabbed_pane); | 68 layout->AddView(tabbed_pane); |
| 69 layout->StartRow(0 /* no expand */, 0); | 69 layout->StartRow(0 /* no expand */, 0); |
| 70 layout->AddView(status_label_); | 70 layout->AddView(status_label_); |
| 71 | 71 |
| 72 views::Window* window = |
| 73 views::Window::CreateChromeWindow(NULL, gfx::Rect(0, 0, 600, 300), this); |
| 74 |
| 72 examples::TextfieldExample textfield_example(this); | 75 examples::TextfieldExample textfield_example(this); |
| 73 tabbed_pane->AddTab(textfield_example.GetExampleTitle(), | 76 tabbed_pane->AddTab(textfield_example.GetExampleTitle(), |
| 74 textfield_example.GetExampleView()); | 77 textfield_example.GetExampleView()); |
| 75 | 78 |
| 76 examples::ButtonExample button_example(this); | 79 examples::ButtonExample button_example(this); |
| 77 tabbed_pane->AddTab(button_example.GetExampleTitle(), | 80 tabbed_pane->AddTab(button_example.GetExampleTitle(), |
| 78 button_example.GetExampleView()); | 81 button_example.GetExampleView()); |
| 79 | 82 |
| 80 examples::ComboboxExample combobox_example(this); | 83 examples::ComboboxExample combobox_example(this); |
| 81 tabbed_pane->AddTab(combobox_example.GetExampleTitle(), | 84 tabbed_pane->AddTab(combobox_example.GetExampleTitle(), |
| 82 combobox_example.GetExampleView()); | 85 combobox_example.GetExampleView()); |
| 83 | 86 |
| 84 examples::TabbedPaneExample tabbed_pane_example(this); | 87 examples::TabbedPaneExample tabbed_pane_example(this); |
| 85 tabbed_pane->AddTab(tabbed_pane_example.GetExampleTitle(), | 88 tabbed_pane->AddTab(tabbed_pane_example.GetExampleTitle(), |
| 86 tabbed_pane_example.GetExampleView()); | 89 tabbed_pane_example.GetExampleView()); |
| 87 | 90 |
| 88 examples::MessageBoxExample message_box_example(this); | 91 examples::MessageBoxExample message_box_example(this); |
| 89 tabbed_pane->AddTab(message_box_example.GetExampleTitle(), | 92 tabbed_pane->AddTab(message_box_example.GetExampleTitle(), |
| 90 message_box_example.GetExampleView()); | 93 message_box_example.GetExampleView()); |
| 91 | 94 |
| 92 examples::RadioButtonExample radio_button_example(this); | 95 examples::RadioButtonExample radio_button_example(this); |
| 93 tabbed_pane->AddTab(radio_button_example.GetExampleTitle(), | 96 tabbed_pane->AddTab(radio_button_example.GetExampleTitle(), |
| 94 radio_button_example.GetExampleView()); | 97 radio_button_example.GetExampleView()); |
| 95 | 98 |
| 96 examples::ScrollViewExample scroll_view_example(this); | 99 examples::ScrollViewExample scroll_view_example(this); |
| 97 tabbed_pane->AddTab(scroll_view_example.GetExampleTitle(), | 100 tabbed_pane->AddTab(scroll_view_example.GetExampleTitle(), |
| 98 scroll_view_example.GetExampleView()); | 101 scroll_view_example.GetExampleView()); |
| 99 | 102 |
| 100 views::Window* window = | |
| 101 views::Window::CreateChromeWindow(NULL, gfx::Rect(0, 0, 600, 300), this); | |
| 102 window->Show(); | 103 window->Show(); |
| 103 | |
| 104 views::AcceleratorHandler accelerator_handler; | 104 views::AcceleratorHandler accelerator_handler; |
| 105 MessageLoopForUI::current()->Run(&accelerator_handler); | 105 MessageLoopForUI::current()->Run(&accelerator_handler); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // examples namespace | 108 } // examples namespace |
| 109 | 109 |
| 110 int main(int argc, char** argv) { | 110 int main(int argc, char** argv) { |
| 111 #if defined(OS_WIN) | 111 #if defined(OS_WIN) |
| 112 OleInitialize(NULL); | 112 OleInitialize(NULL); |
| 113 #elif defined(OS_LINUX) | 113 #elif defined(OS_LINUX) |
| 114 // Initializes gtk stuff. | 114 // Initializes gtk stuff. |
| 115 g_thread_init(NULL); | 115 g_thread_init(NULL); |
| 116 g_type_init(); | 116 g_type_init(); |
| 117 gtk_init(&argc, &argv); | 117 gtk_init(&argc, &argv); |
| 118 #endif | 118 #endif |
| 119 | 119 |
| 120 CommandLine::Init(argc, argv); | 120 CommandLine::Init(argc, argv); |
| 121 examples::ExamplesMain main; | 121 examples::ExamplesMain main; |
| 122 main.Run(); | 122 main.Run(); |
| 123 | 123 |
| 124 #if defined(OS_WIN) | 124 #if defined(OS_WIN) |
| 125 OleUninitialize(); | 125 OleUninitialize(); |
| 126 #endif | 126 #endif |
| 127 return 0; | 127 return 0; |
| 128 } | 128 } |
| OLD | NEW |