| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/common/ash_layout_constants.h" | 9 #include "ash/common/ash_layout_constants.h" |
| 10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" | 10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/browser/ui/views/frame/browser_view.h" | 25 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 26 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 26 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
| 27 #include "chrome/browser/ui/views/frame/web_app_left_header_view_ash.h" | 27 #include "chrome/browser/ui/views/frame/web_app_left_header_view_ash.h" |
| 28 #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" | 28 #include "chrome/browser/ui/views/profiles/profile_indicator_icon.h" |
| 29 #include "chrome/browser/ui/views/tab_icon_view.h" | 29 #include "chrome/browser/ui/views/tab_icon_view.h" |
| 30 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 30 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 31 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 31 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
| 32 #include "chrome/browser/web_applications/web_app.h" | 32 #include "chrome/browser/web_applications/web_app.h" |
| 33 #include "chrome/grit/theme_resources.h" | 33 #include "chrome/grit/theme_resources.h" |
| 34 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
| 35 #include "ui/accessibility/ax_view_state.h" | 35 #include "ui/accessibility/ax_node_data.h" |
| 36 #include "ui/aura/client/aura_constants.h" | 36 #include "ui/aura/client/aura_constants.h" |
| 37 #include "ui/aura/window.h" | 37 #include "ui/aura/window.h" |
| 38 #include "ui/base/hit_test.h" | 38 #include "ui/base/hit_test.h" |
| 39 #include "ui/base/layout.h" | 39 #include "ui/base/layout.h" |
| 40 #include "ui/base/theme_provider.h" | 40 #include "ui/base/theme_provider.h" |
| 41 #include "ui/compositor/layer_animator.h" | 41 #include "ui/compositor/layer_animator.h" |
| 42 #include "ui/gfx/canvas.h" | 42 #include "ui/gfx/canvas.h" |
| 43 #include "ui/gfx/image/image_skia.h" | 43 #include "ui/gfx/image/image_skia.h" |
| 44 #include "ui/gfx/scoped_canvas.h" | 44 #include "ui/gfx/scoped_canvas.h" |
| 45 #include "ui/views/controls/label.h" | 45 #include "ui/views/controls/label.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 BrowserNonClientFrameView::Layout(); | 309 BrowserNonClientFrameView::Layout(); |
| 310 frame()->GetNativeWindow()->SetProperty( | 310 frame()->GetNativeWindow()->SetProperty( |
| 311 aura::client::kTopViewInset, | 311 aura::client::kTopViewInset, |
| 312 browser_view()->IsTabStripVisible() ? 0 : GetTopInset(true)); | 312 browser_view()->IsTabStripVisible() ? 0 : GetTopInset(true)); |
| 313 } | 313 } |
| 314 | 314 |
| 315 const char* BrowserNonClientFrameViewAsh::GetClassName() const { | 315 const char* BrowserNonClientFrameViewAsh::GetClassName() const { |
| 316 return "BrowserNonClientFrameViewAsh"; | 316 return "BrowserNonClientFrameViewAsh"; |
| 317 } | 317 } |
| 318 | 318 |
| 319 void BrowserNonClientFrameViewAsh::GetAccessibleState(ui::AXViewState* state) { | 319 void BrowserNonClientFrameViewAsh::GetAccessibleNodeData( |
| 320 state->role = ui::AX_ROLE_TITLE_BAR; | 320 ui::AXNodeData* node_data) { |
| 321 node_data->role = ui::AX_ROLE_TITLE_BAR; |
| 321 } | 322 } |
| 322 | 323 |
| 323 gfx::Size BrowserNonClientFrameViewAsh::GetMinimumSize() const { | 324 gfx::Size BrowserNonClientFrameViewAsh::GetMinimumSize() const { |
| 324 gfx::Size min_client_view_size(frame()->client_view()->GetMinimumSize()); | 325 gfx::Size min_client_view_size(frame()->client_view()->GetMinimumSize()); |
| 325 int min_width = std::max(header_painter_->GetMinimumHeaderWidth(), | 326 int min_width = std::max(header_painter_->GetMinimumHeaderWidth(), |
| 326 min_client_view_size.width()); | 327 min_client_view_size.width()); |
| 327 if (browser_view()->IsTabStripVisible()) { | 328 if (browser_view()->IsTabStripVisible()) { |
| 328 // Ensure that the minimum width is enough to hold a minimum width tab strip | 329 // Ensure that the minimum width is enough to hold a minimum width tab strip |
| 329 // at its usual insets. | 330 // at its usual insets. |
| 330 const int min_tabstrip_width = | 331 const int min_tabstrip_width = |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 toolbar_bounds.width(), 0); | 509 toolbar_bounds.width(), 0); |
| 509 BrowserView::Paint1pxHorizontalLine(canvas, GetToolbarTopSeparatorColor(), | 510 BrowserView::Paint1pxHorizontalLine(canvas, GetToolbarTopSeparatorColor(), |
| 510 separator_rect, true); | 511 separator_rect, true); |
| 511 | 512 |
| 512 // Toolbar/content separator. | 513 // Toolbar/content separator. |
| 513 toolbar_bounds.Inset(kClientEdgeThickness, 0); | 514 toolbar_bounds.Inset(kClientEdgeThickness, 0); |
| 514 BrowserView::Paint1pxHorizontalLine( | 515 BrowserView::Paint1pxHorizontalLine( |
| 515 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), | 516 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), |
| 516 toolbar_bounds, true); | 517 toolbar_bounds, true); |
| 517 } | 518 } |
| OLD | NEW |