OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 #include "chrome/browser/web_applications/web_app.h" | 63 #include "chrome/browser/web_applications/web_app.h" |
64 #include "chrome/common/chrome_switches.h" | 64 #include "chrome/common/chrome_switches.h" |
65 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 65 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
66 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" | 66 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
67 #include "chrome/common/pref_names.h" | 67 #include "chrome/common/pref_names.h" |
68 #include "chrome/common/url_constants.h" | 68 #include "chrome/common/url_constants.h" |
69 #include "content/public/browser/navigation_entry.h" | 69 #include "content/public/browser/navigation_entry.h" |
70 #include "content/public/browser/notification_registrar.h" | 70 #include "content/public/browser/notification_registrar.h" |
71 #include "content/public/browser/notification_service.h" | 71 #include "content/public/browser/notification_service.h" |
72 #include "content/public/browser/web_contents.h" | 72 #include "content/public/browser/web_contents.h" |
| 73 #include "extensions/browser/extension_prefs.h" |
73 #include "extensions/browser/extension_system.h" | 74 #include "extensions/browser/extension_system.h" |
74 #include "extensions/common/extension.h" | 75 #include "extensions/common/extension.h" |
75 #include "extensions/common/extension_resource.h" | 76 #include "extensions/common/extension_resource.h" |
76 #include "extensions/common/url_pattern.h" | 77 #include "extensions/common/url_pattern.h" |
77 #include "grit/ash_resources.h" | 78 #include "grit/ash_resources.h" |
78 #include "grit/chromium_strings.h" | 79 #include "grit/chromium_strings.h" |
79 #include "grit/generated_resources.h" | 80 #include "grit/generated_resources.h" |
80 #include "grit/theme_resources.h" | 81 #include "grit/theme_resources.h" |
81 #include "grit/ui_resources.h" | 82 #include "grit/ui_resources.h" |
82 #include "net/base/url_util.h" | 83 #include "net/base/url_util.h" |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 ash::ShelfID id) { | 695 ash::ShelfID id) { |
695 DCHECK(HasItemController(id)); | 696 DCHECK(HasItemController(id)); |
696 | 697 |
697 const Extension* extension = GetExtensionForAppID( | 698 const Extension* extension = GetExtensionForAppID( |
698 id_to_item_controller_map_[id]->app_id()); | 699 id_to_item_controller_map_[id]->app_id()); |
699 | 700 |
700 // An extension can be unloaded/updated/unavailable at any time. | 701 // An extension can be unloaded/updated/unavailable at any time. |
701 if (!extension) | 702 if (!extension) |
702 return extensions::LAUNCH_TYPE_DEFAULT; | 703 return extensions::LAUNCH_TYPE_DEFAULT; |
703 | 704 |
704 return extensions::GetLaunchType( | 705 return extensions::GetLaunchType(extensions::ExtensionPrefs::Get(profile_), |
705 profile_->GetExtensionService()->extension_prefs(), | 706 extension); |
706 extension); | |
707 } | 707 } |
708 | 708 |
709 ash::ShelfID ChromeLauncherController::GetShelfIDForAppID( | 709 ash::ShelfID ChromeLauncherController::GetShelfIDForAppID( |
710 const std::string& app_id) { | 710 const std::string& app_id) { |
711 for (IDToItemControllerMap::const_iterator i = | 711 for (IDToItemControllerMap::const_iterator i = |
712 id_to_item_controller_map_.begin(); | 712 id_to_item_controller_map_.begin(); |
713 i != id_to_item_controller_map_.end(); ++i) { | 713 i != id_to_item_controller_map_.end(); ++i) { |
714 if (i->second->type() == LauncherItemController::TYPE_APP_PANEL) | 714 if (i->second->type() == LauncherItemController::TYPE_APP_PANEL) |
715 continue; // Don't include panels | 715 continue; // Don't include panels |
716 if (i->second->app_id() == app_id) | 716 if (i->second->app_id() == app_id) |
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 } | 2058 } |
2059 | 2059 |
2060 void ChromeLauncherController::ReleaseProfile() { | 2060 void ChromeLauncherController::ReleaseProfile() { |
2061 if (app_sync_ui_state_) | 2061 if (app_sync_ui_state_) |
2062 app_sync_ui_state_->RemoveObserver(this); | 2062 app_sync_ui_state_->RemoveObserver(this); |
2063 | 2063 |
2064 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); | 2064 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); |
2065 | 2065 |
2066 pref_change_registrar_.RemoveAll(); | 2066 pref_change_registrar_.RemoveAll(); |
2067 } | 2067 } |
OLD | NEW |