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

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

Issue 8122013: Allow CanvasSkia to bind to an existing SkCanvas. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 1 more fix Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/views/fullscreen_exit_bubble_views.h" 5 #include "chrome/browser/ui/views/fullscreen_exit_bubble_views.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "grit/generated_resources.h" 10 #include "grit/generated_resources.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 rect.set(0, -padding, SkIntToScalar(width()), SkIntToScalar(height())); 89 rect.set(0, -padding, SkIntToScalar(width()), SkIntToScalar(height()));
90 SkScalar rad[8] = { 0, 0, 0, 0, padding, padding, padding, padding }; 90 SkScalar rad[8] = { 0, 0, 0, 0, padding, padding, padding, padding };
91 SkPath path; 91 SkPath path;
92 path.addRoundRect(rect, rad, SkPath::kCW_Direction); 92 path.addRoundRect(rect, rad, SkPath::kCW_Direction);
93 93
94 // Fill it black. 94 // Fill it black.
95 SkPaint paint; 95 SkPaint paint;
96 paint.setStyle(SkPaint::kFill_Style); 96 paint.setStyle(SkPaint::kFill_Style);
97 paint.setFlags(SkPaint::kAntiAlias_Flag); 97 paint.setFlags(SkPaint::kAntiAlias_Flag);
98 paint.setColor(SK_ColorBLACK); 98 paint.setColor(SK_ColorBLACK);
99 canvas->AsCanvasSkia()->drawPath(path, paint); 99 canvas->GetSkCanvas()->drawPath(path, paint);
100 } 100 }
101 101
102 // FullscreenExitBubbleViews --------------------------------------------------- 102 // FullscreenExitBubbleViews ---------------------------------------------------
103 103
104 FullscreenExitBubbleViews::FullscreenExitBubbleViews( 104 FullscreenExitBubbleViews::FullscreenExitBubbleViews(
105 views::Widget* frame, 105 views::Widget* frame,
106 CommandUpdater::CommandUpdaterDelegate* delegate) 106 CommandUpdater::CommandUpdaterDelegate* delegate)
107 : FullscreenExitBubble(delegate), 107 : FullscreenExitBubble(delegate),
108 root_view_(frame->GetRootView()), 108 root_view_(frame->GetRootView()),
109 popup_(NULL), 109 popup_(NULL),
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 205 }
206 // NOTE: don't use the bounds of the root_view_. On linux changing window 206 // NOTE: don't use the bounds of the root_view_. On linux changing window
207 // size is async. Instead we use the size of the screen. 207 // size is async. Instead we use the size of the screen.
208 gfx::Rect screen_bounds = gfx::Screen::GetMonitorAreaNearestWindow( 208 gfx::Rect screen_bounds = gfx::Screen::GetMonitorAreaNearestWindow(
209 root_view_->GetWidget()->GetNativeView()); 209 root_view_->GetWidget()->GetNativeView());
210 gfx::Point origin(screen_bounds.x() + 210 gfx::Point origin(screen_bounds.x() +
211 (screen_bounds.width() - size.width()) / 2, 211 (screen_bounds.width() - size.width()) / 2,
212 screen_bounds.y()); 212 screen_bounds.y());
213 return gfx::Rect(origin, size); 213 return gfx::Rect(origin, size);
214 } 214 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698