| 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 #include "ui/message_center/quiet_mode_bubble.h" | 4 #include "ui/message_center/quiet_mode_bubble.h" |
| 5 | 5 |
| 6 #include "base/time.h" | 6 #include "base/time.h" |
| 7 #include "grit/ui_strings.h" | 7 #include "grit/ui_strings.h" |
| 8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "ui/gfx/insets.h" | 10 #include "ui/gfx/insets.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 namespace message_center { | 48 namespace message_center { |
| 49 | 49 |
| 50 QuietModeBubble::QuietModeBubble(views::View* anchor_view, | 50 QuietModeBubble::QuietModeBubble(views::View* anchor_view, |
| 51 gfx::NativeView parent_window, | 51 gfx::NativeView parent_window, |
| 52 NotificationList* notification_list) | 52 NotificationList* notification_list) |
| 53 : notification_list_(notification_list) { | 53 : notification_list_(notification_list) { |
| 54 DCHECK(notification_list_); | 54 DCHECK(notification_list_); |
| 55 bubble_ = new views::BubbleDelegateView( | 55 bubble_ = new views::BubbleDelegateView( |
| 56 anchor_view, views::BubbleBorder::BOTTOM_RIGHT); | 56 anchor_view, views::BubbleBorder::BOTTOM_RIGHT); |
| 57 bubble_->set_notify_enter_exit_on_child(true); | 57 bubble_->set_notify_enter_exit_on_child(true); |
| 58 bubble_->SetPaintToLayer(true); | 58 |
| 59 bubble_->SetFillsBoundsOpaquely(true); | 59 #ifdef USE_AURA |
| 60 bubble_->SetPaintToLayer(true); |
| 61 bubble_->SetFillsBoundsOpaquely(true); |
| 62 #endif // USE_AURA |
| 63 |
| 60 bubble_->set_parent_window(parent_window); | 64 bubble_->set_parent_window(parent_window); |
| 61 bubble_->set_margins(gfx::Insets()); | 65 bubble_->set_margins(gfx::Insets()); |
| 62 InitializeBubbleContents(); | 66 InitializeBubbleContents(); |
| 63 views::BubbleDelegateView::CreateBubble(bubble_); | 67 views::BubbleDelegateView::CreateBubble(bubble_); |
| 64 bubble_->Show(); | 68 bubble_->Show(); |
| 65 } | 69 } |
| 66 | 70 |
| 67 QuietModeBubble::~QuietModeBubble() { | 71 QuietModeBubble::~QuietModeBubble() { |
| 68 Close(); | 72 Close(); |
| 69 } | 73 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 LOG(INFO) << notification_list_->quiet_mode(); | 112 LOG(INFO) << notification_list_->quiet_mode(); |
| 109 } else { | 113 } else { |
| 110 base::TimeDelta expires_in = (sender == quiet_mode_1day_) ? | 114 base::TimeDelta expires_in = (sender == quiet_mode_1day_) ? |
| 111 base::TimeDelta::FromDays(1) : base::TimeDelta::FromHours(1); | 115 base::TimeDelta::FromDays(1) : base::TimeDelta::FromHours(1); |
| 112 notification_list_->EnterQuietModeWithExpire(expires_in); | 116 notification_list_->EnterQuietModeWithExpire(expires_in); |
| 113 } | 117 } |
| 114 Close(); | 118 Close(); |
| 115 } | 119 } |
| 116 | 120 |
| 117 } // namespace message_center | 121 } // namespace message_center |
| OLD | NEW |