Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Side by Side Diff: chrome/browser/ui/views/screen_capture_notification_ui_views.cc

Issue 2816193002: Introduce a type of View background that stays in sync with its host (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/browser/ui/views/chrome_views_export.h" 9 #include "chrome/browser/ui/views/chrome_views_export.h"
10 #include "chrome/grit/generated_resources.h" 10 #include "chrome/grit/generated_resources.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // 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
186 // the primary monitor. 186 // the primary monitor.
187 if (ash::Shell::HasInstance()) 187 if (ash::Shell::HasInstance())
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::CreateThemedSolidBackground(
196 GetSystemColor(ui::NativeTheme::kColorId_DialogBackground))); 196 this, ui::NativeTheme::kColorId_DialogBackground));
197 197
198 display::Screen* screen = display::Screen::GetScreen(); 198 display::Screen* screen = display::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,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 } 325 }
326 326
327 } // namespace 327 } // namespace
328 328
329 std::unique_ptr<ScreenCaptureNotificationUI> 329 std::unique_ptr<ScreenCaptureNotificationUI>
330 ScreenCaptureNotificationUI::Create(const base::string16& text) { 330 ScreenCaptureNotificationUI::Create(const base::string16& text) {
331 return std::unique_ptr<ScreenCaptureNotificationUI>( 331 return std::unique_ptr<ScreenCaptureNotificationUI>(
332 new ScreenCaptureNotificationUIViews(text)); 332 new ScreenCaptureNotificationUIViews(text));
333 } 333 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698