| 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 "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/app/chrome_dll_resource.h" | 9 #include "chrome/app/chrome_dll_resource.h" |
| 10 #include "chrome/browser/ui/views/chrome_views_export.h" | 10 #include "chrome/browser/ui/views/chrome_views_export.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 | 203 |
| 204 // Place the bar in the center of the bottom of the display. | 204 // Place the bar in the center of the bottom of the display. |
| 205 gfx::Size size = widget->non_client_view()->GetPreferredSize(); | 205 gfx::Size size = widget->non_client_view()->GetPreferredSize(); |
| 206 gfx::Rect bounds( | 206 gfx::Rect bounds( |
| 207 work_area.x() + work_area.width() / 2 - size.width() / 2, | 207 work_area.x() + work_area.width() / 2 - size.width() / 2, |
| 208 work_area.y() + work_area.height() - size.height(), | 208 work_area.y() + work_area.height() - size.height(), |
| 209 size.width(), size.height()); | 209 size.width(), size.height()); |
| 210 widget->SetBounds(bounds); | 210 widget->SetBounds(bounds); |
| 211 widget->Show(); | 211 widget->Show(); |
| 212 // This has to be called after Show() to have effect. | 212 // This has to be called after Show() to have effect. |
| 213 widget->SetOpacity(0xFF * kWindowAlphaValue); | 213 widget->SetOpacity(kWindowAlphaValue); |
| 214 widget->SetVisibleOnAllWorkspaces(true); | 214 widget->SetVisibleOnAllWorkspaces(true); |
| 215 | 215 |
| 216 #if defined(OS_WIN) | 216 #if defined(OS_WIN) |
| 217 return gfx::NativeViewId(views::HWNDForWidget(widget)); | 217 return gfx::NativeViewId(views::HWNDForWidget(widget)); |
| 218 #else | 218 #else |
| 219 return 0; | 219 return 0; |
| 220 #endif | 220 #endif |
| 221 } | 221 } |
| 222 | 222 |
| 223 gfx::Size ScreenCaptureNotificationUIViews::GetPreferredSize() const { | 223 gfx::Size ScreenCaptureNotificationUIViews::GetPreferredSize() const { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 | 331 |
| 332 } // namespace | 332 } // namespace |
| 333 | 333 |
| 334 std::unique_ptr<ScreenCaptureNotificationUI> | 334 std::unique_ptr<ScreenCaptureNotificationUI> |
| 335 ScreenCaptureNotificationUI::Create(const base::string16& text) { | 335 ScreenCaptureNotificationUI::Create(const base::string16& text) { |
| 336 return std::unique_ptr<ScreenCaptureNotificationUI>( | 336 return std::unique_ptr<ScreenCaptureNotificationUI>( |
| 337 new ScreenCaptureNotificationUIViews(text)); | 337 new ScreenCaptureNotificationUIViews(text)); |
| 338 } | 338 } |
| OLD | NEW |