OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/examples/examples_window.h" | 5 #include "ui/views/examples/examples_window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 static ExamplesWindowContents* instance() { return instance_; } | 176 static ExamplesWindowContents* instance() { return instance_; } |
177 | 177 |
178 private: | 178 private: |
179 // WidgetDelegateView: | 179 // WidgetDelegateView: |
180 bool CanResize() const override { return true; } | 180 bool CanResize() const override { return true; } |
181 bool CanMaximize() const override { return true; } | 181 bool CanMaximize() const override { return true; } |
182 bool CanMinimize() const override { return true; } | 182 bool CanMinimize() const override { return true; } |
183 base::string16 GetWindowTitle() const override { | 183 base::string16 GetWindowTitle() const override { |
184 return base::ASCIIToUTF16("Views Examples"); | 184 return base::ASCIIToUTF16("Views Examples"); |
185 } | 185 } |
186 View* GetContentsView() override { return this; } | |
187 void WindowClosing() override { | 186 void WindowClosing() override { |
188 instance_ = NULL; | 187 instance_ = NULL; |
189 if (operation_ == QUIT_ON_CLOSE) | 188 if (operation_ == QUIT_ON_CLOSE) |
190 base::MessageLoop::current()->QuitWhenIdle(); | 189 base::MessageLoop::current()->QuitWhenIdle(); |
191 } | 190 } |
192 gfx::Size GetPreferredSize() const override { return gfx::Size(800, 300); } | 191 gfx::Size GetPreferredSize() const override { return gfx::Size(800, 300); } |
193 | 192 |
194 // ComboboxListener: | 193 // ComboboxListener: |
195 void OnPerformAction(Combobox* combobox) override { | 194 void OnPerformAction(Combobox* combobox) override { |
196 DCHECK_EQ(combobox, combobox_); | 195 DCHECK_EQ(combobox, combobox_); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 widget->Show(); | 231 widget->Show(); |
233 } | 232 } |
234 } | 233 } |
235 | 234 |
236 void LogStatus(const std::string& string) { | 235 void LogStatus(const std::string& string) { |
237 ExamplesWindowContents::instance()->SetStatus(string); | 236 ExamplesWindowContents::instance()->SetStatus(string); |
238 } | 237 } |
239 | 238 |
240 } // namespace examples | 239 } // namespace examples |
241 } // namespace views | 240 } // namespace views |
OLD | NEW |