| 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" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 std::string per_display_value; | 190 std::string per_display_value; |
| 191 if (shelf_prefs->GetDictionary(pref_key, &display_pref) && | 191 if (shelf_prefs->GetDictionary(pref_key, &display_pref) && |
| 192 display_pref->GetString(path, &per_display_value)) | 192 display_pref->GetString(path, &per_display_value)) |
| 193 return per_display_value; | 193 return per_display_value; |
| 194 | 194 |
| 195 // If the pref for the specified display is not found, scan the whole prefs | 195 // If the pref for the specified display is not found, scan the whole prefs |
| 196 // and check if the prefs for other display is already specified. | 196 // and check if the prefs for other display is already specified. |
| 197 for (base::DictionaryValue::Iterator iter(*shelf_prefs); | 197 for (base::DictionaryValue::Iterator iter(*shelf_prefs); |
| 198 !iter.IsAtEnd(); iter.Advance()) { | 198 !iter.IsAtEnd(); iter.Advance()) { |
| 199 const base::DictionaryValue* display_pref = NULL; | 199 const base::DictionaryValue* display_pref = NULL; |
| 200 std::string unused_value; |
| 200 if (iter.value().GetAsDictionary(&display_pref) && | 201 if (iter.value().GetAsDictionary(&display_pref) && |
| 201 display_pref->GetString(path, static_cast<std::string*>(NULL))) { | 202 display_pref->GetString(path, &unused_value)) { |
| 202 has_per_display_prefs = true; | 203 has_per_display_prefs = true; |
| 203 break; | 204 break; |
| 204 } | 205 } |
| 205 } | 206 } |
| 206 } | 207 } |
| 207 | 208 |
| 208 if (local_pref->IsRecommended() || !has_per_display_prefs) | 209 if (local_pref->IsRecommended() || !has_per_display_prefs) |
| 209 return value; | 210 return value; |
| 210 | 211 |
| 211 const base::Value* default_value = | 212 const base::Value* default_value = |
| (...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1295 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( | 1296 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( |
| 1296 ash::AppIconLoader* loader) { | 1297 ash::AppIconLoader* loader) { |
| 1297 app_icon_loader_.reset(loader); | 1298 app_icon_loader_.reset(loader); |
| 1298 } | 1299 } |
| 1299 | 1300 |
| 1300 const std::string& | 1301 const std::string& |
| 1301 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( | 1302 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( |
| 1302 ash::LauncherID id) { | 1303 ash::LauncherID id) { |
| 1303 return id_to_item_controller_map_[id]->app_id(); | 1304 return id_to_item_controller_map_[id]->app_id(); |
| 1304 } | 1305 } |
| OLD | NEW |