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

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

Issue 13460012: Move IconsHandler from c/c/e/api/ to c/c/e (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master for CQ Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/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/api/icons/icons_handler.h" 8 #include "chrome/common/extensions/manifest_handlers/icons_handler.h"
9 #include "chrome/common/extensions/extension.h"
10 #include "ui/base/accessibility/accessible_view_state.h" 9 #include "ui/base/accessibility/accessible_view_state.h"
11 10
12 using content::WebContents; 11 using content::WebContents;
13 12
14 PageActionWithBadgeView::PageActionWithBadgeView( 13 PageActionWithBadgeView::PageActionWithBadgeView(
15 PageActionImageView* image_view) { 14 PageActionImageView* image_view) {
16 image_view_ = image_view; 15 image_view_ = image_view;
17 AddChildView(image_view_); 16 AddChildView(image_view_);
18 TouchableLocationBarView::Init(this); 17 TouchableLocationBarView::Init(this);
19 } 18 }
(...skipping 20 matching lines...) Expand all
40 const gfx::ImageSkia& image = image_view()->GetImage(); 39 const gfx::ImageSkia& image = image_view()->GetImage();
41 int y = (image.height() + 1) % 2; // Even numbers: 1px padding. Odd: 0px. 40 int y = (image.height() + 1) % 2; // Even numbers: 1px padding. Odd: 0px.
42 image_view_->SetBounds(0, y, width(), height()); 41 image_view_->SetBounds(0, y, width(), height());
43 } 42 }
44 43
45 void PageActionWithBadgeView::UpdateVisibility(WebContents* contents, 44 void PageActionWithBadgeView::UpdateVisibility(WebContents* contents,
46 const GURL& url) { 45 const GURL& url) {
47 image_view_->UpdateVisibility(contents, url); 46 image_view_->UpdateVisibility(contents, url);
48 SetVisible(image_view_->visible()); 47 SetVisible(image_view_->visible());
49 } 48 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/extension_infobar.cc ('k') | chrome/browser/ui/views/script_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698