| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 params.context = ash::Shell::GetPrimaryRootWindow(); | 188 params.context = ash::Shell::GetPrimaryRootWindow(); |
| 189 #endif | 189 #endif |
| 190 | 190 |
| 191 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); | 191 widget->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); |
| 192 widget->Init(params); | 192 widget->Init(params); |
| 193 widget->SetAlwaysOnTop(true); | 193 widget->SetAlwaysOnTop(true); |
| 194 | 194 |
| 195 set_background(views::Background::CreateSolidBackground(GetNativeTheme()-> | 195 set_background(views::Background::CreateSolidBackground(GetNativeTheme()-> |
| 196 GetSystemColor(ui::NativeTheme::kColorId_DialogBackground))); | 196 GetSystemColor(ui::NativeTheme::kColorId_DialogBackground))); |
| 197 | 197 |
| 198 gfx::Screen* screen = gfx::Screen::GetNativeScreen(); | 198 gfx::Screen* screen = gfx::Screen::GetScreen(); |
| 199 // TODO(sergeyu): Move the notification to the display being captured when | 199 // TODO(sergeyu): Move the notification to the display being captured when |
| 200 // per-display screen capture is supported. | 200 // per-display screen capture is supported. |
| 201 gfx::Rect work_area = screen->GetPrimaryDisplay().work_area(); | 201 gfx::Rect work_area = screen->GetPrimaryDisplay().work_area(); |
| 202 | 202 |
| 203 // Place the bar in the center of the bottom of the display. | 203 // Place the bar in the center of the bottom of the display. |
| 204 gfx::Size size = widget->non_client_view()->GetPreferredSize(); | 204 gfx::Size size = widget->non_client_view()->GetPreferredSize(); |
| 205 gfx::Rect bounds( | 205 gfx::Rect bounds( |
| 206 work_area.x() + work_area.width() / 2 - size.width() / 2, | 206 work_area.x() + work_area.width() / 2 - size.width() / 2, |
| 207 work_area.y() + work_area.height() - size.height(), | 207 work_area.y() + work_area.height() - size.height(), |
| 208 size.width(), size.height()); | 208 size.width(), size.height()); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 | 332 |
| 333 } // namespace | 333 } // namespace |
| 334 | 334 |
| 335 scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( | 335 scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( |
| 336 const base::string16& text) { | 336 const base::string16& text) { |
| 337 return scoped_ptr<ScreenCaptureNotificationUI>( | 337 return scoped_ptr<ScreenCaptureNotificationUI>( |
| 338 new ScreenCaptureNotificationUIViews(text)); | 338 new ScreenCaptureNotificationUIViews(text)); |
| 339 } | 339 } |
| OLD | NEW |