| 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/ash/launcher/launcher_app_tab_helper.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_app_tab_helper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 } | 46 } |
| 47 | 47 |
| 48 const GURL url = tab->GetURL(); | 48 const GURL url = tab->GetURL(); |
| 49 const extensions::ExtensionSet& extensions = registry->enabled_extensions(); | 49 const extensions::ExtensionSet& extensions = registry->enabled_extensions(); |
| 50 const extensions::Extension* extension = extensions.GetAppByURL(url); | 50 const extensions::Extension* extension = extensions.GetAppByURL(url); |
| 51 if (extension) | 51 if (extension) |
| 52 return extension; | 52 return extension; |
| 53 | 53 |
| 54 // Bookmark app windows should match their launch url extension despite | 54 // Bookmark app windows should match their launch url extension despite |
| 55 // their web extents. | 55 // their web extents. |
| 56 if (extensions::util::IsStreamlinedHostedAppsEnabled()) { | 56 if (extensions::util::IsNewBookmarkAppsEnabled()) { |
| 57 for (extensions::ExtensionSet::const_iterator it = extensions.begin(); | 57 for (extensions::ExtensionSet::const_iterator it = extensions.begin(); |
| 58 it != extensions.end(); ++it) { | 58 it != extensions.end(); ++it) { |
| 59 if (it->get()->from_bookmark() && | 59 if (it->get()->from_bookmark() && |
| 60 extensions::AppLaunchInfo::GetLaunchWebURL(it->get()) == url) { | 60 extensions::AppLaunchInfo::GetLaunchWebURL(it->get()) == url) { |
| 61 return it->get(); | 61 return it->get(); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 return NULL; | 65 return NULL; |
| 66 } | 66 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 return extension ? extension->id() : std::string(); | 101 return extension ? extension->id() : std::string(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool LauncherAppTabHelper::IsValidIDForCurrentUser(const std::string& id) { | 104 bool LauncherAppTabHelper::IsValidIDForCurrentUser(const std::string& id) { |
| 105 return GetExtensionByID(profile_, id) != NULL; | 105 return GetExtensionByID(profile_, id) != NULL; |
| 106 } | 106 } |
| 107 | 107 |
| 108 void LauncherAppTabHelper::SetCurrentUser(Profile* profile) { | 108 void LauncherAppTabHelper::SetCurrentUser(Profile* profile) { |
| 109 profile_ = profile; | 109 profile_ = profile; |
| 110 } | 110 } |
| OLD | NEW |