| 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/passwords/manage_passwords_ui_controller.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| 6 | 6 |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/password_manager/password_store_factory.h" | 10 #include "chrome/browser/password_manager/password_store_factory.h" |
| 11 #include "chrome/browser/ui/browser_command_controller.h" | 11 #include "chrome/browser/ui/browser_command_controller.h" |
| 12 #include "chrome/browser/ui/browser_dialogs.h" | 12 #include "chrome/browser/ui/browser_dialogs.h" |
| 13 #include "chrome/browser/ui/browser_finder.h" | 13 #include "chrome/browser/ui/browser_finder.h" |
| 14 #include "chrome/browser/ui/browser_window.h" | 14 #include "chrome/browser/ui/browser_window.h" |
| 15 #include "chrome/browser/ui/chrome_pages.h" | 15 #include "chrome/browser/ui/chrome_pages.h" |
| 16 #include "chrome/browser/ui/location_bar/location_bar.h" | 16 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 17 #include "chrome/browser/ui/passwords/manage_passwords_icon.h" | 17 #include "chrome/browser/ui/passwords/manage_passwords_icon.h" |
| 18 #include "chrome/browser/ui/passwords/password_bubble_experiment.h" |
| 18 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 19 #include "components/password_manager/core/browser/password_store.h" | 20 #include "components/password_manager/core/browser/password_store.h" |
| 20 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
| 21 | 22 |
| 22 #if defined(OS_ANDROID) | 23 #if defined(OS_ANDROID) |
| 23 #include "chrome/browser/android/chromium_application.h" | 24 #include "chrome/browser/android/chromium_application.h" |
| 24 #endif | 25 #endif |
| 25 | 26 |
| 26 using autofill::PasswordFormMap; | 27 using autofill::PasswordFormMap; |
| 27 using password_manager::PasswordFormManager; | 28 using password_manager::PasswordFormManager; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 icon->SetState(state_); | 262 icon->SetState(state_); |
| 262 } | 263 } |
| 263 } | 264 } |
| 264 | 265 |
| 265 void ManagePasswordsUIController::ShowBubbleWithoutUserInteraction() { | 266 void ManagePasswordsUIController::ShowBubbleWithoutUserInteraction() { |
| 266 DCHECK(password_manager::ui::IsAutomaticDisplayState(state_)); | 267 DCHECK(password_manager::ui::IsAutomaticDisplayState(state_)); |
| 267 #if !defined(OS_ANDROID) | 268 #if !defined(OS_ANDROID) |
| 268 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); | 269 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); |
| 269 if (!browser || browser->toolbar_model()->input_in_progress()) | 270 if (!browser || browser->toolbar_model()->input_in_progress()) |
| 270 return; | 271 return; |
| 272 if (state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE && |
| 273 !password_bubble_experiment::ShouldShowBubble( |
| 274 browser->profile()->GetPrefs())) |
| 275 return; |
| 271 CommandUpdater* updater = browser->command_controller()->command_updater(); | 276 CommandUpdater* updater = browser->command_controller()->command_updater(); |
| 272 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); | 277 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); |
| 273 #endif | 278 #endif |
| 274 } | 279 } |
| 275 | 280 |
| 276 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { | 281 bool ManagePasswordsUIController::PasswordPendingUserDecision() const { |
| 277 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || | 282 return state_ == password_manager::ui::PENDING_PASSWORD_STATE || |
| 278 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; | 283 state_ == password_manager::ui::PENDING_PASSWORD_AND_BUBBLE_STATE; |
| 279 } | 284 } |
| OLD | NEW |