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/chrome_launcher_controller_per_browser.
h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.
h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/launcher/launcher_model.h" | 9 #include "ash/launcher/launcher_model.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "ash/wm/window_util.h" | 11 #include "ash/wm/window_util.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/string_number_conversions.h" |
13 #include "base/values.h" | 14 #include "base/values.h" |
14 #include "chrome/browser/defaults.h" | 15 #include "chrome/browser/defaults.h" |
15 #include "chrome/browser/extensions/extension_service.h" | 16 #include "chrome/browser/extensions/extension_service.h" |
16 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 17 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
17 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
18 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 19 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
19 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/browser/ui/ash/app_sync_ui_state.h" | 22 #include "chrome/browser/ui/ash/app_sync_ui_state.h" |
22 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" | 23 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h" |
(...skipping 14 matching lines...) Expand all Loading... |
37 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
38 #include "chrome/common/extensions/extension.h" | 39 #include "chrome/common/extensions/extension.h" |
39 #include "chrome/common/extensions/extension_resource.h" | 40 #include "chrome/common/extensions/extension_resource.h" |
40 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
41 #include "chrome/common/url_constants.h" | 42 #include "chrome/common/url_constants.h" |
42 #include "content/public/browser/navigation_entry.h" | 43 #include "content/public/browser/navigation_entry.h" |
43 #include "content/public/browser/notification_service.h" | 44 #include "content/public/browser/notification_service.h" |
44 #include "content/public/browser/web_contents.h" | 45 #include "content/public/browser/web_contents.h" |
45 #include "extensions/common/url_pattern.h" | 46 #include "extensions/common/url_pattern.h" |
46 #include "grit/theme_resources.h" | 47 #include "grit/theme_resources.h" |
| 48 #include "ui/aura/root_window.h" |
47 #include "ui/aura/window.h" | 49 #include "ui/aura/window.h" |
48 | 50 |
49 using content::WebContents; | 51 using content::WebContents; |
50 using extensions::Extension; | 52 using extensions::Extension; |
51 | 53 |
52 namespace { | 54 namespace { |
53 | 55 |
54 // Item controller for an app shortcut. Shortcuts track app and launcher ids, | 56 // Item controller for an app shortcut. Shortcuts track app and launcher ids, |
55 // but do not have any associated windows (opening a shortcut will replace the | 57 // but do not have any associated windows (opening a shortcut will replace the |
56 // item with the appropriate LauncherItemController type). | 58 // item with the appropriate LauncherItemController type). |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 114 |
113 // Stores the optional refocus url pattern for this item. | 115 // Stores the optional refocus url pattern for this item. |
114 const GURL& refocus_url() const { return refocus_url_; } | 116 const GURL& refocus_url() const { return refocus_url_; } |
115 void set_refocus_url(const GURL& refocus_url) { refocus_url_ = refocus_url; } | 117 void set_refocus_url(const GURL& refocus_url) { refocus_url_ = refocus_url; } |
116 | 118 |
117 private: | 119 private: |
118 GURL refocus_url_; | 120 GURL refocus_url_; |
119 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); | 121 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); |
120 }; | 122 }; |
121 | 123 |
122 // If the value of the pref at |local_path is not empty, it is returned | 124 std::string GetPrefKeyForRootWindow(aura::RootWindow* root_window) { |
123 // otherwise the value of the pref at |synced_path| is returned. | 125 gfx::Display display = gfx::Screen::GetScreenFor( |
124 std::string GetLocalOrRemotePref(PrefService* pref_service, | 126 root_window)->GetDisplayNearestWindow(root_window); |
| 127 DCHECK(display.is_valid()); |
| 128 |
| 129 return base::Int64ToString(display.id()); |
| 130 } |
| 131 |
| 132 void UpdatePerDisplayPref(PrefService* pref_service, |
| 133 aura::RootWindow* root_window, |
| 134 const char* pref_key, |
| 135 const std::string& value) { |
| 136 std::string key = GetPrefKeyForRootWindow(root_window); |
| 137 if (key.empty()) |
| 138 return; |
| 139 |
| 140 DictionaryPrefUpdate update(pref_service, prefs::kShelfPreferences); |
| 141 base::DictionaryValue* shelf_prefs = update.Get(); |
| 142 base::DictionaryValue* prefs = NULL; |
| 143 if (!shelf_prefs->GetDictionary(key, &prefs)) { |
| 144 prefs = new base::DictionaryValue(); |
| 145 shelf_prefs->Set(key, prefs); |
| 146 } |
| 147 prefs->SetStringWithoutPathExpansion(pref_key, value); |
| 148 } |
| 149 |
| 150 // Returns a pref value in |pref_service| for the display of |root_window|. The |
| 151 // pref value is stored in |local_path| and |path|, but |pref_service| may have |
| 152 // per-display preferences and the value can be specified by policy. Here is |
| 153 // the priority: |
| 154 // * A value managed by policy. This is a single value that applies to all |
| 155 // displays. |
| 156 // * A user-set value for the specified display. |
| 157 // * A user-set value in |local_path| or |path|. |local_path| is preferred. See |
| 158 // comment in |kShelfAlignment| as to why we consider two prefs and why |
| 159 // |local_path| is preferred. |
| 160 // * A value recommended by policy. This is a single value that applies to all |
| 161 // root windows. |
| 162 std::string GetPrefForRootWindow(PrefService* pref_service, |
| 163 aura::RootWindow* root_window, |
125 const char* local_path, | 164 const char* local_path, |
126 const char* synced_path) { | 165 const char* path) { |
| 166 const PrefService::Preference* local_pref = |
| 167 pref_service->FindPreference(local_path); |
127 const std::string value(pref_service->GetString(local_path)); | 168 const std::string value(pref_service->GetString(local_path)); |
128 return value.empty() ? pref_service->GetString(synced_path) : value; | 169 if (local_pref->IsManaged()) |
| 170 return value; |
| 171 |
| 172 std::string pref_key = GetPrefKeyForRootWindow(root_window); |
| 173 if (!pref_key.empty()) { |
| 174 const base::DictionaryValue* shelf_prefs = pref_service->GetDictionary( |
| 175 prefs::kShelfPreferences); |
| 176 const base::DictionaryValue* display_pref = NULL; |
| 177 std::string per_display_value; |
| 178 if (shelf_prefs->GetDictionary(pref_key, &display_pref) && |
| 179 display_pref->GetString(path, &per_display_value)) { |
| 180 return per_display_value; |
| 181 } |
| 182 } |
| 183 |
| 184 return value; |
129 } | 185 } |
130 | 186 |
131 // If prefs have synced and no user-set value exists at |local_path|, the value | 187 // If prefs have synced and no user-set value exists at |local_path|, the value |
132 // from |synced_path| is copied to |local_path|. | 188 // from |synced_path| is copied to |local_path|. |
133 void MaybePropagatePrefToLocal(PrefService* pref_service, | 189 void MaybePropagatePrefToLocal(PrefService* pref_service, |
134 const char* local_path, | 190 const char* local_path, |
135 const char* synced_path) { | 191 const char* synced_path) { |
136 if (!pref_service->FindPreference(local_path)->HasUserSetting() && | 192 if (!pref_service->FindPreference(local_path)->HasUserSetting() && |
137 pref_service->IsSyncing()) { | 193 pref_service->IsSyncing()) { |
138 // First time the user is using this machine, propagate from remote to | 194 // First time the user is using this machine, propagate from remote to |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 619 |
564 bool ChromeLauncherControllerPerBrowser::CanPin() const { | 620 bool ChromeLauncherControllerPerBrowser::CanPin() const { |
565 const PrefService::Preference* pref = | 621 const PrefService::Preference* pref = |
566 profile_->GetPrefs()->FindPreference(prefs::kPinnedLauncherApps); | 622 profile_->GetPrefs()->FindPreference(prefs::kPinnedLauncherApps); |
567 return pref && pref->IsUserModifiable(); | 623 return pref && pref->IsUserModifiable(); |
568 } | 624 } |
569 | 625 |
570 ash::ShelfAutoHideBehavior | 626 ash::ShelfAutoHideBehavior |
571 ChromeLauncherControllerPerBrowser::GetShelfAutoHideBehavior( | 627 ChromeLauncherControllerPerBrowser::GetShelfAutoHideBehavior( |
572 aura::RootWindow* root_window) const { | 628 aura::RootWindow* root_window) const { |
573 // TODO(oshima): Support multiple launchers. | |
574 | |
575 // See comment in |kShelfAlignment| as to why we consider two prefs. | 629 // See comment in |kShelfAlignment| as to why we consider two prefs. |
576 const std::string behavior_value( | 630 const std::string behavior_value( |
577 GetLocalOrRemotePref(profile_->GetPrefs(), | 631 GetPrefForRootWindow(profile_->GetPrefs(), |
| 632 root_window, |
578 prefs::kShelfAutoHideBehaviorLocal, | 633 prefs::kShelfAutoHideBehaviorLocal, |
579 prefs::kShelfAutoHideBehavior)); | 634 prefs::kShelfAutoHideBehavior)); |
580 | 635 |
581 // Note: To maintain sync compatibility with old images of chrome/chromeos | 636 // Note: To maintain sync compatibility with old images of chrome/chromeos |
582 // the set of values that may be encountered includes the now-extinct | 637 // the set of values that may be encountered includes the now-extinct |
583 // "Default" as well as "Never" and "Always", "Default" should now | 638 // "Default" as well as "Never" and "Always", "Default" should now |
584 // be treated as "Never" (http://crbug.com/146773). | 639 // be treated as "Never" (http://crbug.com/146773). |
585 if (behavior_value == ash::kShelfAutoHideBehaviorAlways) | 640 if (behavior_value == ash::kShelfAutoHideBehaviorAlways) |
586 return ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; | 641 return ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; |
587 return ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER; | 642 return ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER; |
588 } | 643 } |
589 | 644 |
590 bool ChromeLauncherControllerPerBrowser::CanUserModifyShelfAutoHideBehavior( | 645 bool ChromeLauncherControllerPerBrowser::CanUserModifyShelfAutoHideBehavior( |
591 aura::RootWindow* root_window) const { | 646 aura::RootWindow* root_window) const { |
592 // TODO(oshima): Support multiple launchers. | |
593 return profile_->GetPrefs()-> | 647 return profile_->GetPrefs()-> |
594 FindPreference(prefs::kShelfAutoHideBehaviorLocal)->IsUserModifiable(); | 648 FindPreference(prefs::kShelfAutoHideBehaviorLocal)->IsUserModifiable(); |
595 } | 649 } |
596 | 650 |
597 void ChromeLauncherControllerPerBrowser::ToggleShelfAutoHideBehavior( | 651 void ChromeLauncherControllerPerBrowser::ToggleShelfAutoHideBehavior( |
598 aura::RootWindow* root_window) { | 652 aura::RootWindow* root_window) { |
599 ash::ShelfAutoHideBehavior behavior = GetShelfAutoHideBehavior(root_window) == | 653 ash::ShelfAutoHideBehavior behavior = GetShelfAutoHideBehavior(root_window) == |
600 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ? | 654 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ? |
601 ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER : | 655 ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER : |
602 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; | 656 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 if (IsAppPinned(extension->id())) | 852 if (IsAppPinned(extension->id())) |
799 DoUnpinAppsWithID(extension->id()); | 853 DoUnpinAppsWithID(extension->id()); |
800 app_icon_loader_->ClearImage(extension->id()); | 854 app_icon_loader_->ClearImage(extension->id()); |
801 break; | 855 break; |
802 } | 856 } |
803 default: | 857 default: |
804 NOTREACHED() << "Unexpected notification type=" << type; | 858 NOTREACHED() << "Unexpected notification type=" << type; |
805 } | 859 } |
806 } | 860 } |
807 | 861 |
808 void ChromeLauncherControllerPerBrowser::OnShelfAlignmentChanged() { | 862 void ChromeLauncherControllerPerBrowser::OnShelfAlignmentChanged( |
| 863 aura::RootWindow* root_window) { |
809 const char* pref_value = NULL; | 864 const char* pref_value = NULL; |
810 // TODO(oshima): Support multiple displays. | 865 switch (ash::Shell::GetInstance()->GetShelfAlignment(root_window)) { |
811 switch (ash::Shell::GetInstance()->GetShelfAlignment( | |
812 ash::Shell::GetPrimaryRootWindow())) { | |
813 case ash::SHELF_ALIGNMENT_BOTTOM: | 866 case ash::SHELF_ALIGNMENT_BOTTOM: |
814 pref_value = ash::kShelfAlignmentBottom; | 867 pref_value = ash::kShelfAlignmentBottom; |
815 break; | 868 break; |
816 case ash::SHELF_ALIGNMENT_LEFT: | 869 case ash::SHELF_ALIGNMENT_LEFT: |
817 pref_value = ash::kShelfAlignmentLeft; | 870 pref_value = ash::kShelfAlignmentLeft; |
818 break; | 871 break; |
819 case ash::SHELF_ALIGNMENT_RIGHT: | 872 case ash::SHELF_ALIGNMENT_RIGHT: |
820 pref_value = ash::kShelfAlignmentRight; | 873 pref_value = ash::kShelfAlignmentRight; |
821 break; | 874 break; |
822 } | 875 } |
823 // See comment in |kShelfAlignment| about why we have two prefs here. | 876 |
824 profile_->GetPrefs()->SetString(prefs::kShelfAlignmentLocal, pref_value); | 877 UpdatePerDisplayPref( |
825 profile_->GetPrefs()->SetString(prefs::kShelfAlignment, pref_value); | 878 profile_->GetPrefs(), root_window, prefs::kShelfAlignment, pref_value); |
| 879 |
| 880 if (root_window == ash::Shell::GetPrimaryRootWindow()) { |
| 881 // See comment in |kShelfAlignment| about why we have two prefs here. |
| 882 profile_->GetPrefs()->SetString(prefs::kShelfAlignmentLocal, pref_value); |
| 883 profile_->GetPrefs()->SetString(prefs::kShelfAlignment, pref_value); |
| 884 } |
826 } | 885 } |
827 | 886 |
828 void ChromeLauncherControllerPerBrowser::OnIsSyncingChanged() { | 887 void ChromeLauncherControllerPerBrowser::OnIsSyncingChanged() { |
829 MaybePropagatePrefToLocal(profile_->GetPrefs(), | 888 MaybePropagatePrefToLocal(profile_->GetPrefs(), |
830 prefs::kShelfAlignmentLocal, | 889 prefs::kShelfAlignmentLocal, |
831 prefs::kShelfAlignment); | 890 prefs::kShelfAlignment); |
832 MaybePropagatePrefToLocal(profile_->GetPrefs(), | 891 MaybePropagatePrefToLocal(profile_->GetPrefs(), |
833 prefs::kShelfAutoHideBehaviorLocal, | 892 prefs::kShelfAutoHideBehaviorLocal, |
834 prefs::kShelfAutoHideBehavior); | 893 prefs::kShelfAutoHideBehavior); |
835 } | 894 } |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 } | 1051 } |
993 | 1052 |
994 // Append unprocessed items from the pref to the end of the model. | 1053 // Append unprocessed items from the pref to the end of the model. |
995 for (; pref_app_id != pinned_apps.end(); ++pref_app_id) | 1054 for (; pref_app_id != pinned_apps.end(); ++pref_app_id) |
996 DoPinAppWithID(*pref_app_id); | 1055 DoPinAppWithID(*pref_app_id); |
997 } | 1056 } |
998 | 1057 |
999 void ChromeLauncherControllerPerBrowser::SetShelfAutoHideBehaviorPrefs( | 1058 void ChromeLauncherControllerPerBrowser::SetShelfAutoHideBehaviorPrefs( |
1000 ash::ShelfAutoHideBehavior behavior, | 1059 ash::ShelfAutoHideBehavior behavior, |
1001 aura::RootWindow* root_window) { | 1060 aura::RootWindow* root_window) { |
1002 // TODO(oshima): Support multiple launchers. | |
1003 if (root_window != ash::Shell::GetPrimaryRootWindow()) | |
1004 return; | |
1005 | |
1006 const char* value = NULL; | 1061 const char* value = NULL; |
1007 switch (behavior) { | 1062 switch (behavior) { |
1008 case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS: | 1063 case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS: |
1009 value = ash::kShelfAutoHideBehaviorAlways; | 1064 value = ash::kShelfAutoHideBehaviorAlways; |
1010 break; | 1065 break; |
1011 case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER: | 1066 case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER: |
1012 value = ash::kShelfAutoHideBehaviorNever; | 1067 value = ash::kShelfAutoHideBehaviorNever; |
1013 break; | 1068 break; |
1014 } | 1069 } |
1015 // See comment in |kShelfAlignment| about why we have two prefs here. | 1070 |
1016 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehaviorLocal, value); | 1071 UpdatePerDisplayPref( |
1017 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehavior, value); | 1072 profile_->GetPrefs(), root_window, prefs::kShelfAutoHideBehavior, value); |
| 1073 |
| 1074 if (root_window != ash::Shell::GetPrimaryRootWindow()) { |
| 1075 // See comment in |kShelfAlignment| about why we have two prefs here. |
| 1076 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehaviorLocal, value); |
| 1077 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehavior, value); |
| 1078 } |
1018 } | 1079 } |
1019 | 1080 |
1020 void ChromeLauncherControllerPerBrowser::SetShelfAutoHideBehaviorFromPrefs() { | 1081 void ChromeLauncherControllerPerBrowser::SetShelfAutoHideBehaviorFromPrefs() { |
1021 // TODO(oshima): Support multiple displays. | 1082 ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); |
1022 aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow(); | 1083 for (ash::Shell::RootWindowList::const_iterator iter = root_windows.begin(); |
1023 ash::Shell::GetInstance()->SetShelfAutoHideBehavior( | 1084 iter != root_windows.end(); ++iter) { |
1024 GetShelfAutoHideBehavior(root_window), root_window); | 1085 ash::Shell::GetInstance()->SetShelfAutoHideBehavior( |
| 1086 GetShelfAutoHideBehavior(*iter), *iter); |
| 1087 } |
1025 } | 1088 } |
1026 | 1089 |
1027 void ChromeLauncherControllerPerBrowser::SetShelfAlignmentFromPrefs() { | 1090 void ChromeLauncherControllerPerBrowser::SetShelfAlignmentFromPrefs() { |
1028 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 1091 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
1029 switches::kShowLauncherAlignmentMenu)) | 1092 switches::kShowLauncherAlignmentMenu)) |
1030 return; | 1093 return; |
1031 | 1094 |
1032 // See comment in |kShelfAlignment| as to why we consider two prefs. | 1095 ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); |
1033 const std::string alignment_value( | 1096 for (ash::Shell::RootWindowList::const_iterator iter = root_windows.begin(); |
1034 GetLocalOrRemotePref(profile_->GetPrefs(), | 1097 iter != root_windows.end(); ++iter) { |
1035 prefs::kShelfAlignmentLocal, | 1098 // See comment in |kShelfAlignment| as to why we consider two prefs. |
1036 prefs::kShelfAlignment)); | 1099 const std::string alignment_value( |
1037 ash::ShelfAlignment alignment = ash::SHELF_ALIGNMENT_BOTTOM; | 1100 GetPrefForRootWindow(profile_->GetPrefs(), |
1038 if (alignment_value == ash::kShelfAlignmentLeft) | 1101 *iter, |
1039 alignment = ash::SHELF_ALIGNMENT_LEFT; | 1102 prefs::kShelfAlignmentLocal, |
1040 else if (alignment_value == ash::kShelfAlignmentRight) | 1103 prefs::kShelfAlignment)); |
1041 alignment = ash::SHELF_ALIGNMENT_RIGHT; | 1104 ash::ShelfAlignment alignment = ash::SHELF_ALIGNMENT_BOTTOM; |
1042 // TODO(oshima): Support multiple displays. | 1105 if (alignment_value == ash::kShelfAlignmentLeft) |
1043 ash::Shell::GetInstance()->SetShelfAlignment( | 1106 alignment = ash::SHELF_ALIGNMENT_LEFT; |
1044 alignment, ash::Shell::GetPrimaryRootWindow()); | 1107 else if (alignment_value == ash::kShelfAlignmentRight) |
| 1108 alignment = ash::SHELF_ALIGNMENT_RIGHT; |
| 1109 ash::Shell::GetInstance()->SetShelfAlignment(alignment, *iter); |
| 1110 } |
1045 } | 1111 } |
1046 | 1112 |
1047 WebContents* ChromeLauncherControllerPerBrowser::GetLastActiveWebContents( | 1113 WebContents* ChromeLauncherControllerPerBrowser::GetLastActiveWebContents( |
1048 const std::string& app_id) { | 1114 const std::string& app_id) { |
1049 AppIDToWebContentsListMap::const_iterator i = | 1115 AppIDToWebContentsListMap::const_iterator i = |
1050 app_id_to_web_contents_list_.find(app_id); | 1116 app_id_to_web_contents_list_.find(app_id); |
1051 if (i == app_id_to_web_contents_list_.end()) | 1117 if (i == app_id_to_web_contents_list_.end()) |
1052 return NULL; | 1118 return NULL; |
1053 DCHECK_GT(i->second.size(), 0u); | 1119 DCHECK_GT(i->second.size(), 0u); |
1054 return *i->second.begin(); | 1120 return *i->second.begin(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( | 1180 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( |
1115 AppIconLoader* loader) { | 1181 AppIconLoader* loader) { |
1116 app_icon_loader_.reset(loader); | 1182 app_icon_loader_.reset(loader); |
1117 } | 1183 } |
1118 | 1184 |
1119 const std::string& | 1185 const std::string& |
1120 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( | 1186 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( |
1121 ash::LauncherID id) { | 1187 ash::LauncherID id) { |
1122 return id_to_item_controller_map_[id]->app_id(); | 1188 return id_to_item_controller_map_[id]->app_id(); |
1123 } | 1189 } |
OLD | NEW |