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

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

Issue 215363003: Make the screenshare notification window 85% opaque. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 17 matching lines...) Expand all
28 #include "ui/views/win/hwnd_util.h" 28 #include "ui/views/win/hwnd_util.h"
29 #endif 29 #endif
30 30
31 namespace { 31 namespace {
32 32
33 const int kMinimumWidth = 460; 33 const int kMinimumWidth = 460;
34 const int kMaximumWidth = 1000; 34 const int kMaximumWidth = 1000;
35 const int kHorizontalMargin = 10; 35 const int kHorizontalMargin = 10;
36 const int kPadding = 5; 36 const int kPadding = 5;
37 const int kPaddingLeft = 10; 37 const int kPaddingLeft = 10;
38 const float kWindowAlphaValue = 0.85f;
38 39
39 namespace { 40 namespace {
40 41
41 // A ClientView that overrides NonClientHitTest() so that the whole window area 42 // A ClientView that overrides NonClientHitTest() so that the whole window area
42 // acts as a window caption, except a rect specified using SetClientRect(). 43 // acts as a window caption, except a rect specified using SetClientRect().
43 // ScreenCaptureNotificationUIViews uses this class to make the notification bar 44 // ScreenCaptureNotificationUIViews uses this class to make the notification bar
44 // draggable. 45 // draggable.
45 class NotificationBarClientView : public views::ClientView { 46 class NotificationBarClientView : public views::ClientView {
46 public: 47 public:
47 NotificationBarClientView(views::Widget* widget, views::View* view) 48 NotificationBarClientView(views::Widget* widget, views::View* view)
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // per-display screen capture is supported. 201 // per-display screen capture is supported.
201 gfx::Rect work_area = screen->GetPrimaryDisplay().work_area(); 202 gfx::Rect work_area = screen->GetPrimaryDisplay().work_area();
202 203
203 // 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.
204 gfx::Size size = widget->non_client_view()->GetPreferredSize(); 205 gfx::Size size = widget->non_client_view()->GetPreferredSize();
205 gfx::Rect bounds( 206 gfx::Rect bounds(
206 work_area.x() + work_area.width() / 2 - size.width() / 2, 207 work_area.x() + work_area.width() / 2 - size.width() / 2,
207 work_area.y() + work_area.height() - size.height(), 208 work_area.y() + work_area.height() - size.height(),
208 size.width(), size.height()); 209 size.width(), size.height());
209 widget->SetBounds(bounds); 210 widget->SetBounds(bounds);
210 211 widget->SetOpacity(0xFF * kWindowAlphaValue);
211 widget->Show(); 212 widget->Show();
212 213
213 #if defined(OS_WIN) 214 #if defined(OS_WIN)
214 return gfx::NativeViewId(views::HWNDForWidget(widget)); 215 return gfx::NativeViewId(views::HWNDForWidget(widget));
215 #else 216 #else
216 return 0; 217 return 0;
217 #endif 218 #endif
218 } 219 }
219 220
220 gfx::Size ScreenCaptureNotificationUIViews::GetPreferredSize() { 221 gfx::Size ScreenCaptureNotificationUIViews::GetPreferredSize() {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 } 327 }
327 } 328 }
328 329
329 } // namespace 330 } // namespace
330 331
331 scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create( 332 scoped_ptr<ScreenCaptureNotificationUI> ScreenCaptureNotificationUI::Create(
332 const base::string16& text) { 333 const base::string16& text) {
333 return scoped_ptr<ScreenCaptureNotificationUI>( 334 return scoped_ptr<ScreenCaptureNotificationUI>(
334 new ScreenCaptureNotificationUIViews(text)); 335 new ScreenCaptureNotificationUIViews(text));
335 } 336 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/screen_capture_notification_ui_cocoa.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698