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 <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 Widget(); | 84 Widget(); |
| 85 virtual ~Widget(); | 85 virtual ~Widget(); |
| 86 | 86 |
| 87 // Creates a Widget instance suitable for use as a transient popup. | 87 // Creates a Widget instance suitable for use as a transient popup. |
| 88 static Widget* CreatePopupWidget(const CreateParams& params); | 88 static Widget* CreatePopupWidget(const CreateParams& params); |
| 89 | 89 |
| 90 // Enumerates all windows pertaining to us and notifies their | 90 // Enumerates all windows pertaining to us and notifies their |
| 91 // view hierarchies that the locale has changed. | 91 // view hierarchies that the locale has changed. |
| 92 static void NotifyLocaleChanged(); | 92 static void NotifyLocaleChanged(); |
| 93 | 93 |
| 94 // Converts a rectangle from one Widget's coordinate system to another's. | |
| 95 // Returns false if the conversion couldn't be made, because either these two | |
| 96 // Widgets do not have a common ancestor or they are not on the screen yet. | |
| 97 // The value of |*rect| won't be changed when false is returned. | |
| 98 static bool ConvertRect(const Widget* from, | |
|
Ben Goodger (Google)
2011/03/22 20:45:14
source/target
James Su
2011/03/22 23:08:47
Done.
| |
| 99 const Widget* to, | |
| 100 gfx::Rect* rect); | |
| 101 | |
| 94 // Unconverted methods ------------------------------------------------------- | 102 // Unconverted methods ------------------------------------------------------- |
| 95 | 103 |
| 96 // TODO(beng): | 104 // TODO(beng): |
| 97 // Widget subclasses are still implementing these methods by overriding from | 105 // Widget subclasses are still implementing these methods by overriding from |
| 98 // here rather than by implementing NativeWidget. | 106 // here rather than by implementing NativeWidget. |
| 99 | 107 |
| 100 // Initialize the Widget with a parent and an initial desired size. | 108 // Initialize the Widget with a parent and an initial desired size. |
| 101 // |contents_view| is the view that will be the single child of RootView | 109 // |contents_view| is the view that will be the single child of RootView |
| 102 // within this Widget. As contents_view is inserted into RootView's tree, | 110 // within this Widget. As contents_view is inserted into RootView's tree, |
| 103 // RootView assumes ownership of this view and cleaning it up. If you remove | 111 // RootView assumes ownership of this view and cleaning it up. If you remove |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 // occurred on |view|, such as when the view is focused or when its | 261 // occurred on |view|, such as when the view is focused or when its |
| 254 // value changes. Pass true for |send_native_event| except for rare | 262 // value changes. Pass true for |send_native_event| except for rare |
| 255 // cases where the view is a native control that's already sending a | 263 // cases where the view is a native control that's already sending a |
| 256 // native accessibility event and the duplicate event would cause | 264 // native accessibility event and the duplicate event would cause |
| 257 // problems. | 265 // problems. |
| 258 virtual void NotifyAccessibilityEvent( | 266 virtual void NotifyAccessibilityEvent( |
| 259 View* view, | 267 View* view, |
| 260 ui::AccessibilityTypes::Event event_type, | 268 ui::AccessibilityTypes::Event event_type, |
| 261 bool send_native_event) = 0; | 269 bool send_native_event) = 0; |
| 262 | 270 |
| 263 NativeWidget* native_widget() { return native_widget_; } | 271 NativeWidget* native_widget() const { return native_widget_; } |
|
Ben Goodger (Google)
2011/03/22 20:45:14
This method is deliberately non-const.
If you nee
James Su
2011/03/22 23:08:47
This change is not necessary anymore.
| |
| 264 | 272 |
| 265 // Overridden from NativeWidgetDelegate: | 273 // Overridden from NativeWidgetDelegate: |
| 266 virtual void OnNativeFocus(gfx::NativeView focused_view) OVERRIDE; | 274 virtual void OnNativeFocus(gfx::NativeView focused_view) OVERRIDE; |
| 267 virtual void OnNativeBlur(gfx::NativeView focused_view) OVERRIDE; | 275 virtual void OnNativeBlur(gfx::NativeView focused_view) OVERRIDE; |
| 268 virtual void OnNativeWidgetCreated() OVERRIDE; | 276 virtual void OnNativeWidgetCreated() OVERRIDE; |
| 269 virtual void OnSizeChanged(const gfx::Size& new_size) OVERRIDE; | 277 virtual void OnSizeChanged(const gfx::Size& new_size) OVERRIDE; |
| 270 virtual bool HasFocusManager() const OVERRIDE; | 278 virtual bool HasFocusManager() const OVERRIDE; |
| 271 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; | 279 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; |
| 272 | 280 |
| 273 // Overridden from FocusTraversable: | 281 // Overridden from FocusTraversable: |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 | 338 |
| 331 // The compositor for accelerated drawing. | 339 // The compositor for accelerated drawing. |
| 332 scoped_refptr<ui::Compositor> compositor_; | 340 scoped_refptr<ui::Compositor> compositor_; |
| 333 | 341 |
| 334 DISALLOW_COPY_AND_ASSIGN(Widget); | 342 DISALLOW_COPY_AND_ASSIGN(Widget); |
| 335 }; | 343 }; |
| 336 | 344 |
| 337 } // namespace views | 345 } // namespace views |
| 338 | 346 |
| 339 #endif // VIEWS_WIDGET_WIDGET_H_ | 347 #endif // VIEWS_WIDGET_WIDGET_H_ |
| OLD | NEW |