| 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/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| 11 #include "chrome/browser/platform_util.h" | 11 #include "chrome/browser/platform_util.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/browser_dialogs.h" |
| 14 #include "chrome/browser/ui/browser_finder.h" | 15 #include "chrome/browser/ui/browser_finder.h" |
| 15 #include "chrome/browser/ui/browser_window.h" | 16 #include "chrome/browser/ui/browser_window.h" |
| 16 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" | 17 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| 17 #include "chrome/browser/ui/passwords/password_dialog_prompts.h" | 18 #include "chrome/browser/ui/passwords/password_dialog_prompts.h" |
| 18 #include "chrome/browser/ui/passwords/passwords_model_delegate.h" | 19 #include "chrome/browser/ui/passwords/passwords_model_delegate.h" |
| 19 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" | 20 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h" |
| 20 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" | 21 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" |
| 21 #include "chrome/browser/ui/views/passwords/credentials_selection_view.h" | 22 #include "chrome/browser/ui/views/passwords/credentials_selection_view.h" |
| 22 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" | 23 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" |
| 23 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h" | 24 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h" |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 views::View* anchor_view, | 784 views::View* anchor_view, |
| 784 const gfx::Point& anchor_point, | 785 const gfx::Point& anchor_point, |
| 785 DisplayReason reason) | 786 DisplayReason reason) |
| 786 : LocationBarBubbleDelegateView(anchor_view, anchor_point, web_contents), | 787 : LocationBarBubbleDelegateView(anchor_view, anchor_point, web_contents), |
| 787 model_(PasswordsModelDelegateFromWebContents(web_contents), | 788 model_(PasswordsModelDelegateFromWebContents(web_contents), |
| 788 reason == AUTOMATIC ? ManagePasswordsBubbleModel::AUTOMATIC | 789 reason == AUTOMATIC ? ManagePasswordsBubbleModel::AUTOMATIC |
| 789 : ManagePasswordsBubbleModel::USER_ACTION), | 790 : ManagePasswordsBubbleModel::USER_ACTION), |
| 790 initially_focused_view_(nullptr) { | 791 initially_focused_view_(nullptr) { |
| 791 mouse_handler_.reset(new WebContentMouseHandler(this, this->web_contents())); | 792 mouse_handler_.reset(new WebContentMouseHandler(this, this->web_contents())); |
| 792 manage_passwords_bubble_ = this; | 793 manage_passwords_bubble_ = this; |
| 794 chrome::RecordDialogCreation(chrome::DialogIdentifier::MANAGE_PASSWORDS); |
| 793 } | 795 } |
| 794 | 796 |
| 795 ManagePasswordsBubbleView::~ManagePasswordsBubbleView() { | 797 ManagePasswordsBubbleView::~ManagePasswordsBubbleView() { |
| 796 if (manage_passwords_bubble_ == this) | 798 if (manage_passwords_bubble_ == this) |
| 797 manage_passwords_bubble_ = nullptr; | 799 manage_passwords_bubble_ = nullptr; |
| 798 } | 800 } |
| 799 | 801 |
| 800 views::View* ManagePasswordsBubbleView::GetInitiallyFocusedView() { | 802 views::View* ManagePasswordsBubbleView::GetInitiallyFocusedView() { |
| 801 return initially_focused_view_; | 803 return initially_focused_view_; |
| 802 } | 804 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 880 } else if (model_.state() == | 882 } else if (model_.state() == |
| 881 password_manager::ui::CHROME_DESKTOP_IOS_PROMO_STATE) { | 883 password_manager::ui::CHROME_DESKTOP_IOS_PROMO_STATE) { |
| 882 AddChildView(new DesktopIOSPromotionBubbleView( | 884 AddChildView(new DesktopIOSPromotionBubbleView( |
| 883 model_.GetProfile(), | 885 model_.GetProfile(), |
| 884 desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE)); | 886 desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE)); |
| 885 #endif | 887 #endif |
| 886 } else { | 888 } else { |
| 887 AddChildView(new ManageView(this)); | 889 AddChildView(new ManageView(this)); |
| 888 } | 890 } |
| 889 } | 891 } |
| OLD | NEW |