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_app.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 | 113 |
112 // Stores the optional refocus url pattern for this item. | 114 // Stores the optional refocus url pattern for this item. |
113 const GURL& refocus_url() const { return refocus_url_; } | 115 const GURL& refocus_url() const { return refocus_url_; } |
114 void set_refocus_url(const GURL& refocus_url) { refocus_url_ = refocus_url; } | 116 void set_refocus_url(const GURL& refocus_url) { refocus_url_ = refocus_url; } |
115 | 117 |
116 private: | 118 private: |
117 GURL refocus_url_; | 119 GURL refocus_url_; |
118 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); | 120 DISALLOW_COPY_AND_ASSIGN(AppShortcutLauncherItemController); |
119 }; | 121 }; |
120 | 122 |
123 std::string GetPrefKeyForRootWindow(aura::RootWindow* root_window) { | |
124 if (!root_window) | |
oshima
2012/12/14 11:03:55
can this be NULL?
Jun Mukai
2012/12/14 18:47:16
no... removed.
| |
125 return std::string(); | |
126 | |
127 gfx::Display display = gfx::Screen::GetScreenFor( | |
128 root_window)->GetDisplayNearestWindow(root_window); | |
129 if (!display.is_valid()) | |
130 return std::string(); | |
oshima
2012/12/14 11:03:55
This shouldn't really happen. Can you add DCHECK()
Jun Mukai
2012/12/14 18:47:16
Done.
| |
131 | |
132 return base::Int64ToString(display.id()); | |
133 } | |
134 | |
135 void UpdatePerDisplayPref(PrefService* pref_service, | |
136 aura::RootWindow* root_window, | |
137 const char* pref_key, | |
138 const std::string& value) { | |
139 std::string key = GetPrefKeyForRootWindow(root_window); | |
140 if (key.empty()) | |
141 return; | |
142 | |
143 DictionaryPrefUpdate update(pref_service, prefs::kShelfPreferences); | |
144 base::DictionaryValue* shelf_prefs = update.Get(); | |
145 base::DictionaryValue* prefs = NULL; | |
146 if (!shelf_prefs->GetDictionary(key, &prefs)) { | |
147 prefs = new base::DictionaryValue(); | |
148 shelf_prefs->Set(key, prefs); | |
149 } | |
150 prefs->SetStringWithoutPathExpansion(pref_key, value); | |
151 } | |
152 | |
121 // If the value of the pref at |local_path is not empty, it is returned | 153 // If the value of the pref at |local_path is not empty, it is returned |
bartfab (slow)
2012/12/14 09:46:10
Nit (not your fault, but nice to fix): |local_path
Jun Mukai
2012/12/14 18:47:16
Done.
| |
122 // otherwise the value of the pref at |synced_path| is returned. | 154 // otherwise the value of the pref at |synced_path| is returned. |
123 std::string GetLocalOrRemotePref(PrefService* pref_service, | 155 std::string GetLocalOrRemotePref(PrefService* pref_service, |
156 aura::RootWindow* root_window, | |
124 const char* local_path, | 157 const char* local_path, |
125 const char* synced_path) { | 158 const char* synced_path) { |
126 const std::string value(pref_service->GetString(local_path)); | 159 const std::string value(pref_service->GetString(local_path)); |
160 if (pref_service->FindPreference(local_path)->IsRecommended()) | |
bartfab (slow)
2012/12/14 09:46:10
This should be IsManaged(). The logic should be, i
Jun Mukai
2012/12/14 18:47:16
Done.
| |
161 return value; | |
162 | |
163 std::string pref_key = GetPrefKeyForRootWindow(root_window); | |
164 if (!pref_key.empty()) { | |
165 const base::DictionaryValue* shelf_prefs = pref_service->GetDictionary( | |
166 prefs::kShelfPreferences); | |
167 const base::DictionaryValue* display_pref = NULL; | |
168 std::string per_display_value; | |
169 if (shelf_prefs->GetDictionary(pref_key, &display_pref) && | |
170 display_pref->GetString(synced_path, &per_display_value)) { | |
bartfab (slow)
2012/12/14 09:46:10
You should renamed |synced_path| here and elsewher
Jun Mukai
2012/12/14 18:47:16
renamed to just 'path'
| |
171 return per_display_value; | |
172 } | |
173 } | |
174 | |
127 return value.empty() ? pref_service->GetString(synced_path) : value; | 175 return value.empty() ? pref_service->GetString(synced_path) : value; |
128 } | 176 } |
129 | 177 |
130 // If prefs have synced and no user-set value exists at |local_path|, the value | 178 // If prefs have synced and no user-set value exists at |local_path|, the value |
131 // from |synced_path| is copied to |local_path|. | 179 // from |synced_path| is copied to |local_path|. |
132 void MaybePropagatePrefToLocal(PrefService* pref_service, | 180 void MaybePropagatePrefToLocal(PrefService* pref_service, |
133 const char* local_path, | 181 const char* local_path, |
134 const char* synced_path) { | 182 const char* synced_path) { |
135 if (!pref_service->FindPreference(local_path)->HasUserSetting() && | 183 if (!pref_service->FindPreference(local_path)->HasUserSetting() && |
136 pref_service->IsSyncing()) { | 184 pref_service->IsSyncing()) { |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
556 | 604 |
557 bool ChromeLauncherControllerPerApp::CanPin() const { | 605 bool ChromeLauncherControllerPerApp::CanPin() const { |
558 const PrefService::Preference* pref = | 606 const PrefService::Preference* pref = |
559 profile_->GetPrefs()->FindPreference(prefs::kPinnedLauncherApps); | 607 profile_->GetPrefs()->FindPreference(prefs::kPinnedLauncherApps); |
560 return pref && pref->IsUserModifiable(); | 608 return pref && pref->IsUserModifiable(); |
561 } | 609 } |
562 | 610 |
563 ash::ShelfAutoHideBehavior | 611 ash::ShelfAutoHideBehavior |
564 ChromeLauncherControllerPerApp::GetShelfAutoHideBehavior( | 612 ChromeLauncherControllerPerApp::GetShelfAutoHideBehavior( |
565 aura::RootWindow* root_window) const { | 613 aura::RootWindow* root_window) const { |
566 // TODO(oshima): Support multiple launchers. | |
567 | |
568 // See comment in |kShelfAlignment| as to why we consider two prefs. | 614 // See comment in |kShelfAlignment| as to why we consider two prefs. |
569 const std::string behavior_value( | 615 const std::string behavior_value( |
570 GetLocalOrRemotePref(profile_->GetPrefs(), | 616 GetLocalOrRemotePref(profile_->GetPrefs(), |
617 root_window, | |
571 prefs::kShelfAutoHideBehaviorLocal, | 618 prefs::kShelfAutoHideBehaviorLocal, |
572 prefs::kShelfAutoHideBehavior)); | 619 prefs::kShelfAutoHideBehavior)); |
573 | 620 |
574 // Note: To maintain sync compatibility with old images of chrome/chromeos | 621 // Note: To maintain sync compatibility with old images of chrome/chromeos |
575 // the set of values that may be encountered includes the now-extinct | 622 // the set of values that may be encountered includes the now-extinct |
576 // "Default" as well as "Never" and "Always", "Default" should now | 623 // "Default" as well as "Never" and "Always", "Default" should now |
577 // be treated as "Never" (http://crbug.com/146773). | 624 // be treated as "Never" (http://crbug.com/146773). |
578 if (behavior_value == ash::kShelfAutoHideBehaviorAlways) | 625 if (behavior_value == ash::kShelfAutoHideBehaviorAlways) |
579 return ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; | 626 return ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; |
580 return ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER; | 627 return ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER; |
581 } | 628 } |
582 | 629 |
583 bool ChromeLauncherControllerPerApp::CanUserModifyShelfAutoHideBehavior( | 630 bool ChromeLauncherControllerPerApp::CanUserModifyShelfAutoHideBehavior( |
584 aura::RootWindow* root_window) const { | 631 aura::RootWindow* root_window) const { |
585 // TODO(oshima): Support multiple launchers. | |
586 return profile_->GetPrefs()-> | 632 return profile_->GetPrefs()-> |
587 FindPreference(prefs::kShelfAutoHideBehaviorLocal)->IsUserModifiable(); | 633 FindPreference(prefs::kShelfAutoHideBehaviorLocal)->IsUserModifiable(); |
588 } | 634 } |
589 | 635 |
590 void ChromeLauncherControllerPerApp::ToggleShelfAutoHideBehavior( | 636 void ChromeLauncherControllerPerApp::ToggleShelfAutoHideBehavior( |
591 aura::RootWindow* root_window) { | 637 aura::RootWindow* root_window) { |
592 ash::ShelfAutoHideBehavior behavior = GetShelfAutoHideBehavior(root_window) == | 638 ash::ShelfAutoHideBehavior behavior = GetShelfAutoHideBehavior(root_window) == |
593 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ? | 639 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS ? |
594 ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER : | 640 ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER : |
595 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; | 641 ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
790 if (IsAppPinned(extension->id())) | 836 if (IsAppPinned(extension->id())) |
791 DoUnpinAppsWithID(extension->id()); | 837 DoUnpinAppsWithID(extension->id()); |
792 app_icon_loader_->ClearImage(extension->id()); | 838 app_icon_loader_->ClearImage(extension->id()); |
793 break; | 839 break; |
794 } | 840 } |
795 default: | 841 default: |
796 NOTREACHED() << "Unexpected notification type=" << type; | 842 NOTREACHED() << "Unexpected notification type=" << type; |
797 } | 843 } |
798 } | 844 } |
799 | 845 |
800 void ChromeLauncherControllerPerApp::OnShelfAlignmentChanged() { | 846 void ChromeLauncherControllerPerApp::OnShelfAlignmentChanged( |
847 aura::RootWindow* root_window) { | |
801 const char* pref_value = NULL; | 848 const char* pref_value = NULL; |
802 // TODO(oshima): Support multiple displays. | 849 switch (ash::Shell::GetInstance()->GetShelfAlignment(root_window)) { |
803 switch (ash::Shell::GetInstance()->GetShelfAlignment( | |
804 ash::Shell::GetPrimaryRootWindow())) { | |
805 case ash::SHELF_ALIGNMENT_BOTTOM: | 850 case ash::SHELF_ALIGNMENT_BOTTOM: |
806 pref_value = ash::kShelfAlignmentBottom; | 851 pref_value = ash::kShelfAlignmentBottom; |
807 break; | 852 break; |
808 case ash::SHELF_ALIGNMENT_LEFT: | 853 case ash::SHELF_ALIGNMENT_LEFT: |
809 pref_value = ash::kShelfAlignmentLeft; | 854 pref_value = ash::kShelfAlignmentLeft; |
810 break; | 855 break; |
811 case ash::SHELF_ALIGNMENT_RIGHT: | 856 case ash::SHELF_ALIGNMENT_RIGHT: |
812 pref_value = ash::kShelfAlignmentRight; | 857 pref_value = ash::kShelfAlignmentRight; |
813 break; | 858 break; |
814 } | 859 } |
815 // See comment in |kShelfAlignment| about why we have two prefs here. | 860 |
816 profile_->GetPrefs()->SetString(prefs::kShelfAlignmentLocal, pref_value); | 861 UpdatePerDisplayPref( |
817 profile_->GetPrefs()->SetString(prefs::kShelfAlignment, pref_value); | 862 profile_->GetPrefs(), root_window, prefs::kShelfAlignment, pref_value); |
863 | |
864 if (root_window == ash::Shell::GetPrimaryRootWindow()) { | |
865 // See comment in |kShelfAlignment| about why we have two prefs here. | |
866 profile_->GetPrefs()->SetString(prefs::kShelfAlignmentLocal, pref_value); | |
867 profile_->GetPrefs()->SetString(prefs::kShelfAlignment, pref_value); | |
868 } | |
818 } | 869 } |
819 | 870 |
820 void ChromeLauncherControllerPerApp::OnIsSyncingChanged() { | 871 void ChromeLauncherControllerPerApp::OnIsSyncingChanged() { |
821 MaybePropagatePrefToLocal(profile_->GetPrefs(), | 872 MaybePropagatePrefToLocal(profile_->GetPrefs(), |
822 prefs::kShelfAlignmentLocal, | 873 prefs::kShelfAlignmentLocal, |
823 prefs::kShelfAlignment); | 874 prefs::kShelfAlignment); |
824 MaybePropagatePrefToLocal(profile_->GetPrefs(), | 875 MaybePropagatePrefToLocal(profile_->GetPrefs(), |
825 prefs::kShelfAutoHideBehaviorLocal, | 876 prefs::kShelfAutoHideBehaviorLocal, |
826 prefs::kShelfAutoHideBehavior); | 877 prefs::kShelfAutoHideBehavior); |
827 } | 878 } |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
982 } | 1033 } |
983 | 1034 |
984 // Append unprocessed items from the pref to the end of the model. | 1035 // Append unprocessed items from the pref to the end of the model. |
985 for (; pref_app_id != pinned_apps.end(); ++pref_app_id) | 1036 for (; pref_app_id != pinned_apps.end(); ++pref_app_id) |
986 DoPinAppWithID(*pref_app_id); | 1037 DoPinAppWithID(*pref_app_id); |
987 } | 1038 } |
988 | 1039 |
989 void ChromeLauncherControllerPerApp::SetShelfAutoHideBehaviorPrefs( | 1040 void ChromeLauncherControllerPerApp::SetShelfAutoHideBehaviorPrefs( |
990 ash::ShelfAutoHideBehavior behavior, | 1041 ash::ShelfAutoHideBehavior behavior, |
991 aura::RootWindow* root_window) { | 1042 aura::RootWindow* root_window) { |
992 // TODO(oshima): Support multiple launchers. | |
993 if (root_window != ash::Shell::GetPrimaryRootWindow()) | |
994 return; | |
995 | |
996 const char* value = NULL; | 1043 const char* value = NULL; |
997 switch (behavior) { | 1044 switch (behavior) { |
998 case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS: | 1045 case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS: |
999 value = ash::kShelfAutoHideBehaviorAlways; | 1046 value = ash::kShelfAutoHideBehaviorAlways; |
1000 break; | 1047 break; |
1001 case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER: | 1048 case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER: |
1002 value = ash::kShelfAutoHideBehaviorNever; | 1049 value = ash::kShelfAutoHideBehaviorNever; |
1003 break; | 1050 break; |
1004 } | 1051 } |
1005 // See comment in |kShelfAlignment| about why we have two prefs here. | 1052 |
1006 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehaviorLocal, value); | 1053 UpdatePerDisplayPref( |
1007 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehavior, value); | 1054 profile_->GetPrefs(), root_window, prefs::kShelfAutoHideBehavior, value); |
1055 | |
1056 if (root_window == ash::Shell::GetPrimaryRootWindow()) { | |
1057 // See comment in |kShelfAlignment| about why we have two prefs here. | |
1058 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehaviorLocal, value); | |
1059 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehavior, value); | |
1060 } | |
1008 } | 1061 } |
1009 | 1062 |
1010 void ChromeLauncherControllerPerApp::SetShelfAutoHideBehaviorFromPrefs() { | 1063 void ChromeLauncherControllerPerApp::SetShelfAutoHideBehaviorFromPrefs() { |
1011 // TODO(oshima): Support multiple displays. | 1064 ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); |
1012 aura::RootWindow* root_window = ash::Shell::GetPrimaryRootWindow(); | 1065 for (ash::Shell::RootWindowList::const_iterator iter = root_windows.begin(); |
1013 ash::Shell::GetInstance()->SetShelfAutoHideBehavior( | 1066 iter != root_windows.end(); ++iter) { |
1014 GetShelfAutoHideBehavior(root_window), root_window); | 1067 ash::Shell::GetInstance()->SetShelfAutoHideBehavior( |
1068 GetShelfAutoHideBehavior(*iter), *iter); | |
1069 } | |
1015 } | 1070 } |
1016 | 1071 |
1017 void ChromeLauncherControllerPerApp::SetShelfAlignmentFromPrefs() { | 1072 void ChromeLauncherControllerPerApp::SetShelfAlignmentFromPrefs() { |
1018 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 1073 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
1019 switches::kShowLauncherAlignmentMenu)) | 1074 switches::kShowLauncherAlignmentMenu)) |
1020 return; | 1075 return; |
1021 | 1076 |
1022 // See comment in |kShelfAlignment| as to why we consider two prefs. | 1077 ash::Shell::RootWindowList root_windows = ash::Shell::GetAllRootWindows(); |
1023 const std::string alignment_value( | 1078 for (ash::Shell::RootWindowList::const_iterator iter = root_windows.begin(); |
1024 GetLocalOrRemotePref(profile_->GetPrefs(), | 1079 iter != root_windows.end(); ++iter) { |
1025 prefs::kShelfAlignmentLocal, | 1080 // See comment in |kShelfAlignment| as to why we consider two prefs. |
1026 prefs::kShelfAlignment)); | 1081 const std::string alignment_value( |
1027 ash::ShelfAlignment alignment = ash::SHELF_ALIGNMENT_BOTTOM; | 1082 GetLocalOrRemotePref(profile_->GetPrefs(), |
1028 if (alignment_value == ash::kShelfAlignmentLeft) | 1083 *iter, |
1029 alignment = ash::SHELF_ALIGNMENT_LEFT; | 1084 prefs::kShelfAlignmentLocal, |
1030 else if (alignment_value == ash::kShelfAlignmentRight) | 1085 prefs::kShelfAlignment)); |
1031 alignment = ash::SHELF_ALIGNMENT_RIGHT; | 1086 ash::ShelfAlignment alignment = ash::SHELF_ALIGNMENT_BOTTOM; |
1032 // TODO(oshima): Support multiple displays. | 1087 if (alignment_value == ash::kShelfAlignmentLeft) |
1033 ash::Shell::GetInstance()->SetShelfAlignment( | 1088 alignment = ash::SHELF_ALIGNMENT_LEFT; |
1034 alignment, ash::Shell::GetPrimaryRootWindow()); | 1089 else if (alignment_value == ash::kShelfAlignmentRight) |
1090 alignment = ash::SHELF_ALIGNMENT_RIGHT; | |
1091 ash::Shell::GetInstance()->SetShelfAlignment(alignment, *iter); | |
1092 } | |
1035 } | 1093 } |
1036 | 1094 |
1037 WebContents* ChromeLauncherControllerPerApp::GetLastActiveWebContents( | 1095 WebContents* ChromeLauncherControllerPerApp::GetLastActiveWebContents( |
1038 const std::string& app_id) { | 1096 const std::string& app_id) { |
1039 AppIDToWebContentsListMap::const_iterator i = | 1097 AppIDToWebContentsListMap::const_iterator i = |
1040 app_id_to_web_contents_list_.find(app_id); | 1098 app_id_to_web_contents_list_.find(app_id); |
1041 if (i == app_id_to_web_contents_list_.end()) | 1099 if (i == app_id_to_web_contents_list_.end()) |
1042 return NULL; | 1100 return NULL; |
1043 DCHECK_GT(i->second.size(), 0u); | 1101 DCHECK_GT(i->second.size(), 0u); |
1044 return *i->second.begin(); | 1102 return *i->second.begin(); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1103 void ChromeLauncherControllerPerApp::SetAppIconLoaderForTest( | 1161 void ChromeLauncherControllerPerApp::SetAppIconLoaderForTest( |
1104 AppIconLoader* loader) { | 1162 AppIconLoader* loader) { |
1105 app_icon_loader_.reset(loader); | 1163 app_icon_loader_.reset(loader); |
1106 } | 1164 } |
1107 | 1165 |
1108 const std::string& | 1166 const std::string& |
1109 ChromeLauncherControllerPerApp::GetAppIdFromLauncherIdForTest( | 1167 ChromeLauncherControllerPerApp::GetAppIdFromLauncherIdForTest( |
1110 ash::LauncherID id) { | 1168 ash::LauncherID id) { |
1111 return id_to_item_controller_map_[id]->app_id(); | 1169 return id_to_item_controller_map_[id]->app_id(); |
1112 } | 1170 } |
OLD | NEW |