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/screen_capture_notification_ui.h" | 5 #include "chrome/browser/ui/screen_capture_notification_ui.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "chrome/app/chrome_dll_resource.h" | 8 #include "chrome/app/chrome_dll_resource.h" |
9 #include "chrome/browser/ui/views/chrome_views_export.h" | 9 #include "chrome/browser/ui/views/chrome_views_export.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 label_->SetText(text_); | 169 label_->SetText(text_); |
170 | 170 |
171 views::Widget* widget = new views::Widget; | 171 views::Widget* widget = new views::Widget; |
172 | 172 |
173 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); | 173 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); |
174 params.delegate = this; | 174 params.delegate = this; |
175 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 175 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
176 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 176 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
177 params.remove_standard_frame = true; | 177 params.remove_standard_frame = true; |
178 params.keep_on_top = true; | 178 params.keep_on_top = true; |
179 params.top_level = true; | |
180 | 179 |
181 #if defined(USE_ASH) | 180 #if defined(USE_ASH) |
182 // TODO(sergeyu): The notification bar must be shown on the monitor that's | 181 // TODO(sergeyu): The notification bar must be shown on the monitor that's |
183 // being captured. Make sure it's always the case. Currently we always capture | 182 // being captured. Make sure it's always the case. Currently we always capture |
184 // the primary monitor. | 183 // the primary monitor. |
185 if (ash::Shell::HasInstance()) | 184 if (ash::Shell::HasInstance()) |
186 params.context = ash::Shell::GetPrimaryRootWindow(); | 185 params.context = ash::Shell::GetPrimaryRootWindow(); |
187 #endif | 186 #endif |
188 | 187 |
189 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); | 188 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } | 327 } |
329 } | 328 } |
330 | 329 |
331 } // namespace | 330 } // namespace |
332 | 331 |
333 scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( | 332 scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( |
334 const base::string16& text) { | 333 const base::string16& text) { |
335 return scoped_ptr<ScreenCaptureNotificationUI>( | 334 return scoped_ptr<ScreenCaptureNotificationUI>( |
336 new ScreenCaptureNotificationUIViews(text)); | 335 new ScreenCaptureNotificationUIViews(text)); |
337 } | 336 } |
OLD | NEW |