Chromium Code Reviews| 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/launcher/launcher_util.h" | 10 #include "ash/launcher/launcher_util.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 std::string per_display_value; | 131 std::string per_display_value; |
| 132 if (shelf_prefs->GetDictionary(pref_key, &display_pref) && | 132 if (shelf_prefs->GetDictionary(pref_key, &display_pref) && |
| 133 display_pref->GetString(path, &per_display_value)) | 133 display_pref->GetString(path, &per_display_value)) |
| 134 return per_display_value; | 134 return per_display_value; |
| 135 | 135 |
| 136 // If the pref for the specified display is not found, scan the whole prefs | 136 // If the pref for the specified display is not found, scan the whole prefs |
| 137 // and check if the prefs for other display is already specified. | 137 // and check if the prefs for other display is already specified. |
| 138 for (base::DictionaryValue::Iterator iter(*shelf_prefs); | 138 for (base::DictionaryValue::Iterator iter(*shelf_prefs); |
| 139 !iter.IsAtEnd(); iter.Advance()) { | 139 !iter.IsAtEnd(); iter.Advance()) { |
| 140 const base::DictionaryValue* display_pref = NULL; | 140 const base::DictionaryValue* display_pref = NULL; |
| 141 std::string unused_value; | |
|
oshima
2013/02/06 19:11:38
nit: move it to outside of the loop.
Jun Mukai
2013/02/06 19:44:32
Done.
| |
| 141 if (iter.value().GetAsDictionary(&display_pref) && | 142 if (iter.value().GetAsDictionary(&display_pref) && |
| 142 display_pref->GetString(path, static_cast<std::string*>(NULL))) { | 143 display_pref->GetString(path, &unused_value)) { |
| 143 has_per_display_prefs = true; | 144 has_per_display_prefs = true; |
| 144 break; | 145 break; |
| 145 } | 146 } |
| 146 } | 147 } |
| 147 } | 148 } |
| 148 | 149 |
| 149 if (local_pref->IsRecommended() || !has_per_display_prefs) | 150 if (local_pref->IsRecommended() || !has_per_display_prefs) |
| 150 return value; | 151 return value; |
| 151 | 152 |
| 152 const base::Value* default_value = | 153 const base::Value* default_value = |
| (...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1370 WebContents* web_contents = | 1371 WebContents* web_contents = |
| 1371 tab_strip->GetWebContentsAt(tab_strip->active_index()); | 1372 tab_strip->GetWebContentsAt(tab_strip->active_index()); |
| 1372 gfx::Image app_icon = GetAppListIcon(web_contents); | 1373 gfx::Image app_icon = GetAppListIcon(web_contents); |
| 1373 items.push_back(new ChromeLauncherAppMenuItemBrowser( | 1374 items.push_back(new ChromeLauncherAppMenuItemBrowser( |
| 1374 web_contents->GetTitle(), | 1375 web_contents->GetTitle(), |
| 1375 app_icon.IsEmpty() ? NULL : &app_icon, | 1376 app_icon.IsEmpty() ? NULL : &app_icon, |
| 1376 browser)); | 1377 browser)); |
| 1377 } | 1378 } |
| 1378 return items.Pass(); | 1379 return items.Pass(); |
| 1379 } | 1380 } |
| OLD | NEW |