| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/toolbar/browser_action_view.h" | 5 #include "chrome/browser/ui/views/toolbar/browser_action_view.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/extensions/api/commands/command_service.h" | 9 #include "chrome/browser/extensions/api/commands/command_service.h" |
| 10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" | 10 #include "chrome/browser/extensions/dev_mode_bubble_controller.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 gfx::ImageSkia icon = *icon_factory_.GetIcon(tab_id).ToImageSkia(); | 234 gfx::ImageSkia icon = *icon_factory_.GetIcon(tab_id).ToImageSkia(); |
| 235 | 235 |
| 236 if (!icon.isNull()) { | 236 if (!icon.isNull()) { |
| 237 if (!browser_action()->GetIsVisible(tab_id)) | 237 if (!browser_action()->GetIsVisible(tab_id)) |
| 238 icon = gfx::ImageSkiaOperations::CreateTransparentImage(icon, .25); | 238 icon = gfx::ImageSkiaOperations::CreateTransparentImage(icon, .25); |
| 239 | 239 |
| 240 ThemeService* theme = | 240 ThemeService* theme = |
| 241 ThemeServiceFactory::GetForProfile(browser_->profile()); | 241 ThemeServiceFactory::GetForProfile(browser_->profile()); |
| 242 | 242 |
| 243 int background_id = IDR_BROWSER_ACTION; | 243 int background_id = IDR_BROWSER_ACTION; |
| 244 extensions::DevModeBubbleController* controller = | 244 if (extensions::DevModeBubbleController::IsDevModeExtension(extension_)) |
| 245 extensions::DevModeBubbleController::Get( | |
| 246 browser_->profile()); | |
| 247 if (controller->IsDevModeExtension(extension_)) | |
| 248 background_id = IDR_BROWSER_ACTION_HIGHLIGHT; | 245 background_id = IDR_BROWSER_ACTION_HIGHLIGHT; |
| 249 | 246 |
| 250 gfx::ImageSkia bg = *theme->GetImageSkiaNamed(background_id); | 247 gfx::ImageSkia bg = *theme->GetImageSkiaNamed(background_id); |
| 251 SetIcon(gfx::ImageSkiaOperations::CreateSuperimposedImage(bg, icon)); | 248 SetIcon(gfx::ImageSkiaOperations::CreateSuperimposedImage(bg, icon)); |
| 252 | 249 |
| 253 gfx::ImageSkia bg_h = *theme->GetImageSkiaNamed(IDR_BROWSER_ACTION_H); | 250 gfx::ImageSkia bg_h = *theme->GetImageSkiaNamed(IDR_BROWSER_ACTION_H); |
| 254 SetHoverIcon(gfx::ImageSkiaOperations::CreateSuperimposedImage(bg_h, icon)); | 251 SetHoverIcon(gfx::ImageSkiaOperations::CreateSuperimposedImage(bg_h, icon)); |
| 255 | 252 |
| 256 gfx::ImageSkia bg_p = *theme->GetImageSkiaNamed(IDR_BROWSER_ACTION_P); | 253 gfx::ImageSkia bg_p = *theme->GetImageSkiaNamed(IDR_BROWSER_ACTION_P); |
| 257 SetPushedIcon( | 254 SetPushedIcon( |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 extensions::Command browser_action_command; | 426 extensions::Command browser_action_command; |
| 430 if (!only_if_active || !command_service->GetBrowserActionCommand( | 427 if (!only_if_active || !command_service->GetBrowserActionCommand( |
| 431 extension_->id(), | 428 extension_->id(), |
| 432 extensions::CommandService::ACTIVE_ONLY, | 429 extensions::CommandService::ACTIVE_ONLY, |
| 433 &browser_action_command, | 430 &browser_action_command, |
| 434 NULL)) { | 431 NULL)) { |
| 435 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); | 432 GetFocusManager()->UnregisterAccelerator(*keybinding_.get(), this); |
| 436 keybinding_.reset(NULL); | 433 keybinding_.reset(NULL); |
| 437 } | 434 } |
| 438 } | 435 } |
| OLD | NEW |