| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/views/toolbar/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 animation_target_size_(0), | 88 animation_target_size_(0), |
| 89 active_bubble_(nullptr) { | 89 active_bubble_(nullptr) { |
| 90 set_id(VIEW_ID_BROWSER_ACTION_TOOLBAR); | 90 set_id(VIEW_ID_BROWSER_ACTION_TOOLBAR); |
| 91 | 91 |
| 92 if (!ShownInsideMenu()) { | 92 if (!ShownInsideMenu()) { |
| 93 resize_animation_.reset(new gfx::SlideAnimation(this)); | 93 resize_animation_.reset(new gfx::SlideAnimation(this)); |
| 94 resize_area_ = new views::ResizeArea(this); | 94 resize_area_ = new views::ResizeArea(this); |
| 95 AddChildView(resize_area_); | 95 AddChildView(resize_area_); |
| 96 | 96 |
| 97 const int kWarningImages[] = IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT); | 97 const int kWarningImages[] = IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT); |
| 98 warning_highlight_painter_.reset( | 98 warning_highlight_painter_ = |
| 99 views::Painter::CreateImageGridPainter(kWarningImages)); | 99 views::Painter::CreateImageGridPainter(kWarningImages); |
| 100 } | 100 } |
| 101 } | 101 } |
| 102 | 102 |
| 103 BrowserActionsContainer::~BrowserActionsContainer() { | 103 BrowserActionsContainer::~BrowserActionsContainer() { |
| 104 if (active_bubble_) | 104 if (active_bubble_) |
| 105 active_bubble_->GetWidget()->Close(); | 105 active_bubble_->GetWidget()->Close(); |
| 106 // We should synchronously receive the OnWidgetClosing() event, so we should | 106 // We should synchronously receive the OnWidgetClosing() event, so we should |
| 107 // always have cleared the active bubble by now. | 107 // always have cleared the active bubble by now. |
| 108 DCHECK(!active_bubble_); | 108 DCHECK(!active_bubble_); |
| 109 | 109 |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 } | 657 } |
| 658 } | 658 } |
| 659 | 659 |
| 660 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { | 660 void BrowserActionsContainer::ClearActiveBubble(views::Widget* widget) { |
| 661 DCHECK(active_bubble_); | 661 DCHECK(active_bubble_); |
| 662 DCHECK_EQ(active_bubble_->GetWidget(), widget); | 662 DCHECK_EQ(active_bubble_->GetWidget(), widget); |
| 663 widget->RemoveObserver(this); | 663 widget->RemoveObserver(this); |
| 664 active_bubble_ = nullptr; | 664 active_bubble_ = nullptr; |
| 665 toolbar_actions_bar_->OnBubbleClosed(); | 665 toolbar_actions_bar_->OnBubbleClosed(); |
| 666 } | 666 } |
| OLD | NEW |