| 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/cocoa/panels/panel_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/panels/panel_cocoa.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 8 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
| 9 #import "chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.h" | 9 #import "chrome/browser/ui/cocoa/panels/panel_titlebar_view_cocoa.h" |
| 10 #import "chrome/browser/ui/cocoa/panels/panel_utils_cocoa.h" | 10 #import "chrome/browser/ui/cocoa/panels/panel_utils_cocoa.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 // Overridden from NativePanelTesting | 283 // Overridden from NativePanelTesting |
| 284 virtual void PressLeftMouseButtonTitlebar( | 284 virtual void PressLeftMouseButtonTitlebar( |
| 285 const gfx::Point& mouse_location, panel::ClickModifier modifier) OVERRIDE; | 285 const gfx::Point& mouse_location, panel::ClickModifier modifier) OVERRIDE; |
| 286 virtual void ReleaseMouseButtonTitlebar( | 286 virtual void ReleaseMouseButtonTitlebar( |
| 287 panel::ClickModifier modifier) OVERRIDE; | 287 panel::ClickModifier modifier) OVERRIDE; |
| 288 virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE; | 288 virtual void DragTitlebar(const gfx::Point& mouse_location) OVERRIDE; |
| 289 virtual void CancelDragTitlebar() OVERRIDE; | 289 virtual void CancelDragTitlebar() OVERRIDE; |
| 290 virtual void FinishDragTitlebar() OVERRIDE; | 290 virtual void FinishDragTitlebar() OVERRIDE; |
| 291 virtual bool VerifyDrawingAttention() const OVERRIDE; | 291 virtual bool VerifyDrawingAttention() const OVERRIDE; |
| 292 virtual bool VerifyActiveState(bool is_active) OVERRIDE; | 292 virtual bool VerifyActiveState(bool is_active) OVERRIDE; |
| 293 virtual bool VerifyAppIcon() const OVERRIDE; |
| 293 virtual bool IsWindowSizeKnown() const OVERRIDE; | 294 virtual bool IsWindowSizeKnown() const OVERRIDE; |
| 294 virtual bool IsAnimatingBounds() const OVERRIDE; | 295 virtual bool IsAnimatingBounds() const OVERRIDE; |
| 295 virtual bool IsButtonVisible( | 296 virtual bool IsButtonVisible( |
| 296 panel::TitlebarButtonType button_type) const OVERRIDE; | 297 panel::TitlebarButtonType button_type) const OVERRIDE; |
| 297 | 298 |
| 298 private: | 299 private: |
| 299 PanelTitlebarViewCocoa* titlebar() const; | 300 PanelTitlebarViewCocoa* titlebar() const; |
| 300 // Weak, assumed always to outlive this test API object. | 301 // Weak, assumed always to outlive this test API object. |
| 301 PanelCocoa* native_panel_window_; | 302 PanelCocoa* native_panel_window_; |
| 302 }; | 303 }; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 351 |
| 351 bool CocoaNativePanelTesting::VerifyDrawingAttention() const { | 352 bool CocoaNativePanelTesting::VerifyDrawingAttention() const { |
| 352 return [titlebar() isDrawingAttention]; | 353 return [titlebar() isDrawingAttention]; |
| 353 } | 354 } |
| 354 | 355 |
| 355 bool CocoaNativePanelTesting::VerifyActiveState(bool is_active) { | 356 bool CocoaNativePanelTesting::VerifyActiveState(bool is_active) { |
| 356 // TODO(jianli): to be implemented. | 357 // TODO(jianli): to be implemented. |
| 357 return false; | 358 return false; |
| 358 } | 359 } |
| 359 | 360 |
| 361 bool CocoaNativePanelTesting::VerifyAppIcon() const { |
| 362 // Nothing to do since panel does not show dock icon. |
| 363 return true; |
| 364 } |
| 365 |
| 360 bool CocoaNativePanelTesting::IsWindowSizeKnown() const { | 366 bool CocoaNativePanelTesting::IsWindowSizeKnown() const { |
| 361 return true; | 367 return true; |
| 362 } | 368 } |
| 363 | 369 |
| 364 bool CocoaNativePanelTesting::IsAnimatingBounds() const { | 370 bool CocoaNativePanelTesting::IsAnimatingBounds() const { |
| 365 return [native_panel_window_->controller_ isAnimatingBounds]; | 371 return [native_panel_window_->controller_ isAnimatingBounds]; |
| 366 } | 372 } |
| 367 | 373 |
| 368 bool CocoaNativePanelTesting::IsButtonVisible( | 374 bool CocoaNativePanelTesting::IsButtonVisible( |
| 369 panel::TitlebarButtonType button_type) const { | 375 panel::TitlebarButtonType button_type) const { |
| 370 switch (button_type) { | 376 switch (button_type) { |
| 371 case panel::CLOSE_BUTTON: | 377 case panel::CLOSE_BUTTON: |
| 372 return ![[titlebar() closeButton] isHidden]; | 378 return ![[titlebar() closeButton] isHidden]; |
| 373 case panel::MINIMIZE_BUTTON: | 379 case panel::MINIMIZE_BUTTON: |
| 374 return ![[titlebar() minimizeButton] isHidden]; | 380 return ![[titlebar() minimizeButton] isHidden]; |
| 375 case panel::RESTORE_BUTTON: | 381 case panel::RESTORE_BUTTON: |
| 376 return ![[titlebar() restoreButton] isHidden]; | 382 return ![[titlebar() restoreButton] isHidden]; |
| 377 default: | 383 default: |
| 378 NOTREACHED(); | 384 NOTREACHED(); |
| 379 } | 385 } |
| 380 return false; | 386 return false; |
| 381 } | 387 } |
| OLD | NEW |