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

Side by Side Diff: chrome/browser/views/location_bar_view.cc

Issue 291003: Implement badges for page actions. Also add badge text color API. (Closed)
Patch Set: argb Created 11 years, 2 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
« no previous file with comments | « chrome/browser/views/location_bar_view.h ('k') | chrome/common/extensions/extension_action.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_view.h" 5 #include "chrome/browser/views/location_bar_view.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 } 1165 }
1166 1166
1167 void LocationBarView::SecurityImageView::ShowInfoBubble() { 1167 void LocationBarView::SecurityImageView::ShowInfoBubble() {
1168 std::wstring text; 1168 std::wstring text;
1169 model_->GetIconHoverText(&text); 1169 model_->GetIconHoverText(&text);
1170 ShowInfoBubbleImpl(text, GetColor( 1170 ShowInfoBubbleImpl(text, GetColor(
1171 model_->GetSecurityLevel() == ToolbarModel::SECURE, 1171 model_->GetSecurityLevel() == ToolbarModel::SECURE,
1172 SECURITY_INFO_BUBBLE_TEXT)); 1172 SECURITY_INFO_BUBBLE_TEXT));
1173 } 1173 }
1174 1174
1175 void LocationBarView::PageActionImageView::Paint(gfx::Canvas* canvas) {
1176 LocationBarImageView::Paint(canvas);
1177
1178 TabContents* contents = owner_->delegate_->GetTabContents();
1179 if (!contents)
1180 return;
1181
1182 const ExtensionActionState* state =
1183 contents->GetPageActionState(page_action_);
1184 state->PaintBadge(canvas, gfx::Rect(width(), height()));
1185 }
1186
1175 // PageActionImageView---------------------------------------------------------- 1187 // PageActionImageView----------------------------------------------------------
1176 1188
1177 LocationBarView::PageActionImageView::PageActionImageView( 1189 LocationBarView::PageActionImageView::PageActionImageView(
1178 LocationBarView* owner, 1190 LocationBarView* owner,
1179 Profile* profile, 1191 Profile* profile,
1180 const ExtensionAction* page_action, 1192 const ExtensionAction* page_action,
1181 const BubblePositioner* bubble_positioner) 1193 const BubblePositioner* bubble_positioner)
1182 : LocationBarImageView(bubble_positioner), 1194 : LocationBarImageView(bubble_positioner),
1183 owner_(owner), 1195 owner_(owner),
1184 profile_(profile), 1196 profile_(profile),
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 } 1331 }
1320 1332
1321 int LocationBarView::PageActionVisibleCount() { 1333 int LocationBarView::PageActionVisibleCount() {
1322 int result = 0; 1334 int result = 0;
1323 for (size_t i = 0; i < page_action_image_views_.size(); i++) { 1335 for (size_t i = 0; i < page_action_image_views_.size(); i++) {
1324 if (page_action_image_views_[i]->IsVisible()) 1336 if (page_action_image_views_[i]->IsVisible())
1325 ++result; 1337 ++result;
1326 } 1338 }
1327 return result; 1339 return result;
1328 } 1340 }
OLDNEW
« no previous file with comments | « chrome/browser/views/location_bar_view.h ('k') | chrome/common/extensions/extension_action.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698