| 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 "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 HandleButtonPressed(close_button_); | 121 HandleButtonPressed(close_button_); |
| 122 return true; | 122 return true; |
| 123 } else if (accelerator.key_code() == ui::VKEY_ESCAPE) { | 123 } else if (accelerator.key_code() == ui::VKEY_ESCAPE) { |
| 124 remove_bookmark_ = newly_bookmarked_; | 124 remove_bookmark_ = newly_bookmarked_; |
| 125 apply_edits_ = false; | 125 apply_edits_ = false; |
| 126 } | 126 } |
| 127 | 127 |
| 128 return BubbleDelegateView::AcceleratorPressed(accelerator); | 128 return BubbleDelegateView::AcceleratorPressed(accelerator); |
| 129 } | 129 } |
| 130 | 130 |
| 131 void BookmarkBubbleView::OnNativeThemeChanged(const ui::NativeTheme* theme) { | |
| 132 views::BubbleDelegateView::OnNativeThemeChanged(theme); | |
| 133 const SkColor background_color = theme->GetSystemColor( | |
| 134 ui::NativeTheme::kColorId_DialogBackground); | |
| 135 set_color(background_color); | |
| 136 set_background(views::Background::CreateSolidBackground(background_color)); | |
| 137 } | |
| 138 | |
| 139 void BookmarkBubbleView::Init() { | 131 void BookmarkBubbleView::Init() { |
| 140 views::Label* title_label = new views::Label( | 132 views::Label* title_label = new views::Label( |
| 141 l10n_util::GetStringUTF16( | 133 l10n_util::GetStringUTF16( |
| 142 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : | 134 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : |
| 143 IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARK)); | 135 IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARK)); |
| 144 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 136 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
| 145 title_label->SetFontList(rb->GetFontList(ui::ResourceBundle::MediumFont)); | 137 title_label->SetFontList(rb->GetFontList(ui::ResourceBundle::MediumFont)); |
| 146 | 138 |
| 147 remove_button_ = new views::LabelButton(this, l10n_util::GetStringUTF16( | 139 remove_button_ = new views::LabelButton(this, l10n_util::GetStringUTF16( |
| 148 IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK)); | 140 IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK)); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 if (node) { | 351 if (node) { |
| 360 const base::string16 new_title = title_tf_->text(); | 352 const base::string16 new_title = title_tf_->text(); |
| 361 if (new_title != node->GetTitle()) { | 353 if (new_title != node->GetTitle()) { |
| 362 model->SetTitle(node, new_title); | 354 model->SetTitle(node, new_title); |
| 363 content::RecordAction( | 355 content::RecordAction( |
| 364 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); | 356 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); |
| 365 } | 357 } |
| 366 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); | 358 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); |
| 367 } | 359 } |
| 368 } | 360 } |
| OLD | NEW |