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/passwords/manage_passwords_bubble_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 ManagePasswordsBubbleView::ManagePasswordsBubbleView( | 137 ManagePasswordsBubbleView::ManagePasswordsBubbleView( |
138 content::WebContents* web_contents, | 138 content::WebContents* web_contents, |
139 views::View* anchor_view, | 139 views::View* anchor_view, |
140 ManagePasswordsIconView* icon_view, | 140 ManagePasswordsIconView* icon_view, |
141 BubbleDisplayReason reason) | 141 BubbleDisplayReason reason) |
142 : BubbleDelegateView(anchor_view, | 142 : BubbleDelegateView(anchor_view, |
143 anchor_view ? views::BubbleBorder::TOP_RIGHT | 143 anchor_view ? views::BubbleBorder::TOP_RIGHT |
144 : views::BubbleBorder::NONE), | 144 : views::BubbleBorder::NONE), |
145 manage_passwords_bubble_model_( | |
146 new ManagePasswordsBubbleModel(web_contents)), | |
147 icon_view_(icon_view) { | 145 icon_view_(icon_view) { |
| 146 manage_passwords_bubble_model_ = new ManagePasswordsBubbleModel( |
| 147 ManagePasswordsBubbleUIController::FromWebContents(web_contents)); |
| 148 |
148 // Compensate for built-in vertical padding in the anchor view's image. | 149 // Compensate for built-in vertical padding in the anchor view's image. |
149 set_anchor_view_insets(gfx::Insets(5, 0, 5, 0)); | 150 set_anchor_view_insets(gfx::Insets(5, 0, 5, 0)); |
150 set_notify_enter_exit_on_child(true); | 151 set_notify_enter_exit_on_child(true); |
151 | 152 |
152 BubbleDisplayDisposition disposition = AUTOMATIC_WITH_PASSWORD_PENDING; | 153 BubbleDisplayDisposition disposition = AUTOMATIC_WITH_PASSWORD_PENDING; |
153 if (reason == USER_ACTION) { | 154 if (reason == USER_ACTION) { |
154 // TODO(mkwst): Deal with "Never save passwords" once we've decided how that | 155 // TODO(mkwst): Deal with "Never save passwords" once we've decided how that |
155 // flow should work. | 156 // flow should work. |
156 disposition = manage_passwords_bubble_model_->WaitingToSavePassword() | 157 disposition = manage_passwords_bubble_model_->WaitingToSavePassword() |
157 ? MANUAL_WITH_PASSWORD_PENDING | 158 ? MANUAL_WITH_PASSWORD_PENDING |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 case SavePasswordRefusalComboboxModel::INDEX_NEVER_FOR_THIS_SITE: | 422 case SavePasswordRefusalComboboxModel::INDEX_NEVER_FOR_THIS_SITE: |
422 manage_passwords_bubble_model_->OnNeverForThisSiteClicked(); | 423 manage_passwords_bubble_model_->OnNeverForThisSiteClicked(); |
423 reason = CLICKED_NEVER; | 424 reason = CLICKED_NEVER; |
424 break; | 425 break; |
425 default: | 426 default: |
426 NOTREACHED(); | 427 NOTREACHED(); |
427 break; | 428 break; |
428 } | 429 } |
429 Close(reason); | 430 Close(reason); |
430 } | 431 } |
OLD | NEW |