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 | |
169 // Overridden from FrameComponent: | 164 // Overridden from FrameComponent: |
170 virtual bool IgnoreEventsForPoint(const gfx::Point& point) OVERRIDE { | 165 virtual bool IgnoreEventsForPoint(const gfx::Point& point) OVERRIDE { |
171 gfx::Point translated_point(point); | 166 gfx::Point translated_point(point); |
172 ConvertPointToView(parent(), this, &translated_point); | 167 ConvertPointToView(parent(), this, &translated_point); |
173 if (PointIsInChildView(close_button_, translated_point)) | 168 if (PointIsInChildView(close_button_, translated_point)) |
174 return false; | 169 return false; |
175 if (PointIsInChildView(zoom_button_, translated_point)) | 170 if (PointIsInChildView(zoom_button_, translated_point)) |
176 return false; | 171 return false; |
177 return FrameComponent::IgnoreEventsForPoint(point); | 172 return FrameComponent::IgnoreEventsForPoint(point); |
178 } | 173 } |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 int ToplevelFrameView::NonClientHitTest(const gfx::Point& point) { | 389 int ToplevelFrameView::NonClientHitTest(const gfx::Point& point) { |
395 current_hittest_code_ = NonClientHitTestImpl(point); | 390 current_hittest_code_ = NonClientHitTestImpl(point); |
396 return current_hittest_code_; | 391 return current_hittest_code_; |
397 } | 392 } |
398 | 393 |
399 void ToplevelFrameView::GetWindowMask(const gfx::Size& size, | 394 void ToplevelFrameView::GetWindowMask(const gfx::Size& size, |
400 gfx::Path* window_mask) { | 395 gfx::Path* window_mask) { |
401 // Nothing. | 396 // Nothing. |
402 } | 397 } |
403 | 398 |
404 void ToplevelFrameView::EnableClose(bool enable) { | |
405 caption_->EnableClose(enable); | |
406 } | |
407 | |
408 void ToplevelFrameView::ResetWindowControls() { | 399 void ToplevelFrameView::ResetWindowControls() { |
409 NOTIMPLEMENTED(); | 400 NOTIMPLEMENTED(); |
410 } | 401 } |
411 | 402 |
412 void ToplevelFrameView::UpdateWindowIcon() { | 403 void ToplevelFrameView::UpdateWindowIcon() { |
413 NOTIMPLEMENTED(); | 404 NOTIMPLEMENTED(); |
414 } | 405 } |
415 | 406 |
416 //////////////////////////////////////////////////////////////////////////////// | 407 //////////////////////////////////////////////////////////////////////////////// |
417 // ToplevelFrameView, views::View overrides: | 408 // ToplevelFrameView, views::View overrides: |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 return aura::kCursorNorthWestResize; | 478 return aura::kCursorNorthWestResize; |
488 case HTTOPRIGHT: | 479 case HTTOPRIGHT: |
489 return aura::kCursorNorthEastResize; | 480 return aura::kCursorNorthEastResize; |
490 default: | 481 default: |
491 return aura::kCursorNull; | 482 return aura::kCursorNull; |
492 } | 483 } |
493 } | 484 } |
494 | 485 |
495 } // namespace internal | 486 } // namespace internal |
496 } // namespace aura_shell | 487 } // namespace aura_shell |
OLD | NEW |