| 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/widget/widget.h" | 5 #include "ui/views/widget/widget.h" | 
| 6 | 6 | 
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" | 
| 8 #include "base/logging.h" | 8 #include "base/logging.h" | 
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" | 
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 67 | 67 | 
| 68 // A default implementation of WidgetDelegate, used by Widget when no | 68 // A default implementation of WidgetDelegate, used by Widget when no | 
| 69 // WidgetDelegate is supplied. | 69 // WidgetDelegate is supplied. | 
| 70 class DefaultWidgetDelegate : public WidgetDelegate { | 70 class DefaultWidgetDelegate : public WidgetDelegate { | 
| 71  public: | 71  public: | 
| 72   explicit DefaultWidgetDelegate(Widget* widget) : widget_(widget) { | 72   explicit DefaultWidgetDelegate(Widget* widget) : widget_(widget) { | 
| 73   } | 73   } | 
| 74   virtual ~DefaultWidgetDelegate() {} | 74   virtual ~DefaultWidgetDelegate() {} | 
| 75 | 75 | 
| 76   // Overridden from WidgetDelegate: | 76   // Overridden from WidgetDelegate: | 
| 77   virtual void DeleteDelegate() OVERRIDE { | 77   virtual void DeleteDelegate() override { | 
| 78     delete this; | 78     delete this; | 
| 79   } | 79   } | 
| 80   virtual Widget* GetWidget() OVERRIDE { | 80   virtual Widget* GetWidget() override { | 
| 81     return widget_; | 81     return widget_; | 
| 82   } | 82   } | 
| 83   virtual const Widget* GetWidget() const OVERRIDE { | 83   virtual const Widget* GetWidget() const override { | 
| 84     return widget_; | 84     return widget_; | 
| 85   } | 85   } | 
| 86   virtual bool ShouldAdvanceFocusToTopLevelWidget() const OVERRIDE { | 86   virtual bool ShouldAdvanceFocusToTopLevelWidget() const override { | 
| 87     // In most situations where a Widget is used without a delegate the Widget | 87     // In most situations where a Widget is used without a delegate the Widget | 
| 88     // is used as a container, so that we want focus to advance to the top-level | 88     // is used as a container, so that we want focus to advance to the top-level | 
| 89     // widget. A good example of this is the find bar. | 89     // widget. A good example of this is the find bar. | 
| 90     return true; | 90     return true; | 
| 91   } | 91   } | 
| 92 | 92 | 
| 93  private: | 93  private: | 
| 94   Widget* widget_; | 94   Widget* widget_; | 
| 95 | 95 | 
| 96   DISALLOW_COPY_AND_ASSIGN(DefaultWidgetDelegate); | 96   DISALLOW_COPY_AND_ASSIGN(DefaultWidgetDelegate); | 
| (...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1510 | 1510 | 
| 1511 //////////////////////////////////////////////////////////////////////////////// | 1511 //////////////////////////////////////////////////////////////////////////////// | 
| 1512 // internal::NativeWidgetPrivate, NativeWidget implementation: | 1512 // internal::NativeWidgetPrivate, NativeWidget implementation: | 
| 1513 | 1513 | 
| 1514 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 1514 internal::NativeWidgetPrivate* NativeWidgetPrivate::AsNativeWidgetPrivate() { | 
| 1515   return this; | 1515   return this; | 
| 1516 } | 1516 } | 
| 1517 | 1517 | 
| 1518 }  // namespace internal | 1518 }  // namespace internal | 
| 1519 }  // namespace views | 1519 }  // namespace views | 
| OLD | NEW | 
|---|