| 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 | 9 |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 void SetStatus(const std::string& status) { | 167 void SetStatus(const std::string& status) { |
| 168 status_label_->SetText(base::UTF8ToUTF16(status)); | 168 status_label_->SetText(base::UTF8ToUTF16(status)); |
| 169 } | 169 } |
| 170 | 170 |
| 171 static ExamplesWindowContents* instance() { return instance_; } | 171 static ExamplesWindowContents* instance() { return instance_; } |
| 172 | 172 |
| 173 private: | 173 private: |
| 174 // WidgetDelegateView: | 174 // WidgetDelegateView: |
| 175 virtual bool CanResize() const OVERRIDE { return true; } | 175 virtual bool CanResize() const OVERRIDE { return true; } |
| 176 virtual bool CanMaximize() const OVERRIDE { return true; } | 176 virtual bool CanMaximize() const OVERRIDE { return true; } |
| 177 virtual bool CanMinimize() const OVERRIDE { return true; } |
| 177 virtual base::string16 GetWindowTitle() const OVERRIDE { | 178 virtual base::string16 GetWindowTitle() const OVERRIDE { |
| 178 return base::ASCIIToUTF16("Views Examples"); | 179 return base::ASCIIToUTF16("Views Examples"); |
| 179 } | 180 } |
| 180 virtual View* GetContentsView() OVERRIDE { return this; } | 181 virtual View* GetContentsView() OVERRIDE { return this; } |
| 181 virtual void WindowClosing() OVERRIDE { | 182 virtual void WindowClosing() OVERRIDE { |
| 182 instance_ = NULL; | 183 instance_ = NULL; |
| 183 if (operation_ == QUIT_ON_CLOSE) | 184 if (operation_ == QUIT_ON_CLOSE) |
| 184 base::MessageLoopForUI::current()->Quit(); | 185 base::MessageLoopForUI::current()->Quit(); |
| 185 } | 186 } |
| 186 | 187 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 widget->Show(); | 226 widget->Show(); |
| 226 } | 227 } |
| 227 } | 228 } |
| 228 | 229 |
| 229 void LogStatus(const std::string& string) { | 230 void LogStatus(const std::string& string) { |
| 230 ExamplesWindowContents::instance()->SetStatus(string); | 231 ExamplesWindowContents::instance()->SetStatus(string); |
| 231 } | 232 } |
| 232 | 233 |
| 233 } // namespace examples | 234 } // namespace examples |
| 234 } // namespace views | 235 } // namespace views |
| OLD | NEW |