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/autofill/new_credit_card_bubble_controller.h" | 5 #include "chrome/browser/ui/autofill/new_credit_card_bubble_controller.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 const base::string16& NewCreditCardBubbleController::LinkText() const { | 56 const base::string16& NewCreditCardBubbleController::LinkText() const { |
57 return link_text_; | 57 return link_text_; |
58 } | 58 } |
59 | 59 |
60 void NewCreditCardBubbleController::OnBubbleDestroyed() { | 60 void NewCreditCardBubbleController::OnBubbleDestroyed() { |
61 delete this; | 61 delete this; |
62 } | 62 } |
63 | 63 |
64 void NewCreditCardBubbleController::OnLinkClicked() { | 64 void NewCreditCardBubbleController::OnLinkClicked() { |
65 Browser* browser = chrome::FindTabbedBrowser(profile_, false, | 65 chrome::ShowSettingsSubPageForProfile(profile_, chrome::kAutofillSubPage); |
66 chrome::GetActiveDesktop()); | |
67 if (browser) | |
68 chrome::ShowSettingsSubPage(browser, chrome::kAutofillSubPage); | |
69 | |
70 Hide(); | 66 Hide(); |
71 } | 67 } |
72 | 68 |
73 NewCreditCardBubbleController::NewCreditCardBubbleController( | 69 NewCreditCardBubbleController::NewCreditCardBubbleController( |
74 content::WebContents* web_contents) | 70 content::WebContents* web_contents) |
75 : profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())), | 71 : profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())), |
76 web_contents_(web_contents), | 72 web_contents_(web_contents), |
77 title_text_(l10n_util::GetStringUTF16( | 73 title_text_(l10n_util::GetStringUTF16( |
78 IDS_AUTOFILL_NEW_CREDIT_CARD_BUBBLE_TITLE)), | 74 IDS_AUTOFILL_NEW_CREDIT_CARD_BUBBLE_TITLE)), |
79 link_text_(l10n_util::GetStringUTF16( | 75 link_text_(l10n_util::GetStringUTF16( |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 115 |
120 bubble_->Show(); | 116 bubble_->Show(); |
121 } | 117 } |
122 | 118 |
123 void NewCreditCardBubbleController::Hide() { | 119 void NewCreditCardBubbleController::Hide() { |
124 if (bubble_) | 120 if (bubble_) |
125 bubble_->Hide(); | 121 bubble_->Hide(); |
126 } | 122 } |
127 | 123 |
128 } // namespace autofill | 124 } // namespace autofill |
OLD | NEW |