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/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 new views::StyledLabel(model->title(), listener); | 168 new views::StyledLabel(model->title(), listener); |
169 title_label->SetBaseFontList( | 169 title_label->SetBaseFontList( |
170 ui::ResourceBundle::GetSharedInstance().GetFontList( | 170 ui::ResourceBundle::GetSharedInstance().GetFontList( |
171 ui::ResourceBundle::MediumFont)); | 171 ui::ResourceBundle::MediumFont)); |
172 title_label->AddStyleRange(model->title_brand_link_range(), GetLinkStyle()); | 172 title_label->AddStyleRange(model->title_brand_link_range(), GetLinkStyle()); |
173 layout->StartRow(0, SINGLE_VIEW_COLUMN_SET); | 173 layout->StartRow(0, SINGLE_VIEW_COLUMN_SET); |
174 layout->AddView(title_label); | 174 layout->AddView(title_label); |
175 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); | 175 layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing); |
176 } | 176 } |
177 | 177 |
178 scoped_ptr<views::LabelButton> GenerateButton(views::ButtonListener* listener, | 178 std::unique_ptr<views::LabelButton> GenerateButton( |
179 const base::string16& text) { | 179 views::ButtonListener* listener, |
180 scoped_ptr<views::LabelButton> button(new views::LabelButton(listener, text)); | 180 const base::string16& text) { |
| 181 std::unique_ptr<views::LabelButton> button( |
| 182 new views::LabelButton(listener, text)); |
181 button->SetStyle(views::Button::STYLE_BUTTON); | 183 button->SetStyle(views::Button::STYLE_BUTTON); |
182 return button; | 184 return button; |
183 } | 185 } |
184 | 186 |
185 } // namespace | 187 } // namespace |
186 | 188 |
187 // ManagePasswordsBubbleView::AutoSigninView ---------------------------------- | 189 // ManagePasswordsBubbleView::AutoSigninView ---------------------------------- |
188 | 190 |
189 // A view containing just one credential that was used for for automatic signing | 191 // A view containing just one credential that was used for for automatic signing |
190 // in. | 192 // in. |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 : public ui::EventHandler { | 565 : public ui::EventHandler { |
564 public: | 566 public: |
565 explicit WebContentMouseHandler(ManagePasswordsBubbleView* bubble); | 567 explicit WebContentMouseHandler(ManagePasswordsBubbleView* bubble); |
566 | 568 |
567 void OnKeyEvent(ui::KeyEvent* event) override; | 569 void OnKeyEvent(ui::KeyEvent* event) override; |
568 void OnMouseEvent(ui::MouseEvent* event) override; | 570 void OnMouseEvent(ui::MouseEvent* event) override; |
569 void OnTouchEvent(ui::TouchEvent* event) override; | 571 void OnTouchEvent(ui::TouchEvent* event) override; |
570 | 572 |
571 private: | 573 private: |
572 ManagePasswordsBubbleView* bubble_; | 574 ManagePasswordsBubbleView* bubble_; |
573 scoped_ptr<views::EventMonitor> event_monitor_; | 575 std::unique_ptr<views::EventMonitor> event_monitor_; |
574 | 576 |
575 DISALLOW_COPY_AND_ASSIGN(WebContentMouseHandler); | 577 DISALLOW_COPY_AND_ASSIGN(WebContentMouseHandler); |
576 }; | 578 }; |
577 | 579 |
578 ManagePasswordsBubbleView::WebContentMouseHandler::WebContentMouseHandler( | 580 ManagePasswordsBubbleView::WebContentMouseHandler::WebContentMouseHandler( |
579 ManagePasswordsBubbleView* bubble) | 581 ManagePasswordsBubbleView* bubble) |
580 : bubble_(bubble) { | 582 : bubble_(bubble) { |
581 content::WebContents* web_contents = bubble_->web_contents(); | 583 content::WebContents* web_contents = bubble_->web_contents(); |
582 DCHECK(web_contents); | 584 DCHECK(web_contents); |
583 event_monitor_ = views::EventMonitor::CreateWindowMonitor( | 585 event_monitor_ = views::EventMonitor::CreateWindowMonitor( |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 AddChildView(new SaveConfirmationView(this)); | 831 AddChildView(new SaveConfirmationView(this)); |
830 } else if (model_.state() == password_manager::ui::AUTO_SIGNIN_STATE) { | 832 } else if (model_.state() == password_manager::ui::AUTO_SIGNIN_STATE) { |
831 AddChildView(new AutoSigninView(this)); | 833 AddChildView(new AutoSigninView(this)); |
832 } else { | 834 } else { |
833 AddChildView(new ManageView(this)); | 835 AddChildView(new ManageView(this)); |
834 } | 836 } |
835 if (GetWidget()) | 837 if (GetWidget()) |
836 GetWidget()->UpdateWindowTitle(); | 838 GetWidget()->UpdateWindowTitle(); |
837 GetLayoutManager()->Layout(this); | 839 GetLayoutManager()->Layout(this); |
838 } | 840 } |
OLD | NEW |