| 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 |
| 670 void Panel::UpdateMinimizeRestoreButtonVisibility() { | 675 void Panel::UpdateMinimizeRestoreButtonVisibility() { |
| 671 native_panel_->UpdatePanelMinimizeRestoreButtonVisibility(); | 676 native_panel_->UpdatePanelMinimizeRestoreButtonVisibility(); |
| 672 } | 677 } |
| 673 | 678 |
| 674 gfx::Size Panel::ClampSize(const gfx::Size& size) const { | 679 gfx::Size Panel::ClampSize(const gfx::Size& size) const { |
| 675 // The panel width: | 680 // The panel width: |
| 676 // * cannot grow or shrink to go beyond [min_width, max_width] | 681 // * cannot grow or shrink to go beyond [min_width, max_width] |
| 677 int new_width = size.width(); | 682 int new_width = size.width(); |
| 678 if (new_width > max_size_.width()) | 683 if (new_width > max_size_.width()) |
| 679 new_width = max_size_.width(); | 684 new_width = max_size_.width(); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 | 894 |
| 890 // static | 895 // static |
| 891 void Panel::FormatTitleForDisplay(string16* title) { | 896 void Panel::FormatTitleForDisplay(string16* title) { |
| 892 size_t current_index = 0; | 897 size_t current_index = 0; |
| 893 size_t match_index; | 898 size_t match_index; |
| 894 while ((match_index = title->find(L'\n', current_index)) != string16::npos) { | 899 while ((match_index = title->find(L'\n', current_index)) != string16::npos) { |
| 895 title->replace(match_index, 1, string16()); | 900 title->replace(match_index, 1, string16()); |
| 896 current_index = match_index; | 901 current_index = match_index; |
| 897 } | 902 } |
| 898 } | 903 } |
| OLD | NEW |