| 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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // non_client_view_ may be NULL, especially during creation. | 485 // non_client_view_ may be NULL, especially during creation. |
| 486 return non_client_view_ ? non_client_view_->client_view() : NULL; | 486 return non_client_view_ ? non_client_view_->client_view() : NULL; |
| 487 } | 487 } |
| 488 | 488 |
| 489 #if defined(UNIT_TEST) | 489 static void set_compositor_factory_for_testing(ui::Compositor*(*factory)()) { |
| 490 static void set_compositor_factory(ui::Compositor*(*factory)()) { | |
| 491 compositor_factory_ = factory; | 490 compositor_factory_ = factory; |
| 492 } | 491 } |
| 493 #endif | |
| 494 static ui::Compositor* (*compositor_factory())() { | 492 static ui::Compositor* (*compositor_factory())() { |
| 495 return compositor_factory_; | 493 return compositor_factory_; |
| 496 } | 494 } |
| 497 | 495 |
| 498 const ui::Compositor* GetCompositor() const; | 496 const ui::Compositor* GetCompositor() const; |
| 499 ui::Compositor* GetCompositor(); | 497 ui::Compositor* GetCompositor(); |
| 500 | 498 |
| 501 // Invokes method of same name on the NativeWidget. | 499 // Invokes method of same name on the NativeWidget. |
| 502 void MarkLayerDirty(); | 500 void MarkLayerDirty(); |
| 503 void CalculateOffsetToAncestorWithLayer(gfx::Point* offset, View** ancestor); | 501 void CalculateOffsetToAncestorWithLayer(gfx::Point* offset, View** ancestor); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 | 697 |
| 700 // Factory used to create Compositors. Settable by tests. | 698 // Factory used to create Compositors. Settable by tests. |
| 701 static ui::Compositor*(*compositor_factory_)(); | 699 static ui::Compositor*(*compositor_factory_)(); |
| 702 | 700 |
| 703 DISALLOW_COPY_AND_ASSIGN(Widget); | 701 DISALLOW_COPY_AND_ASSIGN(Widget); |
| 704 }; | 702 }; |
| 705 | 703 |
| 706 } // namespace views | 704 } // namespace views |
| 707 | 705 |
| 708 #endif // VIEWS_WIDGET_WIDGET_H_ | 706 #endif // VIEWS_WIDGET_WIDGET_H_ |
| OLD | NEW |