| 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/extensions/tab_helper.h" | 5 #include "chrome/browser/extensions/tab_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/activity_log.h" | 7 #include "chrome/browser/extensions/activity_log.h" |
| 8 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h" | 8 #include "chrome/browser/extensions/api/declarative/rules_registry_service.h" |
| 9 #include "chrome/browser/extensions/api/declarative_content/content_rules_regist
ry.h" | 9 #include "chrome/browser/extensions/api/declarative_content/content_rules_regist
ry.h" |
| 10 #include "chrome/browser/extensions/app_notify_channel_ui.h" | 10 #include "chrome/browser/extensions/app_notify_channel_ui.h" |
| 11 #include "chrome/browser/extensions/crx_installer.h" | 11 #include "chrome/browser/extensions/crx_installer.h" |
| 12 #include "chrome/browser/extensions/extension_action.h" | 12 #include "chrome/browser/extensions/extension_action.h" |
| 13 #include "chrome/browser/extensions/extension_action_manager.h" | 13 #include "chrome/browser/extensions/extension_action_manager.h" |
| 14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "chrome/browser/extensions/extension_system.h" | 15 #include "chrome/browser/extensions/extension_system.h" |
| 16 #include "chrome/browser/extensions/extension_tab_util.h" | 16 #include "chrome/browser/extensions/extension_tab_util.h" |
| 17 #include "chrome/browser/extensions/image_loader.h" | 17 #include "chrome/browser/extensions/image_loader.h" |
| 18 #include "chrome/browser/extensions/page_action_controller.h" | 18 #include "chrome/browser/extensions/page_action_controller.h" |
| 19 #include "chrome/browser/extensions/script_badge_controller.h" | 19 #include "chrome/browser/extensions/script_badge_controller.h" |
| 20 #include "chrome/browser/extensions/script_bubble_controller.h" | 20 #include "chrome/browser/extensions/script_bubble_controller.h" |
| 21 #include "chrome/browser/extensions/script_executor.h" | 21 #include "chrome/browser/extensions/script_executor.h" |
| 22 #include "chrome/browser/extensions/webstore_standalone_installer.h" | 22 #include "chrome/browser/extensions/webstore_standalone_installer.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/sessions/session_id.h" | 24 #include "chrome/browser/sessions/session_id.h" |
| 25 #include "chrome/browser/sessions/session_tab_helper.h" | 25 #include "chrome/browser/sessions/session_tab_helper.h" |
| 26 #include "chrome/browser/ui/browser_dialogs.h" | 26 #include "chrome/browser/ui/browser_dialogs.h" |
| 27 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 27 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
| 28 #include "chrome/browser/web_applications/web_app.h" | 28 #include "chrome/browser/web_applications/web_app.h" |
| 29 #include "chrome/common/chrome_notification_types.h" | 29 #include "chrome/common/chrome_notification_types.h" |
| 30 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 30 #include "chrome/common/extensions/extension.h" | 31 #include "chrome/common/extensions/extension.h" |
| 31 #include "chrome/common/extensions/extension_constants.h" | 32 #include "chrome/common/extensions/extension_constants.h" |
| 32 #include "chrome/common/extensions/extension_icon_set.h" | 33 #include "chrome/common/extensions/extension_icon_set.h" |
| 33 #include "chrome/common/extensions/extension_messages.h" | 34 #include "chrome/common/extensions/extension_messages.h" |
| 34 #include "chrome/common/extensions/extension_resource.h" | 35 #include "chrome/common/extensions/extension_resource.h" |
| 35 #include "chrome/common/extensions/feature_switch.h" | 36 #include "chrome/common/extensions/feature_switch.h" |
| 36 #include "content/public/browser/invalidate_type.h" | 37 #include "content/public/browser/invalidate_type.h" |
| 37 #include "content/public/browser/navigation_controller.h" | 38 #include "content/public/browser/navigation_controller.h" |
| 38 #include "content/public/browser/navigation_details.h" | 39 #include "content/public/browser/navigation_details.h" |
| 39 #include "content/public/browser/navigation_entry.h" | 40 #include "content/public/browser/navigation_entry.h" |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 // Ensure previously enqueued callbacks are ignored. | 465 // Ensure previously enqueued callbacks are ignored. |
| 465 image_loader_ptr_factory_.InvalidateWeakPtrs(); | 466 image_loader_ptr_factory_.InvalidateWeakPtrs(); |
| 466 | 467 |
| 467 // Enqueue OnImageLoaded callback. | 468 // Enqueue OnImageLoaded callback. |
| 468 if (extension) { | 469 if (extension) { |
| 469 Profile* profile = | 470 Profile* profile = |
| 470 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); | 471 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| 471 extensions::ImageLoader* loader = extensions::ImageLoader::Get(profile); | 472 extensions::ImageLoader* loader = extensions::ImageLoader::Get(profile); |
| 472 loader->LoadImageAsync( | 473 loader->LoadImageAsync( |
| 473 extension, | 474 extension, |
| 474 extension->GetIconResource(extension_misc::EXTENSION_ICON_SMALLISH, | 475 IconsInfo::GetIconResource(extension, |
| 476 extension_misc::EXTENSION_ICON_SMALLISH, |
| 475 ExtensionIconSet::MATCH_EXACTLY), | 477 ExtensionIconSet::MATCH_EXACTLY), |
| 476 gfx::Size(extension_misc::EXTENSION_ICON_SMALLISH, | 478 gfx::Size(extension_misc::EXTENSION_ICON_SMALLISH, |
| 477 extension_misc::EXTENSION_ICON_SMALLISH), | 479 extension_misc::EXTENSION_ICON_SMALLISH), |
| 478 base::Bind(&TabHelper::OnImageLoaded, | 480 base::Bind(&TabHelper::OnImageLoaded, |
| 479 image_loader_ptr_factory_.GetWeakPtr())); | 481 image_loader_ptr_factory_.GetWeakPtr())); |
| 480 } | 482 } |
| 481 } | 483 } |
| 482 | 484 |
| 483 void TabHelper::SetAppIcon(const SkBitmap& app_icon) { | 485 void TabHelper::SetAppIcon(const SkBitmap& app_icon) { |
| 484 extension_app_icon_ = app_icon; | 486 extension_app_icon_ = app_icon; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 script_bubble_controller_->OnExtensionUnloaded( | 547 script_bubble_controller_->OnExtensionUnloaded( |
| 546 content::Details<extensions::UnloadedExtensionInfo>( | 548 content::Details<extensions::UnloadedExtensionInfo>( |
| 547 details)->extension->id()); | 549 details)->extension->id()); |
| 548 break; | 550 break; |
| 549 } | 551 } |
| 550 } | 552 } |
| 551 } | 553 } |
| 552 } | 554 } |
| 553 | 555 |
| 554 } // namespace extensions | 556 } // namespace extensions |
| OLD | NEW |