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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 gfx::NativeViewId ScreenCaptureNotificationUIViews::OnStarted( | 163 gfx::NativeViewId ScreenCaptureNotificationUIViews::OnStarted( |
164 const base::Closure& stop_callback) { | 164 const base::Closure& stop_callback) { |
165 stop_callback_ = stop_callback; | 165 stop_callback_ = stop_callback; |
166 | 166 |
167 label_->SetElideBehavior(views::Label::ELIDE_IN_MIDDLE); | 167 label_->SetElideBehavior(views::Label::ELIDE_IN_MIDDLE); |
168 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 168 label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
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; |
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; | 179 params.top_level = true; |
| 180 // Make sure can_activate is true so the window icon will show in the taskbar. |
| 181 params.can_activate = true; |
180 | 182 |
181 #if defined(USE_ASH) | 183 #if defined(USE_ASH) |
182 // TODO(sergeyu): The notification bar must be shown on the monitor that's | 184 // 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 | 185 // being captured. Make sure it's always the case. Currently we always capture |
184 // the primary monitor. | 186 // the primary monitor. |
185 if (ash::Shell::HasInstance()) | 187 if (ash::Shell::HasInstance()) |
186 params.context = ash::Shell::GetPrimaryRootWindow(); | 188 params.context = ash::Shell::GetPrimaryRootWindow(); |
187 #endif | 189 #endif |
188 | 190 |
189 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); | 191 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } | 330 } |
329 } | 331 } |
330 | 332 |
331 } // namespace | 333 } // namespace |
332 | 334 |
333 scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( | 335 scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( |
334 const base::string16& text) { | 336 const base::string16& text) { |
335 return scoped_ptr<ScreenCaptureNotificationUI>( | 337 return scoped_ptr<ScreenCaptureNotificationUI>( |
336 new ScreenCaptureNotificationUIViews(text)); | 338 new ScreenCaptureNotificationUIViews(text)); |
337 } | 339 } |
OLD | NEW |