Chromium Code Reviews| 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" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_finder.h" | 12 #include "chrome/browser/ui/browser_finder.h" |
| 13 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" | 13 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| 14 #include "chrome/browser/ui/passwords/password_dialog_prompts.h" | 14 #include "chrome/browser/ui/passwords/password_dialog_prompts.h" |
| 15 #include "chrome/browser/ui/passwords/passwords_model_delegate.h" | 15 #include "chrome/browser/ui/passwords/passwords_model_delegate.h" |
| 16 #include "chrome/browser/ui/views/frame/browser_view.h" | 16 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 17 #include "chrome/browser/ui/views/harmony/layout_delegate.h" | |
| 17 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" | 18 #include "chrome/browser/ui/views/passwords/credentials_item_view.h" |
| 18 #include "chrome/browser/ui/views/passwords/credentials_selection_view.h" | 19 #include "chrome/browser/ui/views/passwords/credentials_selection_view.h" |
| 19 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" | 20 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" |
| 20 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h" | 21 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h" |
| 21 #include "chrome/grit/generated_resources.h" | 22 #include "chrome/grit/generated_resources.h" |
| 22 #include "components/strings/grit/components_strings.h" | 23 #include "components/strings/grit/components_strings.h" |
| 23 #include "content/public/browser/user_metrics.h" | 24 #include "content/public/browser/user_metrics.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/material_design/material_design_controller.h" | 26 #include "ui/base/material_design/material_design_controller.h" |
| 26 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 760 ManagePasswordsBubbleView::ManagePasswordsBubbleView( | 761 ManagePasswordsBubbleView::ManagePasswordsBubbleView( |
| 761 content::WebContents* web_contents, | 762 content::WebContents* web_contents, |
| 762 views::View* anchor_view, | 763 views::View* anchor_view, |
| 763 DisplayReason reason) | 764 DisplayReason reason) |
| 764 : LocationBarBubbleDelegateView(anchor_view, web_contents), | 765 : LocationBarBubbleDelegateView(anchor_view, web_contents), |
| 765 model_(PasswordsModelDelegateFromWebContents(web_contents), | 766 model_(PasswordsModelDelegateFromWebContents(web_contents), |
| 766 reason == AUTOMATIC ? ManagePasswordsBubbleModel::AUTOMATIC | 767 reason == AUTOMATIC ? ManagePasswordsBubbleModel::AUTOMATIC |
| 767 : ManagePasswordsBubbleModel::USER_ACTION), | 768 : ManagePasswordsBubbleModel::USER_ACTION), |
| 768 initially_focused_view_(nullptr) { | 769 initially_focused_view_(nullptr) { |
| 769 mouse_handler_.reset(new WebContentMouseHandler(this, this->web_contents())); | 770 mouse_handler_.reset(new WebContentMouseHandler(this, this->web_contents())); |
| 771 const int side_margin = margins().left(); | |
|
vasilii
2017/03/23 17:51:27
Please add a comment why it's here.
dvadym
2017/03/24 13:20:43
Done.
| |
| 772 set_title_margins( | |
| 773 gfx::Insets(LayoutDelegate::Get()->GetMetric( | |
| 774 LayoutDelegate::Metric::PANEL_CONTENT_MARGIN), | |
| 775 side_margin, 0, side_margin)); | |
| 770 } | 776 } |
| 771 | 777 |
| 772 ManagePasswordsBubbleView::~ManagePasswordsBubbleView() { | 778 ManagePasswordsBubbleView::~ManagePasswordsBubbleView() { |
| 773 if (manage_passwords_bubble_ == this) | 779 if (manage_passwords_bubble_ == this) |
| 774 manage_passwords_bubble_ = NULL; | 780 manage_passwords_bubble_ = NULL; |
| 775 } | 781 } |
| 776 | 782 |
| 777 views::View* ManagePasswordsBubbleView::GetInitiallyFocusedView() { | 783 views::View* ManagePasswordsBubbleView::GetInitiallyFocusedView() { |
| 778 return initially_focused_view_; | 784 return initially_focused_view_; |
| 779 } | 785 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 850 } else if (model_.state() == | 856 } else if (model_.state() == |
| 851 password_manager::ui::CHROME_DESKTOP_IOS_PROMO_STATE) { | 857 password_manager::ui::CHROME_DESKTOP_IOS_PROMO_STATE) { |
| 852 AddChildView(new DesktopIOSPromotionBubbleView( | 858 AddChildView(new DesktopIOSPromotionBubbleView( |
| 853 model_.GetProfile(), | 859 model_.GetProfile(), |
| 854 desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE)); | 860 desktop_ios_promotion::PromotionEntryPoint::SAVE_PASSWORD_BUBBLE)); |
| 855 #endif | 861 #endif |
| 856 } else { | 862 } else { |
| 857 AddChildView(new ManageView(this)); | 863 AddChildView(new ManageView(this)); |
| 858 } | 864 } |
| 859 } | 865 } |
| OLD | NEW |