Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: chrome/browser/ui/views/passwords/manage_passwords_bubble_view.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698