Chromium Code Reviews| 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 #ifndef VIEWS_WIDGET_WIDGET_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_H_ |
| 6 #define VIEWS_WIDGET_WIDGET_H_ | 6 #define VIEWS_WIDGET_WIDGET_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <stack> | 9 #include <stack> |
| 10 | 10 |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 475 } | 475 } |
| 476 const NonClientView* non_client_view() const { | 476 const NonClientView* non_client_view() const { |
| 477 return non_client_view_; | 477 return non_client_view_; |
| 478 } | 478 } |
| 479 | 479 |
| 480 ClientView* client_view() { | 480 ClientView* client_view() { |
| 481 return const_cast<ClientView*>( | 481 return const_cast<ClientView*>( |
| 482 const_cast<const Widget*>(this)->client_view()); | 482 const_cast<const Widget*>(this)->client_view()); |
| 483 } | 483 } |
| 484 const ClientView* client_view() const { | 484 const ClientView* client_view() const { |
| 485 return non_client_view()->client_view(); | 485 return non_client_view() ? non_client_view()->client_view() : NULL; |
|
Peter Kasting
2011/07/20 23:09:40
Nit: Might as well use |non_client_view_| directly
| |
| 486 } | 486 } |
| 487 | 487 |
| 488 #if defined(UNIT_TEST) | 488 #if defined(UNIT_TEST) |
| 489 static void set_compositor_factory(ui::Compositor*(*factory)()) { | 489 static void set_compositor_factory(ui::Compositor*(*factory)()) { |
| 490 compositor_factory_ = factory; | 490 compositor_factory_ = factory; |
| 491 } | 491 } |
| 492 #endif | 492 #endif |
| 493 static ui::Compositor* (*compositor_factory())() { | 493 static ui::Compositor* (*compositor_factory())() { |
| 494 return compositor_factory_; | 494 return compositor_factory_; |
| 495 } | 495 } |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 698 | 698 |
| 699 // Factory used to create Compositors. Settable by tests. | 699 // Factory used to create Compositors. Settable by tests. |
| 700 static ui::Compositor*(*compositor_factory_)(); | 700 static ui::Compositor*(*compositor_factory_)(); |
| 701 | 701 |
| 702 DISALLOW_COPY_AND_ASSIGN(Widget); | 702 DISALLOW_COPY_AND_ASSIGN(Widget); |
| 703 }; | 703 }; |
| 704 | 704 |
| 705 } // namespace views | 705 } // namespace views |
| 706 | 706 |
| 707 #endif // VIEWS_WIDGET_WIDGET_H_ | 707 #endif // VIEWS_WIDGET_WIDGET_H_ |
| OLD | NEW |