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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 if (ExtensionSystem::Get(profile_)->extension_service() && | 223 if (ExtensionSystem::Get(profile_)->extension_service() && |
224 RulesRegistryService::Get(profile_)) { | 224 RulesRegistryService::Get(profile_)) { |
225 RulesRegistryService::Get(profile_)->content_rules_registry()-> | 225 RulesRegistryService::Get(profile_)->content_rules_registry()-> |
226 DidNavigateMainFrame(web_contents(), details, params); | 226 DidNavigateMainFrame(web_contents(), details, params); |
227 } | 227 } |
228 | 228 |
229 content::BrowserContext* context = web_contents()->GetBrowserContext(); | 229 content::BrowserContext* context = web_contents()->GetBrowserContext(); |
230 ExtensionRegistry* registry = ExtensionRegistry::Get(context); | 230 ExtensionRegistry* registry = ExtensionRegistry::Get(context); |
231 const ExtensionSet& enabled_extensions = registry->enabled_extensions(); | 231 const ExtensionSet& enabled_extensions = registry->enabled_extensions(); |
232 | 232 |
233 if (util::IsStreamlinedHostedAppsEnabled()) { | 233 if (util::IsNewBookmarkAppsEnabled()) { |
234 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); | 234 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); |
235 if (browser && browser->is_app()) { | 235 if (browser && browser->is_app()) { |
236 const Extension* extension = registry->GetExtensionById( | 236 const Extension* extension = registry->GetExtensionById( |
237 web_app::GetExtensionIdFromApplicationName(browser->app_name()), | 237 web_app::GetExtensionIdFromApplicationName(browser->app_name()), |
238 ExtensionRegistry::EVERYTHING); | 238 ExtensionRegistry::EVERYTHING); |
239 if (extension && AppLaunchInfo::GetFullLaunchURL(extension).is_valid()) | 239 if (extension && AppLaunchInfo::GetFullLaunchURL(extension).is_valid()) |
240 SetExtensionApp(extension); | 240 SetExtensionApp(extension); |
241 } else { | 241 } else { |
242 UpdateExtensionAppIcon( | 242 UpdateExtensionAppIcon( |
243 enabled_extensions.GetExtensionOrAppByURL(params.url)); | 243 enabled_extensions.GetExtensionOrAppByURL(params.url)); |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 } | 595 } |
596 } | 596 } |
597 | 597 |
598 void TabHelper::SetTabId(RenderViewHost* render_view_host) { | 598 void TabHelper::SetTabId(RenderViewHost* render_view_host) { |
599 render_view_host->Send( | 599 render_view_host->Send( |
600 new ExtensionMsg_SetTabId(render_view_host->GetRoutingID(), | 600 new ExtensionMsg_SetTabId(render_view_host->GetRoutingID(), |
601 SessionTabHelper::IdForTab(web_contents()))); | 601 SessionTabHelper::IdForTab(web_contents()))); |
602 } | 602 } |
603 | 603 |
604 } // namespace extensions | 604 } // namespace extensions |
OLD | NEW |