| 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/views/bookmarks/bookmark_bubble_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/grit/chromium_strings.h" | 22 #include "chrome/grit/chromium_strings.h" |
| 23 #include "chrome/grit/generated_resources.h" | 23 #include "chrome/grit/generated_resources.h" |
| 24 #include "components/bookmarks/browser/bookmark_model.h" | 24 #include "components/bookmarks/browser/bookmark_model.h" |
| 25 #include "components/bookmarks/browser/bookmark_utils.h" | 25 #include "components/bookmarks/browser/bookmark_utils.h" |
| 26 #include "content/public/browser/user_metrics.h" | 26 #include "content/public/browser/user_metrics.h" |
| 27 #include "grit/components_strings.h" | 27 #include "grit/components_strings.h" |
| 28 #include "ui/accessibility/ax_view_state.h" | 28 #include "ui/accessibility/ax_view_state.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| 30 #include "ui/events/keycodes/keyboard_codes.h" | 30 #include "ui/events/keycodes/keyboard_codes.h" |
| 31 #include "ui/views/bubble/bubble_frame_view.h" | 31 #include "ui/views/bubble/bubble_frame_view.h" |
| 32 #include "ui/views/controls/button/label_button.h" | 32 #include "ui/views/controls/button/md_text_button.h" |
| 33 #include "ui/views/controls/combobox/combobox.h" | 33 #include "ui/views/controls/combobox/combobox.h" |
| 34 #include "ui/views/controls/label.h" | 34 #include "ui/views/controls/label.h" |
| 35 #include "ui/views/controls/link.h" | 35 #include "ui/views/controls/link.h" |
| 36 #include "ui/views/controls/textfield/textfield.h" | 36 #include "ui/views/controls/textfield/textfield.h" |
| 37 #include "ui/views/layout/grid_layout.h" | 37 #include "ui/views/layout/grid_layout.h" |
| 38 #include "ui/views/layout/layout_constants.h" | 38 #include "ui/views/layout/layout_constants.h" |
| 39 #include "ui/views/widget/widget.h" | 39 #include "ui/views/widget/widget.h" |
| 40 | 40 |
| 41 using base::UserMetricsAction; | 41 using base::UserMetricsAction; |
| 42 using bookmarks::BookmarkModel; | 42 using bookmarks::BookmarkModel; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 if (key_code == ui::VKEY_ESCAPE) { | 146 if (key_code == ui::VKEY_ESCAPE) { |
| 147 remove_bookmark_ = newly_bookmarked_; | 147 remove_bookmark_ = newly_bookmarked_; |
| 148 apply_edits_ = false; | 148 apply_edits_ = false; |
| 149 } | 149 } |
| 150 | 150 |
| 151 return LocationBarBubbleDelegateView::AcceleratorPressed(accelerator); | 151 return LocationBarBubbleDelegateView::AcceleratorPressed(accelerator); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void BookmarkBubbleView::Init() { | 154 void BookmarkBubbleView::Init() { |
| 155 remove_button_ = new views::LabelButton(this, l10n_util::GetStringUTF16( | 155 remove_button_ = views::MdTextButton::CreateSecondaryUiButton( |
| 156 IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK)); | 156 this, l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK)); |
| 157 remove_button_->SetStyle(views::Button::STYLE_BUTTON); | |
| 158 | 157 |
| 159 edit_button_ = new views::LabelButton( | 158 edit_button_ = views::MdTextButton::CreateSecondaryUiButton( |
| 160 this, l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_OPTIONS)); | 159 this, l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_OPTIONS)); |
| 161 edit_button_->SetStyle(views::Button::STYLE_BUTTON); | |
| 162 | 160 |
| 163 close_button_ = new views::LabelButton( | 161 close_button_ = views::MdTextButton::CreateSecondaryUiButton( |
| 164 this, l10n_util::GetStringUTF16(IDS_DONE)); | 162 this, l10n_util::GetStringUTF16(IDS_DONE)); |
| 165 close_button_->SetStyle(views::Button::STYLE_BUTTON); | |
| 166 close_button_->SetIsDefault(true); | 163 close_button_->SetIsDefault(true); |
| 167 | 164 |
| 168 views::Label* combobox_label = new views::Label( | 165 views::Label* combobox_label = new views::Label( |
| 169 l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_FOLDER_TEXT)); | 166 l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_FOLDER_TEXT)); |
| 170 | 167 |
| 171 parent_combobox_ = new UnsizedCombobox(&parent_model_); | 168 parent_combobox_ = new UnsizedCombobox(&parent_model_); |
| 172 parent_combobox_->set_listener(this); | 169 parent_combobox_->set_listener(this); |
| 173 parent_combobox_->SetAccessibleName( | 170 parent_combobox_->SetAccessibleName( |
| 174 l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_BUBBLE_FOLDER_TEXT)); | 171 l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_BUBBLE_FOLDER_TEXT)); |
| 175 | 172 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 if (node) { | 346 if (node) { |
| 350 const base::string16 new_title = title_tf_->text(); | 347 const base::string16 new_title = title_tf_->text(); |
| 351 if (new_title != node->GetTitle()) { | 348 if (new_title != node->GetTitle()) { |
| 352 model->SetTitle(node, new_title); | 349 model->SetTitle(node, new_title); |
| 353 content::RecordAction( | 350 content::RecordAction( |
| 354 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); | 351 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); |
| 355 } | 352 } |
| 356 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); | 353 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); |
| 357 } | 354 } |
| 358 } | 355 } |
| OLD | NEW |