Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/autofill/password_generation_popup_controller_impl.h " | 5 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h " |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| 11 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/utf_string_conversion_utils.h" | 13 #include "base/strings/utf_string_conversion_utils.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "chrome/browser/ui/autofill/password_generation_popup_observer.h" | 15 #include "chrome/browser/ui/autofill/password_generation_popup_observer.h" |
| 16 #include "chrome/browser/ui/autofill/password_generation_popup_view.h" | 16 #include "chrome/browser/ui/autofill/password_generation_popup_view.h" |
| 17 #include "chrome/browser/ui/autofill/popup_constants.h" | 17 #include "chrome/browser/ui/autofill/popup_constants.h" |
| 18 #include "chrome/browser/ui/browser_finder.h" | 18 #include "chrome/browser/ui/browser_finder.h" |
| 19 #include "chrome/browser/ui/chrome_pages.h" | 19 #include "chrome/browser/ui/browser_navigator_params.h" |
| 20 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 21 #include "chrome/grit/chromium_strings.h" | 21 #include "chrome/grit/chromium_strings.h" |
| 22 #include "chrome/grit/generated_resources.h" | 22 #include "chrome/grit/generated_resources.h" |
| 23 #include "components/autofill/core/browser/password_generator.h" | 23 #include "components/autofill/core/browser/password_generator.h" |
| 24 #include "components/autofill/core/browser/suggestion.h" | 24 #include "components/autofill/core/browser/suggestion.h" |
| 25 #include "components/password_manager/core/browser/password_bubble_experiment.h" | 25 #include "components/password_manager/core/browser/password_bubble_experiment.h" |
| 26 #include "components/password_manager/core/browser/password_manager.h" | 26 #include "components/password_manager/core/browser/password_manager.h" |
| 27 #include "components/password_manager/core/browser/password_manager_constants.h" | |
| 27 #include "content/public/browser/native_web_keyboard_event.h" | 28 #include "content/public/browser/native_web_keyboard_event.h" |
| 28 #include "content/public/browser/render_view_host.h" | 29 #include "content/public/browser/render_view_host.h" |
| 29 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
| 30 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
| 31 #include "ui/events/keycodes/keyboard_codes.h" | 32 #include "ui/events/keycodes/keyboard_codes.h" |
| 32 #include "ui/gfx/geometry/rect_conversions.h" | 33 #include "ui/gfx/geometry/rect_conversions.h" |
| 33 #include "ui/gfx/text_utils.h" | 34 #include "ui/gfx/text_utils.h" |
| 34 | 35 |
| 35 #if defined(OS_ANDROID) | 36 #if defined(OS_ANDROID) |
| 36 #include "chrome/browser/android/chrome_application.h" | 37 #include "chrome/browser/android/chrome_application.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 218 void PasswordGenerationPopupControllerImpl::ViewDestroyed() { | 219 void PasswordGenerationPopupControllerImpl::ViewDestroyed() { |
| 219 view_ = NULL; | 220 view_ = NULL; |
| 220 | 221 |
| 221 Hide(); | 222 Hide(); |
| 222 } | 223 } |
| 223 | 224 |
| 224 void PasswordGenerationPopupControllerImpl::OnSavedPasswordsLinkClicked() { | 225 void PasswordGenerationPopupControllerImpl::OnSavedPasswordsLinkClicked() { |
| 225 #if defined(OS_ANDROID) | 226 #if defined(OS_ANDROID) |
| 226 chrome::android::ChromeApplication::ShowPasswordSettings(); | 227 chrome::android::ChromeApplication::ShowPasswordSettings(); |
| 227 #else | 228 #else |
| 228 chrome::ShowSettingsSubPage( | 229 chrome::NavigateParams params( |
| 229 chrome::FindBrowserWithWebContents(controller_common_.web_contents()), | 230 chrome::FindBrowserWithWebContents(web_contents()), |
| 230 chrome::kPasswordManagerSubPage); | 231 GURL(password_manager::kPasswordManagerAccountDashboardURL), |
| 232 ui::PAGE_TRANSITION_LINK); | |
| 233 params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; | |
| 234 chrome::Navigate(¶ms); | |
|
vasilii
2017/02/24 16:04:36
Not sure why it's different for Android.
dvadym
2017/02/24 16:08:00
Good point. I don't have mocks for Android for now
| |
| 231 #endif | 235 #endif |
| 232 } | 236 } |
| 233 | 237 |
| 234 void PasswordGenerationPopupControllerImpl::SetSelectionAtPoint( | 238 void PasswordGenerationPopupControllerImpl::SetSelectionAtPoint( |
| 235 const gfx::Point& point) { | 239 const gfx::Point& point) { |
| 236 PasswordSelected(view_->IsPointInPasswordBounds(point)); | 240 PasswordSelected(view_->IsPointInPasswordBounds(point)); |
| 237 } | 241 } |
| 238 | 242 |
| 239 bool PasswordGenerationPopupControllerImpl::AcceptSelectedLine() { | 243 bool PasswordGenerationPopupControllerImpl::AcceptSelectedLine() { |
| 240 if (!password_selected_) | 244 if (!password_selected_) |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 300 | 304 |
| 301 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { | 305 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { |
| 302 return help_text_; | 306 return help_text_; |
| 303 } | 307 } |
| 304 | 308 |
| 305 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { | 309 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { |
| 306 return link_range_; | 310 return link_range_; |
| 307 } | 311 } |
| 308 | 312 |
| 309 } // namespace autofill | 313 } // namespace autofill |
| OLD | NEW |