| 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 "chrome/browser/ui/panels/panel_browser_view.h" | 5 #include "chrome/browser/ui/panels/panel_browser_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/ui/panels/panel.h" | 9 #include "chrome/browser/ui/panels/panel.h" |
| 10 #include "chrome/browser/ui/panels/panel_browser_frame_view.h" | 10 #include "chrome/browser/ui/panels/panel_browser_frame_view.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // TODO(prasadt): Implement this code. | 93 // TODO(prasadt): Implement this code. |
| 94 // HideThePanel. | 94 // HideThePanel. |
| 95 } | 95 } |
| 96 | 96 |
| 97 BrowserView::Init(); | 97 BrowserView::Init(); |
| 98 | 98 |
| 99 GetWidget()->non_client_view()->SetAccessibleName( | 99 GetWidget()->non_client_view()->SetAccessibleName( |
| 100 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 100 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void PanelBrowserView::Show() { |
| 104 if (!panel_->manager()->is_full_screen()) |
| 105 BrowserView::Show(); |
| 106 } |
| 107 |
| 108 void PanelBrowserView::ShowInactive() { |
| 109 if (!panel_->manager()->is_full_screen()) |
| 110 BrowserView::ShowInactive(); |
| 111 } |
| 112 |
| 103 void PanelBrowserView::Close() { | 113 void PanelBrowserView::Close() { |
| 104 GetWidget()->RemoveObserver(this); | 114 GetWidget()->RemoveObserver(this); |
| 105 closed_ = true; | 115 closed_ = true; |
| 106 | 116 |
| 107 // Cancel any currently running animation since we're closing down. | 117 // Cancel any currently running animation since we're closing down. |
| 108 if (bounds_animator_.get()) | 118 if (bounds_animator_.get()) |
| 109 bounds_animator_.reset(); | 119 bounds_animator_.reset(); |
| 110 | 120 |
| 111 ::BrowserView::Close(); | 121 ::BrowserView::Close(); |
| 112 } | 122 } |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 GetFrameView()->SchedulePaint(); | 416 GetFrameView()->SchedulePaint(); |
| 407 } | 417 } |
| 408 | 418 |
| 409 bool PanelBrowserView::PreHandlePanelKeyboardEvent( | 419 bool PanelBrowserView::PreHandlePanelKeyboardEvent( |
| 410 const NativeWebKeyboardEvent& event, | 420 const NativeWebKeyboardEvent& event, |
| 411 bool* is_keyboard_shortcut) { | 421 bool* is_keyboard_shortcut) { |
| 412 return PreHandleKeyboardEvent(event, is_keyboard_shortcut); | 422 return PreHandleKeyboardEvent(event, is_keyboard_shortcut); |
| 413 } | 423 } |
| 414 | 424 |
| 415 void PanelBrowserView::FullScreenModeChanged(bool is_full_screen) { | 425 void PanelBrowserView::FullScreenModeChanged(bool is_full_screen) { |
| 416 // TODO(prasadt): Enable this code. | 426 if (is_full_screen) { |
| 417 // if (is_full_screen) | 427 if (frame()->IsVisible()) { |
| 418 // HideThePanel. | 428 frame()->Hide(); |
| 419 // else | 429 } |
| 420 // ShowThePanel. | 430 } else { |
| 431 ShowInactive(); |
| 432 } |
| 421 } | 433 } |
| 422 | 434 |
| 423 void PanelBrowserView::HandlePanelKeyboardEvent( | 435 void PanelBrowserView::HandlePanelKeyboardEvent( |
| 424 const NativeWebKeyboardEvent& event) { | 436 const NativeWebKeyboardEvent& event) { |
| 425 HandleKeyboardEvent(event); | 437 HandleKeyboardEvent(event); |
| 426 } | 438 } |
| 427 | 439 |
| 428 gfx::Size PanelBrowserView::WindowSizeFromContentSize( | 440 gfx::Size PanelBrowserView::WindowSizeFromContentSize( |
| 429 const gfx::Size& content_size) const { | 441 const gfx::Size& content_size) const { |
| 430 gfx::Size frame = GetFrameView()->NonClientAreaSize(); | 442 gfx::Size frame = GetFrameView()->NonClientAreaSize(); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 } | 682 } |
| 671 | 683 |
| 672 bool NativePanelTestingWin::IsWindowSizeKnown() const { | 684 bool NativePanelTestingWin::IsWindowSizeKnown() const { |
| 673 return true; | 685 return true; |
| 674 } | 686 } |
| 675 | 687 |
| 676 bool NativePanelTestingWin::IsAnimatingBounds() const { | 688 bool NativePanelTestingWin::IsAnimatingBounds() const { |
| 677 return panel_browser_view_->bounds_animator_.get() && | 689 return panel_browser_view_->bounds_animator_.get() && |
| 678 panel_browser_view_->bounds_animator_->is_animating(); | 690 panel_browser_view_->bounds_animator_->is_animating(); |
| 679 } | 691 } |
| OLD | NEW |