| 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
" |
| 11 #include "ash/common/frame/default_header_painter.h" |
| 12 #include "ash/common/frame/frame_border_hit_test.h" |
| 13 #include "ash/common/frame/header_painter_util.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 14 #include "ash/common/material_design/material_design_controller.h" |
| 11 #include "ash/common/wm_shell.h" | 15 #include "ash/common/wm_shell.h" |
| 12 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | |
| 13 #include "ash/frame/default_header_painter.h" | |
| 14 #include "ash/frame/frame_border_hit_test_controller.h" | 16 #include "ash/frame/frame_border_hit_test_controller.h" |
| 15 #include "ash/frame/header_painter_util.h" | |
| 16 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 17 #include "chrome/app/chrome_command_ids.h" | 18 #include "chrome/app/chrome_command_ids.h" |
| 18 #include "chrome/browser/extensions/extension_util.h" | 19 #include "chrome/browser/extensions/extension_util.h" |
| 19 #include "chrome/browser/profiles/profiles_state.h" | 20 #include "chrome/browser/profiles/profiles_state.h" |
| 20 #include "chrome/browser/themes/theme_properties.h" | 21 #include "chrome/browser/themes/theme_properties.h" |
| 21 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 22 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 22 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
| 23 #include "chrome/browser/ui/browser_commands.h" | 24 #include "chrome/browser/ui/browser_commands.h" |
| 24 #include "chrome/browser/ui/layout_constants.h" | 25 #include "chrome/browser/ui/layout_constants.h" |
| 25 #include "chrome/browser/ui/views/frame/browser_frame.h" | 26 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // BrowserNonClientFrameViewAsh. | 209 // BrowserNonClientFrameViewAsh. |
| 209 return bounds(); | 210 return bounds(); |
| 210 } | 211 } |
| 211 | 212 |
| 212 gfx::Rect BrowserNonClientFrameViewAsh::GetWindowBoundsForClientBounds( | 213 gfx::Rect BrowserNonClientFrameViewAsh::GetWindowBoundsForClientBounds( |
| 213 const gfx::Rect& client_bounds) const { | 214 const gfx::Rect& client_bounds) const { |
| 214 return client_bounds; | 215 return client_bounds; |
| 215 } | 216 } |
| 216 | 217 |
| 217 int BrowserNonClientFrameViewAsh::NonClientHitTest(const gfx::Point& point) { | 218 int BrowserNonClientFrameViewAsh::NonClientHitTest(const gfx::Point& point) { |
| 218 const int hit_test = ash::FrameBorderHitTestController::NonClientHitTest( | 219 const int hit_test = |
| 219 this, caption_button_container_, point); | 220 ash::FrameBorderNonClientHitTest(this, caption_button_container_, point); |
| 220 | 221 |
| 221 // See if the point is actually within the web app back button. | 222 // See if the point is actually within the web app back button. |
| 222 if (hit_test == HTCAPTION && web_app_left_header_view_ && | 223 if (hit_test == HTCAPTION && web_app_left_header_view_ && |
| 223 ConvertedHitTest(this, web_app_left_header_view_, point)) { | 224 ConvertedHitTest(this, web_app_left_header_view_, point)) { |
| 224 return HTCLIENT; | 225 return HTCLIENT; |
| 225 } | 226 } |
| 226 | 227 |
| 227 // When the window is restored we want a large click target above the tabs | 228 // When the window is restored we want a large click target above the tabs |
| 228 // to drag the window, so redirect clicks in the tab's shadow to caption. | 229 // to drag the window, so redirect clicks in the tab's shadow to caption. |
| 229 if (hit_test == HTCLIENT && !frame()->IsMaximized() && | 230 if (hit_test == HTCLIENT && !frame()->IsMaximized() && |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 // TODO(pkasting): The "2 *" part of this makes no sense to me. | 587 // TODO(pkasting): The "2 *" part of this makes no sense to me. |
| 587 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w, | 588 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w, |
| 588 img_y, img_w, img_h); | 589 img_y, img_w, img_h); |
| 589 | 590 |
| 590 // Toolbar/content separator. | 591 // Toolbar/content separator. |
| 591 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, | 592 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, |
| 592 kClientEdgeThickness, 0); | 593 kClientEdgeThickness, 0); |
| 593 canvas->FillRect(toolbar_bounds, separator_color); | 594 canvas->FillRect(toolbar_bounds, separator_color); |
| 594 } | 595 } |
| 595 } | 596 } |
| OLD | NEW |