| 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/views/frame/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 } | 171 } |
| 172 | 172 |
| 173 window_title_ = new views::Label(browser_view->GetWindowTitle(), | 173 window_title_ = new views::Label(browser_view->GetWindowTitle(), |
| 174 BrowserFrame::GetTitleFont()); | 174 BrowserFrame::GetTitleFont()); |
| 175 window_title_->SetVisible(browser_view->ShouldShowWindowTitle()); | 175 window_title_->SetVisible(browser_view->ShouldShowWindowTitle()); |
| 176 window_title_->SetEnabledColor(SK_ColorWHITE); | 176 window_title_->SetEnabledColor(SK_ColorWHITE); |
| 177 // TODO(msw): Use a transparent background color as a workaround to use the | 177 // TODO(msw): Use a transparent background color as a workaround to use the |
| 178 // gfx::Canvas::NO_SUBPIXEL_RENDERING flag and avoid some visual artifacts. | 178 // gfx::Canvas::NO_SUBPIXEL_RENDERING flag and avoid some visual artifacts. |
| 179 window_title_->SetBackgroundColor(0x00000000); | 179 window_title_->SetBackgroundColor(0x00000000); |
| 180 window_title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 180 window_title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 181 window_title_->SetElideBehavior(views::Label::ELIDE_AT_END); | |
| 182 AddChildView(window_title_); | 181 AddChildView(window_title_); |
| 183 | 182 |
| 184 UpdateAvatarInfo(); | 183 UpdateAvatarInfo(); |
| 185 if (!browser_view->IsOffTheRecord()) { | 184 if (!browser_view->IsOffTheRecord()) { |
| 186 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, | 185 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_CACHED_INFO_CHANGED, |
| 187 content::NotificationService::AllSources()); | 186 content::NotificationService::AllSources()); |
| 188 } | 187 } |
| 189 } | 188 } |
| 190 | 189 |
| 191 OpaqueBrowserFrameView::~OpaqueBrowserFrameView() { | 190 OpaqueBrowserFrameView::~OpaqueBrowserFrameView() { |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1027 | 1026 |
| 1028 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, | 1027 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, |
| 1029 int height) const { | 1028 int height) const { |
| 1030 int top_height = NonClientTopBorderHeight(false); | 1029 int top_height = NonClientTopBorderHeight(false); |
| 1031 int border_thickness = NonClientBorderThickness(); | 1030 int border_thickness = NonClientBorderThickness(); |
| 1032 return gfx::Rect(border_thickness, top_height, | 1031 return gfx::Rect(border_thickness, top_height, |
| 1033 std::max(0, width - (2 * border_thickness)), | 1032 std::max(0, width - (2 * border_thickness)), |
| 1034 std::max(0, height - GetReservedHeight() - | 1033 std::max(0, height - GetReservedHeight() - |
| 1035 top_height - border_thickness)); | 1034 top_height - border_thickness)); |
| 1036 } | 1035 } |
| OLD | NEW |