| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/shelf_item_dialog.h" | 5 #include "chrome/browser/views/shelf_item_dialog.h" |
| 6 | 6 |
| 7 #include "app/gfx/text_elider.h" | 7 #include "app/gfx/text_elider.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/gfx/png_decoder.h" | 10 #include "base/gfx/png_decoder.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 } | 446 } |
| 447 | 447 |
| 448 views::View* ShelfItemDialog::GetContentsView() { | 448 views::View* ShelfItemDialog::GetContentsView() { |
| 449 return this; | 449 return this; |
| 450 } | 450 } |
| 451 | 451 |
| 452 void ShelfItemDialog::PerformModelChange() { | 452 void ShelfItemDialog::PerformModelChange() { |
| 453 DCHECK(delegate_); | 453 DCHECK(delegate_); |
| 454 GURL url(GetInputURL()); | 454 GURL url(GetInputURL()); |
| 455 const std::wstring title = | 455 const std::wstring title = |
| 456 title_field_ ? title_field_->GetText() : std::wstring(); | 456 title_field_ ? title_field_->text() : std::wstring(); |
| 457 delegate_->AddBookmark(this, title, url); | 457 delegate_->AddBookmark(this, title, url); |
| 458 } | 458 } |
| 459 | 459 |
| 460 gfx::Size ShelfItemDialog::GetPreferredSize() { | 460 gfx::Size ShelfItemDialog::GetPreferredSize() { |
| 461 return gfx::Size(views::Window::GetLocalizedContentsSize( | 461 return gfx::Size(views::Window::GetLocalizedContentsSize( |
| 462 IDS_SHELFITEM_DIALOG_WIDTH_CHARS, | 462 IDS_SHELFITEM_DIALOG_WIDTH_CHARS, |
| 463 IDS_SHELFITEM_DIALOG_HEIGHT_LINES)); | 463 IDS_SHELFITEM_DIALOG_HEIGHT_LINES)); |
| 464 } | 464 } |
| 465 | 465 |
| 466 bool ShelfItemDialog::AcceleratorPressed( | 466 bool ShelfItemDialog::AcceleratorPressed( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 int selection = url_table_->FirstSelectedRow(); | 512 int selection = url_table_->FirstSelectedRow(); |
| 513 if (selection >= 0 && selection < url_table_model_->RowCount()) { | 513 if (selection >= 0 && selection < url_table_model_->RowCount()) { |
| 514 OnSelectionChanged(); | 514 OnSelectionChanged(); |
| 515 PerformModelChange(); | 515 PerformModelChange(); |
| 516 if (window()) | 516 if (window()) |
| 517 window()->Close(); | 517 window()->Close(); |
| 518 } | 518 } |
| 519 } | 519 } |
| 520 | 520 |
| 521 GURL ShelfItemDialog::GetInputURL() const { | 521 GURL ShelfItemDialog::GetInputURL() const { |
| 522 return GURL(URLFixerUpper::FixupURL(url_field_->GetText(), L"")); | 522 return GURL(URLFixerUpper::FixupURL(url_field_->text(), L"")); |
| 523 } | 523 } |
| OLD | NEW |