OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/message_center/views/message_popup_collection.h" | 5 #include "ui/message_center/views/message_popup_collection.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 set_background(views::Background::CreateSolidBackground(0, 0, 0, 0)); | 37 set_background(views::Background::CreateSolidBackground(0, 0, 0, 0)); |
38 | 38 |
39 int seconds = kAutocloseDefaultDelaySeconds; | 39 int seconds = kAutocloseDefaultDelaySeconds; |
40 if (notification->priority() > DEFAULT_PRIORITY) | 40 if (notification->priority() > DEFAULT_PRIORITY) |
41 seconds = kAutocloseHighPriorityDelaySeconds; | 41 seconds = kAutocloseHighPriorityDelaySeconds; |
42 delay_ = base::TimeDelta::FromSeconds(seconds); | 42 delay_ = base::TimeDelta::FromSeconds(seconds); |
43 } | 43 } |
44 | 44 |
45 views::Widget* CreateWidget(gfx::NativeView parent) { | 45 views::Widget* CreateWidget(gfx::NativeView parent) { |
46 views::Widget::InitParams params( | 46 views::Widget::InitParams params( |
47 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 47 views::Widget::InitParams::TYPE_POPUP); |
48 params.keep_on_top = true; | 48 params.keep_on_top = true; |
49 if (parent) | 49 if (parent) |
50 params.parent = parent; | 50 params.parent = parent; |
51 else | 51 else |
52 params.top_level = true; | 52 params.top_level = true; |
53 params.transparent = true; | 53 params.transparent = true; |
54 params.delegate = this; | 54 params.delegate = this; |
55 views::Widget* widget = new views::Widget(); | 55 views::Widget* widget = new views::Widget(); |
56 widget->set_focus_on_creation(false); | 56 widget->set_focus_on_creation(false); |
57 widget->Init(params); | 57 widget->Init(params); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 message_center_->notification_list()->MarkSinglePopupAsShown( | 272 message_center_->notification_list()->MarkSinglePopupAsShown( |
273 iter->first, false); | 273 iter->first, false); |
274 toasts_.erase(iter); | 274 toasts_.erase(iter); |
275 break; | 275 break; |
276 } | 276 } |
277 } | 277 } |
278 UpdatePopups(); | 278 UpdatePopups(); |
279 } | 279 } |
280 | 280 |
281 } // namespace message_center | 281 } // namespace message_center |
OLD | NEW |