| 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/bubble/bubble_delegate.h" | 5 #include "ui/views/bubble/bubble_delegate.h" |
| 6 | 6 |
| 7 #include "ui/base/animation/slide_animation.h" | 7 #include "ui/base/animation/slide_animation.h" |
| 8 #include "ui/gfx/color_utils.h" | 8 #include "ui/gfx/color_utils.h" |
| 9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 10 #include "ui/native_theme/native_theme.h" | 10 #include "ui/native_theme/native_theme.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 widget_(widget) { | 54 widget_(widget) { |
| 55 bubble_->GetWidget()->AddObserver(this); | 55 bubble_->GetWidget()->AddObserver(this); |
| 56 } | 56 } |
| 57 | 57 |
| 58 virtual ~BubbleBorderDelegate() { | 58 virtual ~BubbleBorderDelegate() { |
| 59 if (bubble_ && bubble_->GetWidget()) | 59 if (bubble_ && bubble_->GetWidget()) |
| 60 bubble_->GetWidget()->RemoveObserver(this); | 60 bubble_->GetWidget()->RemoveObserver(this); |
| 61 } | 61 } |
| 62 | 62 |
| 63 // WidgetDelegate overrides: | 63 // WidgetDelegate overrides: |
| 64 virtual bool CanResize() const OVERRIDE { return bubble_->CanResize(); } |
| 64 virtual bool CanActivate() const OVERRIDE { return false; } | 65 virtual bool CanActivate() const OVERRIDE { return false; } |
| 65 virtual void DeleteDelegate() OVERRIDE { delete this; } | 66 virtual void DeleteDelegate() OVERRIDE { delete this; } |
| 66 virtual Widget* GetWidget() OVERRIDE { return widget_; } | 67 virtual Widget* GetWidget() OVERRIDE { return widget_; } |
| 67 virtual const Widget* GetWidget() const OVERRIDE { return widget_; } | 68 virtual const Widget* GetWidget() const OVERRIDE { return widget_; } |
| 68 virtual NonClientFrameView* CreateNonClientFrameView( | 69 virtual NonClientFrameView* CreateNonClientFrameView( |
| 69 Widget* widget) OVERRIDE { | 70 Widget* widget) OVERRIDE { |
| 70 return bubble_->CreateNonClientFrameView(widget); | 71 return bubble_->CreateNonClientFrameView(widget); |
| 71 } | 72 } |
| 72 | 73 |
| 73 // WidgetObserver overrides: | 74 // WidgetObserver overrides: |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 #if defined(OS_WIN) && !defined(USE_AURA) | 355 #if defined(OS_WIN) && !defined(USE_AURA) |
| 355 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { | 356 gfx::Rect BubbleDelegateView::GetBubbleClientBounds() const { |
| 356 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); | 357 gfx::Rect client_bounds(GetBubbleFrameView()->GetBoundsForClientView()); |
| 357 client_bounds.Offset( | 358 client_bounds.Offset( |
| 358 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin()); | 359 border_widget_->GetWindowBoundsInScreen().OffsetFromOrigin()); |
| 359 return client_bounds; | 360 return client_bounds; |
| 360 } | 361 } |
| 361 #endif | 362 #endif |
| 362 | 363 |
| 363 } // namespace views | 364 } // namespace views |
| OLD | NEW |