| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_sync_promo_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_sync_promo_view.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h" | 8 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 const int kBorderWidth = 1; | 27 const int kBorderWidth = 1; |
| 28 | 28 |
| 29 // Color of the text of the promo. | 29 // Color of the text of the promo. |
| 30 const SkColor kTextColor = SkColorSetRGB(102, 102, 102); | 30 const SkColor kTextColor = SkColorSetRGB(102, 102, 102); |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| 33 | 33 |
| 34 BookmarkSyncPromoView::BookmarkSyncPromoView(BookmarkBubbleDelegate* delegate) | 34 BookmarkSyncPromoView::BookmarkSyncPromoView(BookmarkBubbleDelegate* delegate) |
| 35 : delegate_(delegate) { | 35 : delegate_(delegate) { |
| 36 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); | 36 set_background(views::Background::CreateSolidBackground(kBackgroundColor)); |
| 37 set_border(views::Border::CreateSolidSidedBorder(kBorderWidth, | 37 SetBorder(views::Border::CreateSolidSidedBorder( |
| 38 0, | 38 kBorderWidth, 0, 0, 0, kBorderColor)); |
| 39 0, | |
| 40 0, | |
| 41 kBorderColor)); | |
| 42 size_t offset; | 39 size_t offset; |
| 43 base::string16 link_text = | 40 base::string16 link_text = |
| 44 l10n_util::GetStringUTF16(IDS_BOOKMARK_SYNC_PROMO_LINK); | 41 l10n_util::GetStringUTF16(IDS_BOOKMARK_SYNC_PROMO_LINK); |
| 45 base::string16 promo_text = l10n_util::GetStringFUTF16( | 42 base::string16 promo_text = l10n_util::GetStringFUTF16( |
| 46 IDS_BOOKMARK_SYNC_PROMO_MESSAGE, | 43 IDS_BOOKMARK_SYNC_PROMO_MESSAGE, |
| 47 link_text, | 44 link_text, |
| 48 &offset); | 45 &offset); |
| 49 | 46 |
| 50 views::StyledLabel* promo_label = new views::StyledLabel(promo_text, this); | 47 views::StyledLabel* promo_label = new views::StyledLabel(promo_text, this); |
| 51 promo_label->SetDisplayedOnBackgroundColor(kBackgroundColor); | 48 promo_label->SetDisplayedOnBackgroundColor(kBackgroundColor); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 70 views::kPanelVertMargin, | 67 views::kPanelVertMargin, |
| 71 0); | 68 0); |
| 72 SetLayoutManager(layout); | 69 SetLayoutManager(layout); |
| 73 AddChildView(promo_label); | 70 AddChildView(promo_label); |
| 74 } | 71 } |
| 75 | 72 |
| 76 void BookmarkSyncPromoView::StyledLabelLinkClicked(const gfx::Range& range, | 73 void BookmarkSyncPromoView::StyledLabelLinkClicked(const gfx::Range& range, |
| 77 int event_flags) { | 74 int event_flags) { |
| 78 delegate_->OnSignInLinkClicked(); | 75 delegate_->OnSignInLinkClicked(); |
| 79 } | 76 } |
| OLD | NEW |