| 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/glass_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/glass_browser_frame_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 214 |
| 215 int frame_border_thickness = FrameBorderThickness(); | 215 int frame_border_thickness = FrameBorderThickness(); |
| 216 int window_component = GetHTComponentForFrame(point, frame_border_thickness, | 216 int window_component = GetHTComponentForFrame(point, frame_border_thickness, |
| 217 nonclient_border_thickness, frame_border_thickness, | 217 nonclient_border_thickness, frame_border_thickness, |
| 218 kResizeAreaCornerSize - frame_border_thickness, | 218 kResizeAreaCornerSize - frame_border_thickness, |
| 219 frame_->widget_delegate()->CanResize()); | 219 frame_->widget_delegate()->CanResize()); |
| 220 // Fall back to the caption if no other component matches. | 220 // Fall back to the caption if no other component matches. |
| 221 return (window_component == HTNOWHERE) ? HTCAPTION : window_component; | 221 return (window_component == HTNOWHERE) ? HTCAPTION : window_component; |
| 222 } | 222 } |
| 223 | 223 |
| 224 AvatarMenuButton* GlassBrowserFrameView::GetAvatarMenuButton() { |
| 225 return avatar_button_.get(); |
| 226 } |
| 227 |
| 224 /////////////////////////////////////////////////////////////////////////////// | 228 /////////////////////////////////////////////////////////////////////////////// |
| 225 // GlassBrowserFrameView, views::View overrides: | 229 // GlassBrowserFrameView, views::View overrides: |
| 226 | 230 |
| 227 void GlassBrowserFrameView::OnPaint(gfx::Canvas* canvas) { | 231 void GlassBrowserFrameView::OnPaint(gfx::Canvas* canvas) { |
| 228 if (!browser_view_->IsTabStripVisible()) | 232 if (!browser_view_->IsTabStripVisible()) |
| 229 return; // Nothing is visible, so don't bother to paint. | 233 return; // Nothing is visible, so don't bother to paint. |
| 230 | 234 |
| 231 PaintToolbarBackground(canvas); | 235 PaintToolbarBackground(canvas); |
| 232 if (!frame_->IsMaximized()) | 236 if (!frame_->IsMaximized()) |
| 233 PaintRestoredClientEdge(canvas); | 237 PaintRestoredClientEdge(canvas); |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 ProfileInfoCache& cache = | 529 ProfileInfoCache& cache = |
| 526 g_browser_process->profile_manager()->GetProfileInfoCache(); | 530 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 527 Profile* profile = browser_view_->browser()->profile(); | 531 Profile* profile = browser_view_->browser()->profile(); |
| 528 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 532 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
| 529 if (index != std::string::npos) { | 533 if (index != std::string::npos) { |
| 530 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 534 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); |
| 531 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); | 535 avatar_button_->SetText(cache.GetNameOfProfileAtIndex(index)); |
| 532 } | 536 } |
| 533 } | 537 } |
| 534 } | 538 } |
| OLD | NEW |