| 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 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/utf_string_conversion_utils.h" | 12 #include "base/strings/utf_string_conversion_utils.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "chrome/browser/ui/autofill/password_generation_popup_observer.h" | 14 #include "chrome/browser/ui/autofill/password_generation_popup_observer.h" |
| 15 #include "chrome/browser/ui/autofill/password_generation_popup_view.h" | 15 #include "chrome/browser/ui/autofill/password_generation_popup_view.h" |
| 16 #include "chrome/browser/ui/autofill/popup_constants.h" | 16 #include "chrome/browser/ui/autofill/popup_constants.h" |
| 17 #include "chrome/browser/ui/browser.h" | |
| 18 #include "chrome/browser/ui/browser_finder.h" | 17 #include "chrome/browser/ui/browser_finder.h" |
| 18 #include "chrome/browser/ui/chrome_pages.h" |
| 19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 20 #include "chrome/grit/chromium_strings.h" | 20 #include "chrome/grit/chromium_strings.h" |
| 21 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
| 22 #include "chrome/grit/google_chrome_strings.h" | 22 #include "chrome/grit/google_chrome_strings.h" |
| 23 #include "components/autofill/content/common/autofill_messages.h" | 23 #include "components/autofill/content/common/autofill_messages.h" |
| 24 #include "components/autofill/core/browser/password_generator.h" | 24 #include "components/autofill/core/browser/password_generator.h" |
| 25 #include "components/password_manager/core/browser/password_manager.h" | 25 #include "components/password_manager/core/browser/password_manager.h" |
| 26 #include "content/public/browser/native_web_keyboard_event.h" | 26 #include "content/public/browser/native_web_keyboard_event.h" |
| 27 #include "content/public/browser/render_view_host.h" | 27 #include "content/public/browser/render_view_host.h" |
| 28 #include "content/public/browser/web_contents.h" | 28 #include "content/public/browser/web_contents.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 delete this; | 207 delete this; |
| 208 } | 208 } |
| 209 | 209 |
| 210 void PasswordGenerationPopupControllerImpl::ViewDestroyed() { | 210 void PasswordGenerationPopupControllerImpl::ViewDestroyed() { |
| 211 view_ = NULL; | 211 view_ = NULL; |
| 212 | 212 |
| 213 Hide(); | 213 Hide(); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void PasswordGenerationPopupControllerImpl::OnSavedPasswordsLinkClicked() { | 216 void PasswordGenerationPopupControllerImpl::OnSavedPasswordsLinkClicked() { |
| 217 Browser* browser = | 217 chrome::ShowSettingsSubPage( |
| 218 chrome::FindBrowserWithWebContents(controller_common_.web_contents()); | 218 chrome::FindBrowserWithWebContents(controller_common_.web_contents()), |
| 219 content::OpenURLParams params( | 219 chrome::kPasswordManagerSubPage); |
| 220 GURL(chrome::kPasswordManagerAccountDashboardURL), content::Referrer(), | |
| 221 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false); | |
| 222 browser->OpenURL(params); | |
| 223 } | 220 } |
| 224 | 221 |
| 225 void PasswordGenerationPopupControllerImpl::SetSelectionAtPoint( | 222 void PasswordGenerationPopupControllerImpl::SetSelectionAtPoint( |
| 226 const gfx::Point& point) { | 223 const gfx::Point& point) { |
| 227 PasswordSelected(view_->IsPointInPasswordBounds(point)); | 224 PasswordSelected(view_->IsPointInPasswordBounds(point)); |
| 228 } | 225 } |
| 229 | 226 |
| 230 bool PasswordGenerationPopupControllerImpl::AcceptSelectedLine() { | 227 bool PasswordGenerationPopupControllerImpl::AcceptSelectedLine() { |
| 231 if (!password_selected_) | 228 if (!password_selected_) |
| 232 return false; | 229 return false; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 271 |
| 275 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { | 272 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { |
| 276 return help_text_; | 273 return help_text_; |
| 277 } | 274 } |
| 278 | 275 |
| 279 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { | 276 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { |
| 280 return link_range_; | 277 return link_range_; |
| 281 } | 278 } |
| 282 | 279 |
| 283 } // namespace autofill | 280 } // namespace autofill |
| OLD | NEW |