OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
bartfab (slow)
2012/12/14 21:34:02
Again, all the same comments as in the other file
Jun Mukai
2012/12/14 22:44:56
Done.
| |
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 the pref in |pref_service| for |root_window|. The pref value | |
151 // can vary among root windows and can be specified by the admin. Here is | |
152 // the priority: | |
153 // * the value managed by the admin | |
154 // * a user-set value specific to the root window | |
155 // * the value recommended by the admin | |
156 // * otherwise, lookup the default value. |local_path| is preferred. | |
157 std::string GetPrefForRootWindow(PrefService* pref_service, | |
158 aura::RootWindow* root_window, | |
125 const char* local_path, | 159 const char* local_path, |
126 const char* synced_path) { | 160 const char* path) { |
161 const PrefService::Preference* local_pref = | |
162 pref_service->FindPreference(local_path); | |
127 const std::string value(pref_service->GetString(local_path)); | 163 const std::string value(pref_service->GetString(local_path)); |
128 return value.empty() ? pref_service->GetString(synced_path) : value; | 164 if (local_pref->IsManaged()) |
165 return value; | |
166 | |
167 std::string pref_key = GetPrefKeyForRootWindow(root_window); | |
168 if (!pref_key.empty()) { | |
169 const base::DictionaryValue* shelf_prefs = pref_service->GetDictionary( | |
170 prefs::kShelfPreferences); | |
171 const base::DictionaryValue* display_pref = NULL; | |
172 std::string per_display_value; | |
173 if (shelf_prefs->GetDictionary(pref_key, &display_pref) && | |
174 display_pref->GetString(path, &per_display_value)) { | |
175 return per_display_value; | |
176 } | |
177 } | |
178 | |
179 if (local_pref->IsRecommended()) | |
180 return value; | |
181 | |
182 return value.empty() ? pref_service->GetString(path) : value; | |
129 } | 183 } |
130 | 184 |
131 // If prefs have synced and no user-set value exists at |local_path|, the value | 185 // If prefs have synced and no user-set value exists at |local_path|, the value |
132 // from |synced_path| is copied to |local_path|. | 186 // from |synced_path| is copied to |local_path|. |
133 void MaybePropagatePrefToLocal(PrefService* pref_service, | 187 void MaybePropagatePrefToLocal(PrefService* pref_service, |
134 const char* local_path, | 188 const char* local_path, |
135 const char* synced_path) { | 189 const char* synced_path) { |
136 if (!pref_service->FindPreference(local_path)->HasUserSetting() && | 190 if (!pref_service->FindPreference(local_path)->HasUserSetting() && |
137 pref_service->IsSyncing()) { | 191 pref_service->IsSyncing()) { |
138 // First time the user is using this machine, propagate from remote to | 192 // 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 | 617 |
564 bool ChromeLauncherControllerPerBrowser::CanPin() const { | 618 bool ChromeLauncherControllerPerBrowser::CanPin() const { |
565 const PrefService::Preference* pref = | 619 const PrefService::Preference* pref = |
566 profile_->GetPrefs()->FindPreference(prefs::kPinnedLauncherApps); | 620 profile_->GetPrefs()->FindPreference(prefs::kPinnedLauncherApps); |
567 return pref && pref->IsUserModifiable(); | 621 return pref && pref->IsUserModifiable(); |
568 } | 622 } |
569 | 623 |
570 ash::ShelfAutoHideBehavior | 624 ash::ShelfAutoHideBehavior |
571 ChromeLauncherControllerPerBrowser::GetShelfAutoHideBehavior( | 625 ChromeLauncherControllerPerBrowser::GetShelfAutoHideBehavior( |
572 aura::RootWindow* root_window) const { | 626 aura::RootWindow* root_window) const { |
573 // TODO(oshima): Support multiple launchers. | |
574 | |
575 // See comment in |kShelfAlignment| as to why we consider two prefs. | 627 // See comment in |kShelfAlignment| as to why we consider two prefs. |
576 const std::string behavior_value( | 628 const std::string behavior_value( |
577 GetLocalOrRemotePref(profile_->GetPrefs(), | 629 GetPrefForRootWindow(profile_->GetPrefs(), |
630 root_window, | |
578 prefs::kShelfAutoHideBehaviorLocal, | 631 prefs::kShelfAutoHideBehaviorLocal, |
579 prefs::kShelfAutoHideBehavior)); | 632 prefs::kShelfAutoHideBehavior)); |
580 | 633 |
581 // Note: To maintain sync compatibility with old images of chrome/chromeos | 634 // Note: To maintain sync compatibility with old images of chrome/chromeos |
582 // the set of values that may be encountered includes the now-extinct | 635 // the set of values that may be encountered includes the now-extinct |
583 // "Default" as well as "Never" and "Always", "Default" should now | 636 // "Default" as well as "Never" and "Always", "Default" should now |
584 // be treated as "Never" (http://crbug.com/146773). | 637 // be treated as "Never" (http://crbug.com/146773). |
585 if (behavior_value == ash::kShelfAutoHideBehaviorAlways) | 638 if (behavior_value == ash::kShelfAutoHideBehaviorAlways) |
586 return ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; | 639 return ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; |
587 return ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER; | 640 return ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER; |
588 } | 641 } |
589 | 642 |
590 bool ChromeLauncherControllerPerBrowser::CanUserModifyShelfAutoHideBehavior( | 643 bool ChromeLauncherControllerPerBrowser::CanUserModifyShelfAutoHideBehavior( |
591 aura::RootWindow* root_window) const { | 644 aura::RootWindow* root_window) const { |
592 // TODO(oshima): Support multiple launchers. | |
593 return profile_->GetPrefs()-> | 645 return profile_->GetPrefs()-> |
594 FindPreference(prefs::kShelfAutoHideBehaviorLocal)->IsUserModifiable(); | 646 FindPreference(prefs::kShelfAutoHideBehaviorLocal)->IsUserModifiable(); |
595 } | 647 } |
596 | 648 |
597 void ChromeLauncherControllerPerBrowser::ToggleShelfAutoHideBehavior( | 649 void ChromeLauncherControllerPerBrowser::ToggleShelfAutoHideBehavior( |
598 aura::RootWindow* root_window) { | 650 aura::RootWindow* root_window) { |
599 ash::ShelfAutoHideBehavior behavior = GetShelfAutoHideBehavior(root_window) == | 651 ash::ShelfAutoHideBehavior behavior = GetShelfAutoHideBehavior(root_window) == |
600 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ? | 652 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ? |
601 ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER : | 653 ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER : |
602 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; | 654 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
798 if (IsAppPinned(extension->id())) | 850 if (IsAppPinned(extension->id())) |
799 DoUnpinAppsWithID(extension->id()); | 851 DoUnpinAppsWithID(extension->id()); |
800 app_icon_loader_->ClearImage(extension->id()); | 852 app_icon_loader_->ClearImage(extension->id()); |
801 break; | 853 break; |
802 } | 854 } |
803 default: | 855 default: |
804 NOTREACHED() << "Unexpected notification type=" << type; | 856 NOTREACHED() << "Unexpected notification type=" << type; |
805 } | 857 } |
806 } | 858 } |
807 | 859 |
808 void ChromeLauncherControllerPerBrowser::OnShelfAlignmentChanged() { | 860 void ChromeLauncherControllerPerBrowser::OnShelfAlignmentChanged( |
861 aura::RootWindow* root_window) { | |
809 const char* pref_value = NULL; | 862 const char* pref_value = NULL; |
810 // TODO(oshima): Support multiple displays. | 863 switch (ash::Shell::GetInstance()->GetShelfAlignment(root_window)) { |
811 switch (ash::Shell::GetInstance()->GetShelfAlignment( | |
812 ash::Shell::GetPrimaryRootWindow())) { | |
813 case ash::SHELF_ALIGNMENT_BOTTOM: | 864 case ash::SHELF_ALIGNMENT_BOTTOM: |
814 pref_value = ash::kShelfAlignmentBottom; | 865 pref_value = ash::kShelfAlignmentBottom; |
815 break; | 866 break; |
816 case ash::SHELF_ALIGNMENT_LEFT: | 867 case ash::SHELF_ALIGNMENT_LEFT: |
817 pref_value = ash::kShelfAlignmentLeft; | 868 pref_value = ash::kShelfAlignmentLeft; |
818 break; | 869 break; |
819 case ash::SHELF_ALIGNMENT_RIGHT: | 870 case ash::SHELF_ALIGNMENT_RIGHT: |
820 pref_value = ash::kShelfAlignmentRight; | 871 pref_value = ash::kShelfAlignmentRight; |
821 break; | 872 break; |
822 } | 873 } |
823 // See comment in |kShelfAlignment| about why we have two prefs here. | 874 |
824 profile_->GetPrefs()->SetString(prefs::kShelfAlignmentLocal, pref_value); | 875 UpdatePerDisplayPref( |
825 profile_->GetPrefs()->SetString(prefs::kShelfAlignment, pref_value); | 876 profile_->GetPrefs(), root_window, prefs::kShelfAlignment, pref_value); |
877 | |
878 if (root_window == ash::Shell::GetPrimaryRootWindow()) { | |
879 // See comment in |kShelfAlignment| about why we have two prefs here. | |
880 profile_->GetPrefs()->SetString(prefs::kShelfAlignmentLocal, pref_value); | |
881 profile_->GetPrefs()->SetString(prefs::kShelfAlignment, pref_value); | |
882 } | |
826 } | 883 } |
827 | 884 |
828 void ChromeLauncherControllerPerBrowser::OnIsSyncingChanged() { | 885 void ChromeLauncherControllerPerBrowser::OnIsSyncingChanged() { |
829 MaybePropagatePrefToLocal(profile_->GetPrefs(), | 886 MaybePropagatePrefToLocal(profile_->GetPrefs(), |
830 prefs::kShelfAlignmentLocal, | 887 prefs::kShelfAlignmentLocal, |
831 prefs::kShelfAlignment); | 888 prefs::kShelfAlignment); |
832 MaybePropagatePrefToLocal(profile_->GetPrefs(), | 889 MaybePropagatePrefToLocal(profile_->GetPrefs(), |
833 prefs::kShelfAutoHideBehaviorLocal, | 890 prefs::kShelfAutoHideBehaviorLocal, |
834 prefs::kShelfAutoHideBehavior); | 891 prefs::kShelfAutoHideBehavior); |
835 } | 892 } |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
992 } | 1049 } |
993 | 1050 |
994 // Append unprocessed items from the pref to the end of the model. | 1051 // Append unprocessed items from the pref to the end of the model. |
995 for (; pref_app_id != pinned_apps.end(); ++pref_app_id) | 1052 for (; pref_app_id != pinned_apps.end(); ++pref_app_id) |
996 DoPinAppWithID(*pref_app_id); | 1053 DoPinAppWithID(*pref_app_id); |
997 } | 1054 } |
998 | 1055 |
999 void ChromeLauncherControllerPerBrowser::SetShelfAutoHideBehaviorPrefs( | 1056 void ChromeLauncherControllerPerBrowser::SetShelfAutoHideBehaviorPrefs( |
1000 ash::ShelfAutoHideBehavior behavior, | 1057 ash::ShelfAutoHideBehavior behavior, |
1001 aura::RootWindow* root_window) { | 1058 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; | 1059 const char* value = NULL; |
1007 switch (behavior) { | 1060 switch (behavior) { |
1008 case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS: | 1061 case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS: |
1009 value = ash::kShelfAutoHideBehaviorAlways; | 1062 value = ash::kShelfAutoHideBehaviorAlways; |
1010 break; | 1063 break; |
1011 case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER: | 1064 case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER: |
1012 value = ash::kShelfAutoHideBehaviorNever; | 1065 value = ash::kShelfAutoHideBehaviorNever; |
1013 break; | 1066 break; |
1014 } | 1067 } |
1015 // See comment in |kShelfAlignment| about why we have two prefs here. | 1068 |
1016 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehaviorLocal, value); | 1069 UpdatePerDisplayPref( |
1017 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehavior, value); | 1070 profile_->GetPrefs(), root_window, prefs::kShelfAutoHideBehavior, value); |
1071 | |
1072 if (root_window != ash::Shell::GetPrimaryRootWindow()) { | |
1073 // See comment in |kShelfAlignment| about why we have two prefs here. | |
1074 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehaviorLocal, value); | |
1075 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehavior, value); | |
1076 } | |
1018 } | 1077 } |
1019 | 1078 |
1020 void ChromeLauncherControllerPerBrowser::SetShelfAutoHideBehaviorFromPrefs() { | 1079 void ChromeLauncherControllerPerBrowser::SetShelfAutoHideBehaviorFromPrefs() { |
1021 // TODO(oshima): Support multiple displays. | 1080 ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); |
1022 aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow(); | 1081 for (ash::Shell::RootWindowList::const_iterator iter = root_windows.begin(); |
1023 ash::Shell::GetInstance()->SetShelfAutoHideBehavior( | 1082 iter != root_windows.end(); ++iter) { |
1024 GetShelfAutoHideBehavior(root_window), root_window); | 1083 ash::Shell::GetInstance()->SetShelfAutoHideBehavior( |
1084 GetShelfAutoHideBehavior(*iter), *iter); | |
1085 } | |
1025 } | 1086 } |
1026 | 1087 |
1027 void ChromeLauncherControllerPerBrowser::SetShelfAlignmentFromPrefs() { | 1088 void ChromeLauncherControllerPerBrowser::SetShelfAlignmentFromPrefs() { |
1028 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 1089 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
1029 switches::kShowLauncherAlignmentMenu)) | 1090 switches::kShowLauncherAlignmentMenu)) |
1030 return; | 1091 return; |
1031 | 1092 |
1032 // See comment in |kShelfAlignment| as to why we consider two prefs. | 1093 ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); |
1033 const std::string alignment_value( | 1094 for (ash::Shell::RootWindowList::const_iterator iter = root_windows.begin(); |
1034 GetLocalOrRemotePref(profile_->GetPrefs(), | 1095 iter != root_windows.end(); ++iter) { |
1035 prefs::kShelfAlignmentLocal, | 1096 // See comment in |kShelfAlignment| as to why we consider two prefs. |
1036 prefs::kShelfAlignment)); | 1097 const std::string alignment_value( |
1037 ash::ShelfAlignment alignment = ash::SHELF_ALIGNMENT_BOTTOM; | 1098 GetPrefForRootWindow(profile_->GetPrefs(), |
1038 if (alignment_value == ash::kShelfAlignmentLeft) | 1099 *iter, |
1039 alignment = ash::SHELF_ALIGNMENT_LEFT; | 1100 prefs::kShelfAlignmentLocal, |
1040 else if (alignment_value == ash::kShelfAlignmentRight) | 1101 prefs::kShelfAlignment)); |
1041 alignment = ash::SHELF_ALIGNMENT_RIGHT; | 1102 ash::ShelfAlignment alignment = ash::SHELF_ALIGNMENT_BOTTOM; |
1042 // TODO(oshima): Support multiple displays. | 1103 if (alignment_value == ash::kShelfAlignmentLeft) |
1043 ash::Shell::GetInstance()->SetShelfAlignment( | 1104 alignment = ash::SHELF_ALIGNMENT_LEFT; |
1044 alignment, ash::Shell::GetPrimaryRootWindow()); | 1105 else if (alignment_value == ash::kShelfAlignmentRight) |
1106 alignment = ash::SHELF_ALIGNMENT_RIGHT; | |
1107 ash::Shell::GetInstance()->SetShelfAlignment(alignment, *iter); | |
1108 } | |
1045 } | 1109 } |
1046 | 1110 |
1047 WebContents* ChromeLauncherControllerPerBrowser::GetLastActiveWebContents( | 1111 WebContents* ChromeLauncherControllerPerBrowser::GetLastActiveWebContents( |
1048 const std::string& app_id) { | 1112 const std::string& app_id) { |
1049 AppIDToWebContentsListMap::const_iterator i = | 1113 AppIDToWebContentsListMap::const_iterator i = |
1050 app_id_to_web_contents_list_.find(app_id); | 1114 app_id_to_web_contents_list_.find(app_id); |
1051 if (i == app_id_to_web_contents_list_.end()) | 1115 if (i == app_id_to_web_contents_list_.end()) |
1052 return NULL; | 1116 return NULL; |
1053 DCHECK_GT(i->second.size(), 0u); | 1117 DCHECK_GT(i->second.size(), 0u); |
1054 return *i->second.begin(); | 1118 return *i->second.begin(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1114 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( | 1178 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( |
1115 AppIconLoader* loader) { | 1179 AppIconLoader* loader) { |
1116 app_icon_loader_.reset(loader); | 1180 app_icon_loader_.reset(loader); |
1117 } | 1181 } |
1118 | 1182 |
1119 const std::string& | 1183 const std::string& |
1120 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( | 1184 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( |
1121 ash::LauncherID id) { | 1185 ash::LauncherID id) { |
1122 return id_to_item_controller_map_[id]->app_id(); | 1186 return id_to_item_controller_map_[id]->app_id(); |
1123 } | 1187 } |
OLD | NEW |