OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/ui/kiosk_external_update_notification.h" | 5 #include "chrome/browser/chromeos/ui/kiosk_external_update_notification.h" |
6 | 6 |
7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; | 134 params.ownership = views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET; |
135 params.accept_events = false; | 135 params.accept_events = false; |
136 params.keep_on_top = true; | 136 params.keep_on_top = true; |
137 params.remove_standard_frame = true; | 137 params.remove_standard_frame = true; |
138 params.delegate = view_; | 138 params.delegate = view_; |
139 params.bounds = bounds; | 139 params.bounds = bounds; |
140 params.parent = ash::Shell::GetContainer( | 140 params.parent = ash::Shell::GetContainer( |
141 root_window, ash::kShellWindowId_SettingBubbleContainer); | 141 root_window, ash::kShellWindowId_SettingBubbleContainer); |
142 views::Widget* widget = new views::Widget; | 142 views::Widget* widget = new views::Widget; |
143 widget->Init(params); | 143 widget->Init(params); |
144 widget->SetContentsView(view_); | |
145 gfx::NativeView native_view = widget->GetNativeView(); | 144 gfx::NativeView native_view = widget->GetNativeView(); |
146 native_view->SetName("KioskExternalUpdateNotification"); | 145 native_view->SetName("KioskExternalUpdateNotification"); |
147 widget->Show(); | 146 widget->Show(); |
148 } | 147 } |
149 | 148 |
150 void KioskExternalUpdateNotification::Dismiss() { | 149 void KioskExternalUpdateNotification::Dismiss() { |
151 if (view_) { | 150 if (view_) { |
152 KioskExternalUpdateNotificationView* view = view_; | 151 KioskExternalUpdateNotificationView* view = view_; |
153 view_ = NULL; | 152 view_ = NULL; |
154 view->CloseByOwner(); | 153 view->CloseByOwner(); |
155 } | 154 } |
156 } | 155 } |
157 | 156 |
158 } // namespace chromeos | 157 } // namespace chromeos |
OLD | NEW |