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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 } | 231 } |
232 | 232 |
233 const char* BookmarkBubbleView::GetClassName() const { | 233 const char* BookmarkBubbleView::GetClassName() const { |
234 return "BookmarkBubbleView"; | 234 return "BookmarkBubbleView"; |
235 } | 235 } |
236 | 236 |
237 views::View* BookmarkBubbleView::GetInitiallyFocusedView() { | 237 views::View* BookmarkBubbleView::GetInitiallyFocusedView() { |
238 return title_tf_; | 238 return title_tf_; |
239 } | 239 } |
240 | 240 |
241 scoped_ptr<views::View> BookmarkBubbleView::CreateFootnoteView() { | 241 views::View* BookmarkBubbleView::CreateFootnoteView() { |
242 if (!SyncPromoUI::ShouldShowSyncPromo(profile_)) | 242 if (!SyncPromoUI::ShouldShowSyncPromo(profile_)) |
243 return nullptr; | 243 return nullptr; |
244 | 244 |
245 content::RecordAction( | 245 content::RecordAction( |
246 base::UserMetricsAction("Signin_Impression_FromBookmarkBubble")); | 246 base::UserMetricsAction("Signin_Impression_FromBookmarkBubble")); |
247 | 247 |
248 return scoped_ptr<views::View>( | 248 return new BubbleSyncPromoView(delegate_.get(), IDS_BOOKMARK_SYNC_PROMO_LINK, |
249 new BubbleSyncPromoView(delegate_.get(), IDS_BOOKMARK_SYNC_PROMO_LINK, | 249 IDS_BOOKMARK_SYNC_PROMO_MESSAGE); |
250 IDS_BOOKMARK_SYNC_PROMO_MESSAGE)); | |
251 } | 250 } |
252 | 251 |
253 BookmarkBubbleView::BookmarkBubbleView( | 252 BookmarkBubbleView::BookmarkBubbleView( |
254 views::View* anchor_view, | 253 views::View* anchor_view, |
255 bookmarks::BookmarkBubbleObserver* observer, | 254 bookmarks::BookmarkBubbleObserver* observer, |
256 scoped_ptr<BubbleSyncPromoDelegate> delegate, | 255 scoped_ptr<BubbleSyncPromoDelegate> delegate, |
257 Profile* profile, | 256 Profile* profile, |
258 const GURL& url, | 257 const GURL& url, |
259 bool newly_bookmarked) | 258 bool newly_bookmarked) |
260 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), | 259 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 if (node) { | 351 if (node) { |
353 const base::string16 new_title = title_tf_->text(); | 352 const base::string16 new_title = title_tf_->text(); |
354 if (new_title != node->GetTitle()) { | 353 if (new_title != node->GetTitle()) { |
355 model->SetTitle(node, new_title); | 354 model->SetTitle(node, new_title); |
356 content::RecordAction( | 355 content::RecordAction( |
357 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); | 356 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); |
358 } | 357 } |
359 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); | 358 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); |
360 } | 359 } |
361 } | 360 } |
OLD | NEW |