OLD | NEW |
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/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/browser_actions_container.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 button_->Destroy(); | 326 button_->Destroy(); |
327 } | 327 } |
328 | 328 |
329 gfx::Canvas* BrowserActionView::GetIconWithBadge() { | 329 gfx::Canvas* BrowserActionView::GetIconWithBadge() { |
330 int tab_id = panel_->GetCurrentTabId(); | 330 int tab_id = panel_->GetCurrentTabId(); |
331 | 331 |
332 SkBitmap icon = button_->extension()->browser_action()->GetIcon(tab_id); | 332 SkBitmap icon = button_->extension()->browser_action()->GetIcon(tab_id); |
333 if (icon.isNull()) | 333 if (icon.isNull()) |
334 icon = button_->default_icon(); | 334 icon = button_->default_icon(); |
335 | 335 |
336 gfx::Canvas* canvas = new gfx::CanvasSkia(icon, false); | 336 gfx::Canvas* canvas = new gfx::Canvas(icon, false); |
337 | 337 |
338 if (tab_id >= 0) { | 338 if (tab_id >= 0) { |
339 gfx::Rect bounds(icon.width(), icon.height() + ToolbarView::kVertSpacing); | 339 gfx::Rect bounds(icon.width(), icon.height() + ToolbarView::kVertSpacing); |
340 button_->extension()->browser_action()->PaintBadge(canvas, bounds, tab_id); | 340 button_->extension()->browser_action()->PaintBadge(canvas, bounds, tab_id); |
341 } | 341 } |
342 | 342 |
343 return canvas; | 343 return canvas; |
344 } | 344 } |
345 | 345 |
346 void BrowserActionView::Layout() { | 346 void BrowserActionView::Layout() { |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 } | 1126 } |
1127 } | 1127 } |
1128 | 1128 |
1129 bool BrowserActionsContainer::ShouldDisplayBrowserAction( | 1129 bool BrowserActionsContainer::ShouldDisplayBrowserAction( |
1130 const Extension* extension) { | 1130 const Extension* extension) { |
1131 // Only display incognito-enabled extensions while in incognito mode. | 1131 // Only display incognito-enabled extensions while in incognito mode. |
1132 return | 1132 return |
1133 (!profile_->IsOffTheRecord() || | 1133 (!profile_->IsOffTheRecord() || |
1134 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); | 1134 profile_->GetExtensionService()->IsIncognitoEnabled(extension->id())); |
1135 } | 1135 } |
OLD | NEW |