| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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/api/icons/icons_handler.h" |
| 31 #include "chrome/common/extensions/app_launcher_info.h" |
| 31 #include "chrome/common/extensions/extension.h" | 32 #include "chrome/common/extensions/extension.h" |
| 32 #include "chrome/common/extensions/extension_constants.h" | 33 #include "chrome/common/extensions/extension_constants.h" |
| 33 #include "chrome/common/extensions/extension_icon_set.h" | 34 #include "chrome/common/extensions/extension_icon_set.h" |
| 34 #include "chrome/common/extensions/extension_messages.h" | 35 #include "chrome/common/extensions/extension_messages.h" |
| 35 #include "chrome/common/extensions/extension_resource.h" | 36 #include "chrome/common/extensions/extension_resource.h" |
| 36 #include "chrome/common/extensions/feature_switch.h" | 37 #include "chrome/common/extensions/feature_switch.h" |
| 37 #include "content/public/browser/invalidate_type.h" | 38 #include "content/public/browser/invalidate_type.h" |
| 38 #include "content/public/browser/navigation_controller.h" | 39 #include "content/public/browser/navigation_controller.h" |
| 39 #include "content/public/browser/navigation_details.h" | 40 #include "content/public/browser/navigation_details.h" |
| 40 #include "content/public/browser/navigation_entry.h" | 41 #include "content/public/browser/navigation_entry.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 bool TabHelper::CanCreateApplicationShortcuts() const { | 151 bool TabHelper::CanCreateApplicationShortcuts() const { |
| 151 #if defined(OS_MACOSX) | 152 #if defined(OS_MACOSX) |
| 152 return false; | 153 return false; |
| 153 #else | 154 #else |
| 154 return web_app::IsValidUrl(web_contents()->GetURL()) && | 155 return web_app::IsValidUrl(web_contents()->GetURL()) && |
| 155 pending_web_app_action_ == NONE; | 156 pending_web_app_action_ == NONE; |
| 156 #endif | 157 #endif |
| 157 } | 158 } |
| 158 | 159 |
| 159 void TabHelper::SetExtensionApp(const Extension* extension) { | 160 void TabHelper::SetExtensionApp(const Extension* extension) { |
| 160 DCHECK(!extension || extension->GetFullLaunchURL().is_valid()); | 161 DCHECK(!extension || AppLauncherInfo::GetFullLaunchURL(extension).is_valid()); |
| 161 extension_app_ = extension; | 162 extension_app_ = extension; |
| 162 | 163 |
| 163 UpdateExtensionAppIcon(extension_app_); | 164 UpdateExtensionAppIcon(extension_app_); |
| 164 | 165 |
| 165 content::NotificationService::current()->Notify( | 166 content::NotificationService::current()->Notify( |
| 166 chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, | 167 chrome::NOTIFICATION_TAB_CONTENTS_APPLICATION_EXTENSION_CHANGED, |
| 167 content::Source<TabHelper>(this), | 168 content::Source<TabHelper>(this), |
| 168 content::NotificationService::NoDetails()); | 169 content::NotificationService::NoDetails()); |
| 169 } | 170 } |
| 170 | 171 |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 script_bubble_controller_->OnExtensionUnloaded( | 548 script_bubble_controller_->OnExtensionUnloaded( |
| 548 content::Details<extensions::UnloadedExtensionInfo>( | 549 content::Details<extensions::UnloadedExtensionInfo>( |
| 549 details)->extension->id()); | 550 details)->extension->id()); |
| 550 break; | 551 break; |
| 551 } | 552 } |
| 552 } | 553 } |
| 553 } | 554 } |
| 554 } | 555 } |
| 555 | 556 |
| 556 } // namespace extensions | 557 } // namespace extensions |
| OLD | NEW |