| 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 "chrome/browser/ui/views/status_bubble_views.h" | 5 #include "chrome/browser/ui/views/status_bubble_views.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 views::Widget* frame = base_view_->GetWidget(); | 597 views::Widget* frame = base_view_->GetWidget(); |
| 598 if (!view_) | 598 if (!view_) |
| 599 view_ = new StatusView(popup_.get(), frame->GetThemeProvider()); | 599 view_ = new StatusView(popup_.get(), frame->GetThemeProvider()); |
| 600 if (!expand_view_.get()) | 600 if (!expand_view_.get()) |
| 601 expand_view_.reset(new StatusViewExpander(this, view_)); | 601 expand_view_.reset(new StatusViewExpander(this, view_)); |
| 602 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 602 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
| 603 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 603 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 604 params.accept_events = false; | 604 params.accept_events = false; |
| 605 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 605 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 606 params.parent = frame->GetNativeView(); | 606 params.parent = frame->GetNativeView(); |
| 607 params.context = frame->GetNativeView(); | 607 params.context = frame->GetNativeWindow(); |
| 608 popup_->Init(params); | 608 popup_->Init(params); |
| 609 popup_->GetNativeView()->SetName("StatusBubbleViews"); | 609 popup_->GetNativeView()->SetName("StatusBubbleViews"); |
| 610 // We do our own animation and don't want any from the system. | 610 // We do our own animation and don't want any from the system. |
| 611 popup_->SetVisibilityChangedAnimationsEnabled(false); | 611 popup_->SetVisibilityChangedAnimationsEnabled(false); |
| 612 popup_->SetOpacity(0x00); | 612 popup_->SetOpacity(0x00); |
| 613 popup_->SetContentsView(view_); | 613 popup_->SetContentsView(view_); |
| 614 ash::wm::GetWindowState(popup_->GetNativeWindow())-> | 614 ash::wm::GetWindowState(popup_->GetNativeWindow())-> |
| 615 set_ignored_by_shelf(true); | 615 set_ignored_by_shelf(true); |
| 616 RepositionPopup(); | 616 RepositionPopup(); |
| 617 } | 617 } |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 890 void StatusBubbleViews::SetBubbleWidth(int width) { | 890 void StatusBubbleViews::SetBubbleWidth(int width) { |
| 891 size_.set_width(width); | 891 size_.set_width(width); |
| 892 SetBounds(original_position_.x(), original_position_.y(), | 892 SetBounds(original_position_.x(), original_position_.y(), |
| 893 size_.width(), size_.height()); | 893 size_.width(), size_.height()); |
| 894 } | 894 } |
| 895 | 895 |
| 896 void StatusBubbleViews::CancelExpandTimer() { | 896 void StatusBubbleViews::CancelExpandTimer() { |
| 897 if (expand_timer_factory_.HasWeakPtrs()) | 897 if (expand_timer_factory_.HasWeakPtrs()) |
| 898 expand_timer_factory_.InvalidateWeakPtrs(); | 898 expand_timer_factory_.InvalidateWeakPtrs(); |
| 899 } | 899 } |
| OLD | NEW |