OLD | NEW |
1 // Copyright (c) 2010 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/views/location_bar/page_action_with_badge_view.h" | 5 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" |
6 | 6 |
7 #include "chrome/browser/views/location_bar/page_action_image_view.h" | 7 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" |
8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
9 | 9 |
10 PageActionWithBadgeView::PageActionWithBadgeView( | 10 PageActionWithBadgeView::PageActionWithBadgeView( |
11 PageActionImageView* image_view) { | 11 PageActionImageView* image_view) { |
12 image_view_ = image_view; | 12 image_view_ = image_view; |
13 AddChildView(image_view_); | 13 AddChildView(image_view_); |
14 } | 14 } |
15 | 15 |
16 AccessibilityTypes::Role PageActionWithBadgeView::GetAccessibleRole() { | 16 AccessibilityTypes::Role PageActionWithBadgeView::GetAccessibleRole() { |
17 return AccessibilityTypes::ROLE_GROUPING; | 17 return AccessibilityTypes::ROLE_GROUPING; |
(...skipping 12 matching lines...) Expand all Loading... |
30 const SkBitmap& image = image_view()->GetImage(); | 30 const SkBitmap& image = image_view()->GetImage(); |
31 int y = (image.height() + 1) % 2; // Even numbers: 1px padding. Odd: 0px. | 31 int y = (image.height() + 1) % 2; // Even numbers: 1px padding. Odd: 0px. |
32 image_view_->SetBounds(0, y, width(), height()); | 32 image_view_->SetBounds(0, y, width(), height()); |
33 } | 33 } |
34 | 34 |
35 void PageActionWithBadgeView::UpdateVisibility(TabContents* contents, | 35 void PageActionWithBadgeView::UpdateVisibility(TabContents* contents, |
36 const GURL& url) { | 36 const GURL& url) { |
37 image_view_->UpdateVisibility(contents, url); | 37 image_view_->UpdateVisibility(contents, url); |
38 SetVisible(image_view_->IsVisible()); | 38 SetVisible(image_view_->IsVisible()); |
39 } | 39 } |
OLD | NEW |