| 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" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/ui/browser_finder.h" | 13 #include "chrome/browser/ui/browser_finder.h" |
| 14 #include "chrome/common/extensions/extension.h" | |
| 15 #include "content/public/browser/navigation_entry.h" | 14 #include "content/public/browser/navigation_entry.h" |
| 16 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
| 16 #include "extensions/common/extension.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 const extensions::Extension* GetExtensionForTab(Profile* profile, | 20 const extensions::Extension* GetExtensionForTab(Profile* profile, |
| 21 content::WebContents* tab) { | 21 content::WebContents* tab) { |
| 22 ExtensionService* extension_service = profile->GetExtensionService(); | 22 ExtensionService* extension_service = profile->GetExtensionService(); |
| 23 if (!extension_service || !extension_service->extensions_enabled()) | 23 if (!extension_service || !extension_service->extensions_enabled()) |
| 24 return NULL; | 24 return NULL; |
| 25 Browser* browser = chrome::FindBrowserWithWebContents(tab); | 25 Browser* browser = chrome::FindBrowserWithWebContents(tab); |
| 26 DCHECK(browser); | 26 DCHECK(browser); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 return extension ? extension->id() : std::string(); | 68 return extension ? extension->id() : std::string(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool LauncherAppTabHelper::IsValidIDForCurrentUser(const std::string& id) { | 71 bool LauncherAppTabHelper::IsValidIDForCurrentUser(const std::string& id) { |
| 72 return GetExtensionByID(profile_, id) != NULL; | 72 return GetExtensionByID(profile_, id) != NULL; |
| 73 } | 73 } |
| 74 | 74 |
| 75 void LauncherAppTabHelper::SetCurrentUser(Profile* profile) { | 75 void LauncherAppTabHelper::SetCurrentUser(Profile* profile) { |
| 76 profile_ = profile; | 76 profile_ = profile; |
| 77 } | 77 } |
| OLD | NEW |