| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 // static | 475 // static |
| 476 void BrowserView::Paint1pxHorizontalLine(gfx::Canvas* canvas, | 476 void BrowserView::Paint1pxHorizontalLine(gfx::Canvas* canvas, |
| 477 SkColor color, | 477 SkColor color, |
| 478 const gfx::Rect& bounds, | 478 const gfx::Rect& bounds, |
| 479 bool at_bottom) { | 479 bool at_bottom) { |
| 480 gfx::ScopedCanvas scoped_canvas(canvas); | 480 gfx::ScopedCanvas scoped_canvas(canvas); |
| 481 const float scale = canvas->UndoDeviceScaleFactor(); | 481 const float scale = canvas->UndoDeviceScaleFactor(); |
| 482 gfx::RectF rect(gfx::ScaleRect(gfx::RectF(bounds), scale)); | 482 gfx::RectF rect(gfx::ScaleRect(gfx::RectF(bounds), scale)); |
| 483 const float inset = rect.height() - 1; | 483 const float inset = rect.height() - 1; |
| 484 rect.Inset(0, at_bottom ? inset : 0, 0, at_bottom ? 0 : inset); | 484 rect.Inset(0, at_bottom ? inset : 0, 0, at_bottom ? 0 : inset); |
| 485 cc::PaintFlags paint; | 485 cc::PaintFlags flags; |
| 486 paint.setColor(color); | 486 flags.setColor(color); |
| 487 canvas->sk_canvas()->drawRect(gfx::RectFToSkRect(rect), paint); | 487 canvas->sk_canvas()->drawRect(gfx::RectFToSkRect(rect), flags); |
| 488 } | 488 } |
| 489 | 489 |
| 490 void BrowserView::InitStatusBubble() { | 490 void BrowserView::InitStatusBubble() { |
| 491 status_bubble_.reset( | 491 status_bubble_.reset( |
| 492 new StatusBubbleViews(contents_web_view_, HasClientEdge())); | 492 new StatusBubbleViews(contents_web_view_, HasClientEdge())); |
| 493 contents_web_view_->SetStatusBubble(status_bubble_.get()); | 493 contents_web_view_->SetStatusBubble(status_bubble_.get()); |
| 494 } | 494 } |
| 495 | 495 |
| 496 gfx::Rect BrowserView::GetToolbarBounds() const { | 496 gfx::Rect BrowserView::GetToolbarBounds() const { |
| 497 gfx::Rect toolbar_bounds(toolbar_->bounds()); | 497 gfx::Rect toolbar_bounds(toolbar_->bounds()); |
| (...skipping 2132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2630 } | 2630 } |
| 2631 | 2631 |
| 2632 extensions::ActiveTabPermissionGranter* | 2632 extensions::ActiveTabPermissionGranter* |
| 2633 BrowserView::GetActiveTabPermissionGranter() { | 2633 BrowserView::GetActiveTabPermissionGranter() { |
| 2634 content::WebContents* web_contents = GetActiveWebContents(); | 2634 content::WebContents* web_contents = GetActiveWebContents(); |
| 2635 if (!web_contents) | 2635 if (!web_contents) |
| 2636 return nullptr; | 2636 return nullptr; |
| 2637 return extensions::TabHelper::FromWebContents(web_contents) | 2637 return extensions::TabHelper::FromWebContents(web_contents) |
| 2638 ->active_tab_permission_granter(); | 2638 ->active_tab_permission_granter(); |
| 2639 } | 2639 } |
| OLD | NEW |