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.h" | 8 #include "base/message_loop.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 bounds.set_y(bounds.bottom() - full_size_.height()); | 250 bounds.set_y(bounds.bottom() - full_size_.height()); |
251 bounds.set_x(bounds.right() - full_size_.width()); | 251 bounds.set_x(bounds.right() - full_size_.width()); |
252 bounds.set_size(full_size_); | 252 bounds.set_size(full_size_); |
253 return bounds; | 253 return bounds; |
254 } | 254 } |
255 | 255 |
256 gfx::Rect Panel::GetBounds() const { | 256 gfx::Rect Panel::GetBounds() const { |
257 return native_panel_->GetPanelBounds(); | 257 return native_panel_->GetPanelBounds(); |
258 } | 258 } |
259 | 259 |
| 260 gfx::Rect Panel::GetContentBounds() const { |
| 261 gfx::Rect bounds = native_panel_->GetPanelBounds(); |
| 262 gfx::Size sz = native_panel_->ContentSizeFromWindowSize(bounds.size()); |
| 263 return gfx::Rect(bounds.x(), bounds.y(), sz.width(), sz.height()); |
| 264 } |
| 265 |
260 void Panel::Show() { | 266 void Panel::Show() { |
261 if (manager()->display_settings_provider()->is_full_screen() || !collection_) | 267 if (manager()->display_settings_provider()->is_full_screen() || !collection_) |
262 return; | 268 return; |
263 | 269 |
264 native_panel_->ShowPanel(); | 270 native_panel_->ShowPanel(); |
265 } | 271 } |
266 | 272 |
267 void Panel::Hide() { | 273 void Panel::Hide() { |
268 // Not implemented. | 274 // Not implemented. |
269 } | 275 } |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
879 | 885 |
880 // static | 886 // static |
881 void Panel::FormatTitleForDisplay(string16* title) { | 887 void Panel::FormatTitleForDisplay(string16* title) { |
882 size_t current_index = 0; | 888 size_t current_index = 0; |
883 size_t match_index; | 889 size_t match_index; |
884 while ((match_index = title->find(L'\n', current_index)) != string16::npos) { | 890 while ((match_index = title->find(L'\n', current_index)) != string16::npos) { |
885 title->replace(match_index, 1, string16()); | 891 title->replace(match_index, 1, string16()); |
886 current_index = match_index; | 892 current_index = match_index; |
887 } | 893 } |
888 } | 894 } |
OLD | NEW |