diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 23:31:59 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 23:31:59 +0000 |
commit | 0b609eee74dc548e3f63aa328b037ca0c1bef2da (patch) | |
tree | 9ec3357ee987a263fc3bd7bbc906cf537b5bc406 /views/widget/widget.cc | |
parent | a40f6e9f4973f79a1c2682ddac655592fa44884d (diff) | |
download | chromium_src-0b609eee74dc548e3f63aa328b037ca0c1bef2da.zip chromium_src-0b609eee74dc548e3f63aa328b037ca0c1bef2da.tar.gz chromium_src-0b609eee74dc548e3f63aa328b037ca0c1bef2da.tar.bz2 |
Make more methods on Widget non-virtual and move to NativeWidget
BUG=72040
TEST=none
Review URL: http://codereview.chromium.org/6623025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76997 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/widget.cc')
-rw-r--r-- | views/widget/widget.cc | 87 |
1 files changed, 50 insertions, 37 deletions
diff --git a/views/widget/widget.cc b/views/widget/widget.cc index b805983..c34eb09 100644 --- a/views/widget/widget.cc +++ b/views/widget/widget.cc @@ -25,6 +25,8 @@ Widget::Widget() Widget::~Widget() { } +// Unconverted methods (see header) -------------------------------------------- + void Widget::Init(gfx::NativeView parent, const gfx::Rect& bounds) { GetRootView(); default_theme_provider_.reset(new DefaultThemeProvider); @@ -33,6 +35,42 @@ void Widget::Init(gfx::NativeView parent, const gfx::Rect& bounds) { void Widget::InitWithWidget(Widget* parent, const gfx::Rect& bounds) { } +gfx::NativeView Widget::GetNativeView() const { + return NULL; +} + +void Widget::GenerateMousePressedForView(View* view, const gfx::Point& point) { +} + +bool Widget::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) { + return false; +} + +Window* Widget::GetWindow() { + return NULL; +} + +const Window* Widget::GetWindow() const { + return NULL; +} + +void Widget::ViewHierarchyChanged(bool is_add, View* parent, View* child) { + if (!is_add) { + if (child == dragged_view_) + dragged_view_ = NULL; + + FocusManager* focus_manager = GetFocusManager(); + if (focus_manager) { + if (focus_manager->GetFocusedView() == child) + focus_manager->SetFocusedView(NULL); + focus_manager->ViewRemoved(parent, child); + } + ViewStorage::GetInstance()->ViewRemoved(parent, child); + } +} + +// Converted methods (see header) ---------------------------------------------- + Widget* Widget::GetTopLevelWidget() { return const_cast<Widget*>( const_cast<const Widget*>(this)->GetTopLevelWidget()); @@ -57,34 +95,39 @@ gfx::Rect Widget::GetClientAreaScreenBounds() const { } void Widget::SetBounds(const gfx::Rect& bounds) { + native_widget_->SetBounds(bounds); } void Widget::MoveAbove(Widget* widget) { + native_widget_->MoveAbove(widget); } void Widget::SetShape(gfx::NativeRegion shape) { + native_widget_->SetShape(shape); } void Widget::Close() { + native_widget_->Close(); } void Widget::CloseNow() { + native_widget_->CloseNow(); } void Widget::Show() { + native_widget_->Show(); } void Widget::Hide() { -} - -gfx::NativeView Widget::GetNativeView() const { - return NULL; + native_widget_->Hide(); } void Widget::SetOpacity(unsigned char opacity) { + native_widget_->SetOpacity(opacity); } void Widget::SetAlwaysOnTop(bool on_top) { + native_widget_->SetAlwaysOnTop(on_top); } RootView* Widget::GetRootView() { @@ -96,30 +139,15 @@ RootView* Widget::GetRootView() { } bool Widget::IsVisible() const { - return false; + return native_widget_->IsVisible(); } bool Widget::IsActive() const { - return false; + return native_widget_->IsActive(); } bool Widget::IsAccessibleWidget() const { - return false; -} - -void Widget::GenerateMousePressedForView(View* view, const gfx::Point& point) { -} - -bool Widget::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) { - return false; -} - -Window* Widget::GetWindow() { - return NULL; -} - -const Window* Widget::GetWindow() const { - return NULL; + return native_widget_->IsAccessibleWidget(); } ThemeProvider* Widget::GetThemeProvider() const { @@ -146,21 +174,6 @@ FocusManager* Widget::GetFocusManager() { return focus_manager_.get(); } -void Widget::ViewHierarchyChanged(bool is_add, View* parent, View* child) { - if (!is_add) { - if (child == dragged_view_) - dragged_view_ = NULL; - - FocusManager* focus_manager = GetFocusManager(); - if (focus_manager) { - if (focus_manager->GetFocusedView() == child) - focus_manager->SetFocusedView(NULL); - focus_manager->ViewRemoved(parent, child); - } - ViewStorage::GetInstance()->ViewRemoved(parent, child); - } -} - bool Widget::ContainsNativeView(gfx::NativeView native_view) { if (native_widget_->ContainsNativeView(native_view)) return true; |