| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/frame/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 RemoveChildView(avatar_button_.release()); | 1158 RemoveChildView(avatar_button_.release()); |
| 1159 frame_->GetRootView()->Layout(); | 1159 frame_->GetRootView()->Layout(); |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 if (!avatar_button_.get()) | 1162 if (!avatar_button_.get()) |
| 1163 return; | 1163 return; |
| 1164 | 1164 |
| 1165 if (browser_view_->IsOffTheRecord()) { | 1165 if (browser_view_->IsOffTheRecord()) { |
| 1166 avatar_button_->SetIcon(browser_view_->GetOTRAvatarIcon()); | 1166 avatar_button_->SetIcon(browser_view_->GetOTRAvatarIcon()); |
| 1167 } else { | 1167 } else { |
| 1168 ProfileInfoCache& cache = | 1168 ProfileInfoInterface& cache = |
| 1169 g_browser_process->profile_manager()->GetProfileInfoCache(); | 1169 g_browser_process->profile_manager()->GetProfileInfo(); |
| 1170 Profile* profile = browser_view_->browser()->profile(); | 1170 Profile* profile = browser_view_->browser()->profile(); |
| 1171 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 1171 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
| 1172 if (index != std::string::npos) { | 1172 if (index != std::string::npos) { |
| 1173 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 1173 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); |
| 1174 avatar_button_->SetText(UTF16ToWideHack( | 1174 avatar_button_->SetText(UTF16ToWideHack( |
| 1175 cache.GetNameOfProfileAtIndex(index))); | 1175 cache.GetNameOfProfileAtIndex(index))); |
| 1176 } | 1176 } |
| 1177 } | 1177 } |
| 1178 } | 1178 } |
| OLD | NEW |