| 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/panels/panel.h" | 5 #include "chrome/browser/ui/panels/panel.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 | 660 |
| 661 void Panel::SetAlwaysOnTop(bool on_top) { | 661 void Panel::SetAlwaysOnTop(bool on_top) { |
| 662 native_panel_->SetPanelAlwaysOnTop(on_top); | 662 native_panel_->SetPanelAlwaysOnTop(on_top); |
| 663 } | 663 } |
| 664 | 664 |
| 665 void Panel::SetPreviewMode(bool in_preview) { | 665 void Panel::SetPreviewMode(bool in_preview) { |
| 666 DCHECK_NE(in_preview_mode_, in_preview); | 666 DCHECK_NE(in_preview_mode_, in_preview); |
| 667 in_preview_mode_ = in_preview; | 667 in_preview_mode_ = in_preview; |
| 668 } | 668 } |
| 669 | 669 |
| 670 void Panel::EnableResizeByMouse(bool enable) { | |
| 671 DCHECK(native_panel_); | |
| 672 native_panel_->EnableResizeByMouse(enable); | |
| 673 } | |
| 674 | |
| 675 void Panel::UpdateMinimizeRestoreButtonVisibility() { | 670 void Panel::UpdateMinimizeRestoreButtonVisibility() { |
| 676 native_panel_->UpdatePanelMinimizeRestoreButtonVisibility(); | 671 native_panel_->UpdatePanelMinimizeRestoreButtonVisibility(); |
| 677 } | 672 } |
| 678 | 673 |
| 679 gfx::Size Panel::ClampSize(const gfx::Size& size) const { | 674 gfx::Size Panel::ClampSize(const gfx::Size& size) const { |
| 680 // The panel width: | 675 // The panel width: |
| 681 // * cannot grow or shrink to go beyond [min_width, max_width] | 676 // * cannot grow or shrink to go beyond [min_width, max_width] |
| 682 int new_width = size.width(); | 677 int new_width = size.width(); |
| 683 if (new_width > max_size_.width()) | 678 if (new_width > max_size_.width()) |
| 684 new_width = max_size_.width(); | 679 new_width = max_size_.width(); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 | 889 |
| 895 // static | 890 // static |
| 896 void Panel::FormatTitleForDisplay(string16* title) { | 891 void Panel::FormatTitleForDisplay(string16* title) { |
| 897 size_t current_index = 0; | 892 size_t current_index = 0; |
| 898 size_t match_index; | 893 size_t match_index; |
| 899 while ((match_index = title->find(L'\n', current_index)) != string16::npos) { | 894 while ((match_index = title->find(L'\n', current_index)) != string16::npos) { |
| 900 title->replace(match_index, 1, string16()); | 895 title->replace(match_index, 1, string16()); |
| 901 current_index = match_index; | 896 current_index = match_index; |
| 902 } | 897 } |
| 903 } | 898 } |
| OLD | NEW |