| 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 "ui/aura_shell/toplevel_frame_view.h" | 5 #include "ui/aura_shell/toplevel_frame_view.h" |
| 6 | 6 |
| 7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
| 8 #include "ui/aura/cursor.h" | 8 #include "ui/aura/cursor.h" |
| 9 #include "ui/base/animation/throb_animation.h" | 9 #include "ui/base/animation/throb_animation.h" |
| 10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 gfx::Point translated_point(point); | 154 gfx::Point translated_point(point); |
| 155 View::ConvertPointToView(parent(), this, &translated_point); | 155 View::ConvertPointToView(parent(), this, &translated_point); |
| 156 // The window controls come second. | 156 // The window controls come second. |
| 157 if (close_button_->GetMirroredBounds().Contains(translated_point)) | 157 if (close_button_->GetMirroredBounds().Contains(translated_point)) |
| 158 return HTCLOSE; | 158 return HTCLOSE; |
| 159 else if (zoom_button_->GetMirroredBounds().Contains(translated_point)) | 159 else if (zoom_button_->GetMirroredBounds().Contains(translated_point)) |
| 160 return HTMAXBUTTON; | 160 return HTMAXBUTTON; |
| 161 return HTNOWHERE; | 161 return HTNOWHERE; |
| 162 } | 162 } |
| 163 | 163 |
| 164 // Updates the enabled state of the close button. |
| 165 void EnableClose(bool enable) { |
| 166 close_button_->SetEnabled(enable); |
| 167 } |
| 168 |
| 164 // Overridden from FrameComponent: | 169 // Overridden from FrameComponent: |
| 165 virtual bool IgnoreEventsForPoint(const gfx::Point& point) OVERRIDE { | 170 virtual bool IgnoreEventsForPoint(const gfx::Point& point) OVERRIDE { |
| 166 gfx::Point translated_point(point); | 171 gfx::Point translated_point(point); |
| 167 ConvertPointToView(parent(), this, &translated_point); | 172 ConvertPointToView(parent(), this, &translated_point); |
| 168 if (PointIsInChildView(close_button_, translated_point)) | 173 if (PointIsInChildView(close_button_, translated_point)) |
| 169 return false; | 174 return false; |
| 170 if (PointIsInChildView(zoom_button_, translated_point)) | 175 if (PointIsInChildView(zoom_button_, translated_point)) |
| 171 return false; | 176 return false; |
| 172 return FrameComponent::IgnoreEventsForPoint(point); | 177 return FrameComponent::IgnoreEventsForPoint(point); |
| 173 } | 178 } |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 int ToplevelFrameView::NonClientHitTest(const gfx::Point& point) { | 394 int ToplevelFrameView::NonClientHitTest(const gfx::Point& point) { |
| 390 current_hittest_code_ = NonClientHitTestImpl(point); | 395 current_hittest_code_ = NonClientHitTestImpl(point); |
| 391 return current_hittest_code_; | 396 return current_hittest_code_; |
| 392 } | 397 } |
| 393 | 398 |
| 394 void ToplevelFrameView::GetWindowMask(const gfx::Size& size, | 399 void ToplevelFrameView::GetWindowMask(const gfx::Size& size, |
| 395 gfx::Path* window_mask) { | 400 gfx::Path* window_mask) { |
| 396 // Nothing. | 401 // Nothing. |
| 397 } | 402 } |
| 398 | 403 |
| 404 void ToplevelFrameView::EnableClose(bool enable) { |
| 405 caption_->EnableClose(enable); |
| 406 } |
| 407 |
| 399 void ToplevelFrameView::ResetWindowControls() { | 408 void ToplevelFrameView::ResetWindowControls() { |
| 400 NOTIMPLEMENTED(); | 409 NOTIMPLEMENTED(); |
| 401 } | 410 } |
| 402 | 411 |
| 403 void ToplevelFrameView::UpdateWindowIcon() { | 412 void ToplevelFrameView::UpdateWindowIcon() { |
| 404 NOTIMPLEMENTED(); | 413 NOTIMPLEMENTED(); |
| 405 } | 414 } |
| 406 | 415 |
| 407 //////////////////////////////////////////////////////////////////////////////// | 416 //////////////////////////////////////////////////////////////////////////////// |
| 408 // ToplevelFrameView, views::View overrides: | 417 // ToplevelFrameView, views::View overrides: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 return aura::kCursorNorthWestResize; | 487 return aura::kCursorNorthWestResize; |
| 479 case HTTOPRIGHT: | 488 case HTTOPRIGHT: |
| 480 return aura::kCursorNorthEastResize; | 489 return aura::kCursorNorthEastResize; |
| 481 default: | 490 default: |
| 482 return aura::kCursorNull; | 491 return aura::kCursorNull; |
| 483 } | 492 } |
| 484 } | 493 } |
| 485 | 494 |
| 486 } // namespace internal | 495 } // namespace internal |
| 487 } // namespace aura_shell | 496 } // namespace aura_shell |
| OLD | NEW |