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 "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/browser_finder.h" | 8 #include "chrome/browser/ui/browser_finder.h" |
9 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
10 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 10 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 class ManagePasswordsBubbleView::PendingView : public views::View, | 175 class ManagePasswordsBubbleView::PendingView : public views::View, |
176 public views::ButtonListener, | 176 public views::ButtonListener, |
177 public views::ComboboxListener { | 177 public views::ComboboxListener { |
178 public: | 178 public: |
179 explicit PendingView(ManagePasswordsBubbleView* parent); | 179 explicit PendingView(ManagePasswordsBubbleView* parent); |
180 virtual ~PendingView(); | 180 virtual ~PendingView(); |
181 | 181 |
182 private: | 182 private: |
183 // views::ButtonListener: | 183 // views::ButtonListener: |
184 virtual void ButtonPressed(views::Button* sender, | 184 virtual void ButtonPressed(views::Button* sender, |
185 const ui::Event& event) OVERRIDE; | 185 const ui::Event& event) override; |
186 | 186 |
187 // Handles the event when the user changes an index of a combobox. | 187 // Handles the event when the user changes an index of a combobox. |
188 virtual void OnPerformAction(views::Combobox* source) OVERRIDE; | 188 virtual void OnPerformAction(views::Combobox* source) override; |
189 | 189 |
190 ManagePasswordsBubbleView* parent_; | 190 ManagePasswordsBubbleView* parent_; |
191 | 191 |
192 views::BlueButton* save_button_; | 192 views::BlueButton* save_button_; |
193 | 193 |
194 // The combobox doesn't take ownership of its model. If we created a | 194 // The combobox doesn't take ownership of its model. If we created a |
195 // combobox we need to ensure that we delete the model here, and because the | 195 // combobox we need to ensure that we delete the model here, and because the |
196 // combobox uses the model in it's destructor, we need to make sure we | 196 // combobox uses the model in it's destructor, we need to make sure we |
197 // delete the model _after_ the combobox itself is deleted. | 197 // delete the model _after_ the combobox itself is deleted. |
198 scoped_ptr<SavePasswordRefusalComboboxModel> combobox_model_; | 198 scoped_ptr<SavePasswordRefusalComboboxModel> combobox_model_; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 class ManagePasswordsBubbleView::ConfirmNeverView | 275 class ManagePasswordsBubbleView::ConfirmNeverView |
276 : public views::View, | 276 : public views::View, |
277 public views::ButtonListener { | 277 public views::ButtonListener { |
278 public: | 278 public: |
279 explicit ConfirmNeverView(ManagePasswordsBubbleView* parent); | 279 explicit ConfirmNeverView(ManagePasswordsBubbleView* parent); |
280 virtual ~ConfirmNeverView(); | 280 virtual ~ConfirmNeverView(); |
281 | 281 |
282 private: | 282 private: |
283 // views::ButtonListener: | 283 // views::ButtonListener: |
284 virtual void ButtonPressed(views::Button* sender, | 284 virtual void ButtonPressed(views::Button* sender, |
285 const ui::Event& event) OVERRIDE; | 285 const ui::Event& event) override; |
286 | 286 |
287 ManagePasswordsBubbleView* parent_; | 287 ManagePasswordsBubbleView* parent_; |
288 | 288 |
289 views::LabelButton* confirm_button_; | 289 views::LabelButton* confirm_button_; |
290 views::LabelButton* undo_button_; | 290 views::LabelButton* undo_button_; |
291 }; | 291 }; |
292 | 292 |
293 ManagePasswordsBubbleView::ConfirmNeverView::ConfirmNeverView( | 293 ManagePasswordsBubbleView::ConfirmNeverView::ConfirmNeverView( |
294 ManagePasswordsBubbleView* parent) | 294 ManagePasswordsBubbleView* parent) |
295 : parent_(parent) { | 295 : parent_(parent) { |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 class ManagePasswordsBubbleView::ManageView : public views::View, | 370 class ManagePasswordsBubbleView::ManageView : public views::View, |
371 public views::ButtonListener, | 371 public views::ButtonListener, |
372 public views::LinkListener { | 372 public views::LinkListener { |
373 public: | 373 public: |
374 explicit ManageView(ManagePasswordsBubbleView* parent); | 374 explicit ManageView(ManagePasswordsBubbleView* parent); |
375 virtual ~ManageView(); | 375 virtual ~ManageView(); |
376 | 376 |
377 private: | 377 private: |
378 // views::ButtonListener: | 378 // views::ButtonListener: |
379 virtual void ButtonPressed(views::Button* sender, | 379 virtual void ButtonPressed(views::Button* sender, |
380 const ui::Event& event) OVERRIDE; | 380 const ui::Event& event) override; |
381 | 381 |
382 // views::LinkListener: | 382 // views::LinkListener: |
383 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 383 virtual void LinkClicked(views::Link* source, int event_flags) override; |
384 | 384 |
385 ManagePasswordsBubbleView* parent_; | 385 ManagePasswordsBubbleView* parent_; |
386 | 386 |
387 views::Link* manage_link_; | 387 views::Link* manage_link_; |
388 views::LabelButton* done_button_; | 388 views::LabelButton* done_button_; |
389 }; | 389 }; |
390 | 390 |
391 ManagePasswordsBubbleView::ManageView::ManageView( | 391 ManagePasswordsBubbleView::ManageView::ManageView( |
392 ManagePasswordsBubbleView* parent) | 392 ManagePasswordsBubbleView* parent) |
393 : parent_(parent) { | 393 : parent_(parent) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 class ManagePasswordsBubbleView::BlacklistedView | 482 class ManagePasswordsBubbleView::BlacklistedView |
483 : public views::View, | 483 : public views::View, |
484 public views::ButtonListener { | 484 public views::ButtonListener { |
485 public: | 485 public: |
486 explicit BlacklistedView(ManagePasswordsBubbleView* parent); | 486 explicit BlacklistedView(ManagePasswordsBubbleView* parent); |
487 virtual ~BlacklistedView(); | 487 virtual ~BlacklistedView(); |
488 | 488 |
489 private: | 489 private: |
490 // views::ButtonListener: | 490 // views::ButtonListener: |
491 virtual void ButtonPressed(views::Button* sender, | 491 virtual void ButtonPressed(views::Button* sender, |
492 const ui::Event& event) OVERRIDE; | 492 const ui::Event& event) override; |
493 | 493 |
494 ManagePasswordsBubbleView* parent_; | 494 ManagePasswordsBubbleView* parent_; |
495 | 495 |
496 views::BlueButton* unblacklist_button_; | 496 views::BlueButton* unblacklist_button_; |
497 views::LabelButton* done_button_; | 497 views::LabelButton* done_button_; |
498 }; | 498 }; |
499 | 499 |
500 ManagePasswordsBubbleView::BlacklistedView::BlacklistedView( | 500 ManagePasswordsBubbleView::BlacklistedView::BlacklistedView( |
501 ManagePasswordsBubbleView* parent) | 501 ManagePasswordsBubbleView* parent) |
502 : parent_(parent) { | 502 : parent_(parent) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 : public views::View, | 565 : public views::View, |
566 public views::ButtonListener, | 566 public views::ButtonListener, |
567 public views::StyledLabelListener { | 567 public views::StyledLabelListener { |
568 public: | 568 public: |
569 explicit SaveConfirmationView(ManagePasswordsBubbleView* parent); | 569 explicit SaveConfirmationView(ManagePasswordsBubbleView* parent); |
570 virtual ~SaveConfirmationView(); | 570 virtual ~SaveConfirmationView(); |
571 | 571 |
572 private: | 572 private: |
573 // views::ButtonListener: | 573 // views::ButtonListener: |
574 virtual void ButtonPressed(views::Button* sender, | 574 virtual void ButtonPressed(views::Button* sender, |
575 const ui::Event& event) OVERRIDE; | 575 const ui::Event& event) override; |
576 | 576 |
577 // views::StyledLabelListener implementation | 577 // views::StyledLabelListener implementation |
578 virtual void StyledLabelLinkClicked(const gfx::Range& range, | 578 virtual void StyledLabelLinkClicked(const gfx::Range& range, |
579 int event_flags) OVERRIDE; | 579 int event_flags) override; |
580 | 580 |
581 ManagePasswordsBubbleView* parent_; | 581 ManagePasswordsBubbleView* parent_; |
582 | 582 |
583 views::LabelButton* ok_button_; | 583 views::LabelButton* ok_button_; |
584 }; | 584 }; |
585 | 585 |
586 ManagePasswordsBubbleView::SaveConfirmationView::SaveConfirmationView( | 586 ManagePasswordsBubbleView::SaveConfirmationView::SaveConfirmationView( |
587 ManagePasswordsBubbleView* parent) | 587 ManagePasswordsBubbleView* parent) |
588 : parent_(parent) { | 588 : parent_(parent) { |
589 views::GridLayout* layout = new views::GridLayout(this); | 589 views::GridLayout* layout = new views::GridLayout(this); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 // ManagePasswordsBubbleView::WebContentMouseHandler -------------------------- | 641 // ManagePasswordsBubbleView::WebContentMouseHandler -------------------------- |
642 | 642 |
643 // The class listens for WebContentsView events and notifies the bubble if the | 643 // The class listens for WebContentsView events and notifies the bubble if the |
644 // view was clicked on or received keystrokes. | 644 // view was clicked on or received keystrokes. |
645 class ManagePasswordsBubbleView::WebContentMouseHandler | 645 class ManagePasswordsBubbleView::WebContentMouseHandler |
646 : public ui::EventHandler { | 646 : public ui::EventHandler { |
647 public: | 647 public: |
648 explicit WebContentMouseHandler(ManagePasswordsBubbleView* bubble); | 648 explicit WebContentMouseHandler(ManagePasswordsBubbleView* bubble); |
649 virtual ~WebContentMouseHandler(); | 649 virtual ~WebContentMouseHandler(); |
650 | 650 |
651 virtual void OnKeyEvent(ui::KeyEvent* event) OVERRIDE; | 651 virtual void OnKeyEvent(ui::KeyEvent* event) override; |
652 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE; | 652 virtual void OnMouseEvent(ui::MouseEvent* event) override; |
653 | 653 |
654 private: | 654 private: |
655 aura::Window* GetWebContentsWindow(); | 655 aura::Window* GetWebContentsWindow(); |
656 | 656 |
657 ManagePasswordsBubbleView* bubble_; | 657 ManagePasswordsBubbleView* bubble_; |
658 | 658 |
659 DISALLOW_COPY_AND_ASSIGN(WebContentMouseHandler); | 659 DISALLOW_COPY_AND_ASSIGN(WebContentMouseHandler); |
660 }; | 660 }; |
661 | 661 |
662 ManagePasswordsBubbleView::WebContentMouseHandler::WebContentMouseHandler( | 662 ManagePasswordsBubbleView::WebContentMouseHandler::WebContentMouseHandler( |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 void ManagePasswordsBubbleView::WindowClosing() { | 849 void ManagePasswordsBubbleView::WindowClosing() { |
850 // Close() closes the window asynchronously, so by the time we reach here, | 850 // Close() closes the window asynchronously, so by the time we reach here, |
851 // |manage_passwords_bubble_| may have already been reset. | 851 // |manage_passwords_bubble_| may have already been reset. |
852 if (manage_passwords_bubble_ == this) | 852 if (manage_passwords_bubble_ == this) |
853 manage_passwords_bubble_ = NULL; | 853 manage_passwords_bubble_ = NULL; |
854 } | 854 } |
855 | 855 |
856 views::View* ManagePasswordsBubbleView::GetInitiallyFocusedView() { | 856 views::View* ManagePasswordsBubbleView::GetInitiallyFocusedView() { |
857 return initially_focused_view_; | 857 return initially_focused_view_; |
858 } | 858 } |
OLD | NEW |