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

Side by Side Diff: chrome/browser/ui/views/location_bar/page_action_with_badge_view.cc

Issue 7057014: Variety of tweaks to View API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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/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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | chrome/browser/ui/views/location_bar/star_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698