| 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 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 return gfx::Rect(border_thickness, top_height, | 1149 return gfx::Rect(border_thickness, top_height, |
| 1150 std::max(0, width - (2 * border_thickness)), | 1150 std::max(0, width - (2 * border_thickness)), |
| 1151 std::max(0, height - GetReservedHeight() - | 1151 std::max(0, height - GetReservedHeight() - |
| 1152 top_height - border_thickness)); | 1152 top_height - border_thickness)); |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 void OpaqueBrowserFrameView::UpdateAvatarInfo() { | 1155 void OpaqueBrowserFrameView::UpdateAvatarInfo() { |
| 1156 if (browser_view_->IsOffTheRecord()) { | 1156 if (browser_view_->IsOffTheRecord()) { |
| 1157 avatar_button_->SetIcon(browser_view_->GetOTRAvatarIcon()); | 1157 avatar_button_->SetIcon(browser_view_->GetOTRAvatarIcon()); |
| 1158 } else { | 1158 } else { |
| 1159 ProfileInfoInterface& cache = | 1159 ProfileInfoCache& cache = |
| 1160 g_browser_process->profile_manager()->GetProfileInfo(); | 1160 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 1161 Profile* profile = browser_view_->browser()->profile(); | 1161 Profile* profile = browser_view_->browser()->profile(); |
| 1162 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 1162 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
| 1163 if (index != std::string::npos) { | 1163 if (index != std::string::npos) { |
| 1164 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 1164 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); |
| 1165 avatar_button_->SetText(UTF16ToWideHack( | 1165 avatar_button_->SetText(UTF16ToWideHack( |
| 1166 cache.GetNameOfProfileAtIndex(index))); | 1166 cache.GetNameOfProfileAtIndex(index))); |
| 1167 } | 1167 } |
| 1168 } | 1168 } |
| 1169 } | 1169 } |
| OLD | NEW |