OLD | NEW |
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/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/ui/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 #include "ui/base/accessibility/accessible_view_state.h" | 9 #include "ui/base/accessibility/accessible_view_state.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // (padding) above and below. It looks better to have the extra pixel above | 30 // (padding) above and below. It looks better to have the extra pixel above |
31 // the icon than below it, so we add a pixel. http://crbug.com/25708. | 31 // the icon than below it, so we add a pixel. http://crbug.com/25708. |
32 const SkBitmap& image = image_view()->GetImage(); | 32 const SkBitmap& image = image_view()->GetImage(); |
33 int y = (image.height() + 1) % 2; // Even numbers: 1px padding. Odd: 0px. | 33 int y = (image.height() + 1) % 2; // Even numbers: 1px padding. Odd: 0px. |
34 image_view_->SetBounds(0, y, width(), height()); | 34 image_view_->SetBounds(0, y, width(), height()); |
35 } | 35 } |
36 | 36 |
37 void PageActionWithBadgeView::UpdateVisibility(TabContents* contents, | 37 void PageActionWithBadgeView::UpdateVisibility(TabContents* contents, |
38 const GURL& url) { | 38 const GURL& url) { |
39 image_view_->UpdateVisibility(contents, url); | 39 image_view_->UpdateVisibility(contents, url); |
40 SetVisible(image_view_->IsVisible()); | 40 SetVisible(image_view_->visible()); |
41 } | 41 } |
OLD | NEW |