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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
50 | 50 |
51 gfx::Size GetPreferredSize() const override { | 51 gfx::Size GetPreferredSize() const override { |
52 return gfx::Size(0, views::Combobox::GetPreferredSize().height()); | 52 return gfx::Size(0, views::Combobox::GetPreferredSize().height()); |
53 } | 53 } |
54 | 54 |
55 private: | 55 private: |
56 DISALLOW_COPY_AND_ASSIGN(UnsizedCombobox); | 56 DISALLOW_COPY_AND_ASSIGN(UnsizedCombobox); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace | 59 } // namespace |
60 | 60 gi |
Peter Kasting
2015/01/23 07:28:10
This typo will break the compile.
oshima
2015/01/24 01:23:07
Done.
| |
61 BookmarkBubbleView* BookmarkBubbleView::bookmark_bubble_ = NULL; | 61 BookmarkBubbleView* BookmarkBubbleView::bookmark_bubble_ = NULL; |
62 | 62 |
63 // static | 63 // static |
64 void BookmarkBubbleView::ShowBubble(views::View* anchor_view, | 64 void BookmarkBubbleView::ShowBubble(views::View* anchor_view, |
65 BookmarkBubbleViewObserver* observer, | 65 BookmarkBubbleViewObserver* observer, |
66 scoped_ptr<BookmarkBubbleDelegate> delegate, | 66 scoped_ptr<BookmarkBubbleDelegate> delegate, |
67 Profile* profile, | 67 Profile* profile, |
68 const GURL& url, | 68 const GURL& url, |
69 bool newly_bookmarked) { | 69 bool newly_bookmarked) { |
70 if (IsShowing()) | 70 if (IsShowing()) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 return true; | 139 return true; |
140 } | 140 } |
141 if (key_code == ui::VKEY_ESCAPE) { | 141 if (key_code == ui::VKEY_ESCAPE) { |
142 remove_bookmark_ = newly_bookmarked_; | 142 remove_bookmark_ = newly_bookmarked_; |
143 apply_edits_ = false; | 143 apply_edits_ = false; |
144 } | 144 } |
145 | 145 |
146 return BubbleDelegateView::AcceleratorPressed(accelerator); | 146 return BubbleDelegateView::AcceleratorPressed(accelerator); |
147 } | 147 } |
148 | 148 |
149 const char* BookmarkBubbleView::GetClassName() const { | |
150 return "BookmarkBubbleView"; | |
151 } | |
152 | |
149 void BookmarkBubbleView::Init() { | 153 void BookmarkBubbleView::Init() { |
150 views::Label* title_label = new views::Label( | 154 views::Label* title_label = new views::Label( |
151 l10n_util::GetStringUTF16( | 155 l10n_util::GetStringUTF16( |
152 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : | 156 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : |
153 IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARK)); | 157 IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARK)); |
154 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); | 158 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); |
155 title_label->SetFontList(rb->GetFontList(ui::ResourceBundle::MediumFont)); | 159 title_label->SetFontList(rb->GetFontList(ui::ResourceBundle::MediumFont)); |
156 | 160 |
157 remove_button_ = new views::LabelButton(this, l10n_util::GetStringUTF16( | 161 remove_button_ = new views::LabelButton(this, l10n_util::GetStringUTF16( |
158 IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK)); | 162 IDS_BOOKMARK_BUBBLE_REMOVE_BOOKMARK)); |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 if (node) { | 369 if (node) { |
366 const base::string16 new_title = title_tf_->text(); | 370 const base::string16 new_title = title_tf_->text(); |
367 if (new_title != node->GetTitle()) { | 371 if (new_title != node->GetTitle()) { |
368 model->SetTitle(node, new_title); | 372 model->SetTitle(node, new_title); |
369 content::RecordAction( | 373 content::RecordAction( |
370 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); | 374 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); |
371 } | 375 } |
372 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); | 376 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); |
373 } | 377 } |
374 } | 378 } |
OLD | NEW |