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/browser_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
9 #include "ash/frame/default_header_painter.h" | 9 #include "ash/frame/default_header_painter.h" |
10 #include "ash/frame/frame_border_hit_test_controller.h" | 10 #include "ash/frame/frame_border_hit_test_controller.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 319 |
320 // Claim |rect| if it is above the top of the topmost view in the client area. | 320 // Claim |rect| if it is above the top of the topmost view in the client area. |
321 return rect.y() < GetTopInset(); | 321 return rect.y() < GetTopInset(); |
322 } | 322 } |
323 | 323 |
324 void BrowserNonClientFrameViewAsh::GetAccessibleState( | 324 void BrowserNonClientFrameViewAsh::GetAccessibleState( |
325 ui::AXViewState* state) { | 325 ui::AXViewState* state) { |
326 state->role = ui::AX_ROLE_TITLE_BAR; | 326 state->role = ui::AX_ROLE_TITLE_BAR; |
327 } | 327 } |
328 | 328 |
329 gfx::Size BrowserNonClientFrameViewAsh::GetMinimumSize() { | 329 gfx::Size BrowserNonClientFrameViewAsh::GetMinimumSize() const { |
330 gfx::Size min_client_view_size(frame()->client_view()->GetMinimumSize()); | 330 gfx::Size min_client_view_size(frame()->client_view()->GetMinimumSize()); |
331 int min_width = std::max(header_painter_->GetMinimumHeaderWidth(), | 331 int min_width = std::max(header_painter_->GetMinimumHeaderWidth(), |
332 min_client_view_size.width()); | 332 min_client_view_size.width()); |
333 if (browser_view()->IsTabStripVisible()) { | 333 if (browser_view()->IsTabStripVisible()) { |
334 // Ensure that the minimum width is enough to hold a minimum width tab strip | 334 // Ensure that the minimum width is enough to hold a minimum width tab strip |
335 // at its usual insets. | 335 // at its usual insets. |
336 int min_tabstrip_width = | 336 int min_tabstrip_width = |
337 browser_view()->tabstrip()->GetMinimumSize().width(); | 337 browser_view()->tabstrip()->GetMinimumSize().width(); |
338 min_width = std::max(min_width, | 338 min_width = std::max(min_width, |
339 min_tabstrip_width + GetTabStripLeftInset() + GetTabStripRightInset()); | 339 min_tabstrip_width + GetTabStripLeftInset() + GetTabStripRightInset()); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 533 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
534 } | 534 } |
535 | 535 |
536 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { | 536 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { |
537 DCHECK(!UsePackagedAppHeaderStyle()); | 537 DCHECK(!UsePackagedAppHeaderStyle()); |
538 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), | 538 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), |
539 width(), kClientEdgeThickness), | 539 width(), kClientEdgeThickness), |
540 ThemeProperties::GetDefaultColor( | 540 ThemeProperties::GetDefaultColor( |
541 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 541 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
542 } | 542 } |
OLD | NEW |