| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 246 } |
| 247 | 247 |
| 248 gfx::Rect Panel::GetRestoredBounds() const { | 248 gfx::Rect Panel::GetRestoredBounds() const { |
| 249 gfx::Rect bounds = native_panel_->GetPanelBounds(); | 249 gfx::Rect bounds = native_panel_->GetPanelBounds(); |
| 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 ui::WindowShowState Panel::GetRestoredState() const { |
| 257 return ui::SHOW_STATE_NORMAL; |
| 258 } |
| 259 |
| 256 gfx::Rect Panel::GetBounds() const { | 260 gfx::Rect Panel::GetBounds() const { |
| 257 return native_panel_->GetPanelBounds(); | 261 return native_panel_->GetPanelBounds(); |
| 258 } | 262 } |
| 259 | 263 |
| 260 void Panel::Show() { | 264 void Panel::Show() { |
| 261 if (manager()->display_settings_provider()->is_full_screen() || !collection_) | 265 if (manager()->display_settings_provider()->is_full_screen() || !collection_) |
| 262 return; | 266 return; |
| 263 | 267 |
| 264 native_panel_->ShowPanel(); | 268 native_panel_->ShowPanel(); |
| 265 } | 269 } |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 | 885 |
| 882 // static | 886 // static |
| 883 void Panel::FormatTitleForDisplay(string16* title) { | 887 void Panel::FormatTitleForDisplay(string16* title) { |
| 884 size_t current_index = 0; | 888 size_t current_index = 0; |
| 885 size_t match_index; | 889 size_t match_index; |
| 886 while ((match_index = title->find(L'\n', current_index)) != string16::npos) { | 890 while ((match_index = title->find(L'\n', current_index)) != string16::npos) { |
| 887 title->replace(match_index, 1, string16()); | 891 title->replace(match_index, 1, string16()); |
| 888 current_index = match_index; | 892 current_index = match_index; |
| 889 } | 893 } |
| 890 } | 894 } |
| OLD | NEW |