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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 10 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 UpdateBubbleAndIconVisibility(); | 325 UpdateBubbleAndIconVisibility(); |
326 } | 326 } |
327 } | 327 } |
328 | 328 |
329 void ManagePasswordsUIController::ShowBubbleWithoutUserInteraction() { | 329 void ManagePasswordsUIController::ShowBubbleWithoutUserInteraction() { |
330 DCHECK(should_pop_up_bubble_); | 330 DCHECK(should_pop_up_bubble_); |
331 #if !defined(OS_ANDROID) | 331 #if !defined(OS_ANDROID) |
332 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); | 332 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); |
333 if (!browser || browser->toolbar_model()->input_in_progress()) | 333 if (!browser || browser->toolbar_model()->input_in_progress()) |
334 return; | 334 return; |
335 if (state() == password_manager::ui::PENDING_PASSWORD_STATE && | 335 |
336 !password_bubble_experiment::ShouldShowBubble( | |
337 browser->profile()->GetPrefs())) | |
338 return; | |
339 CommandUpdater* updater = browser->command_controller()->command_updater(); | 336 CommandUpdater* updater = browser->command_controller()->command_updater(); |
340 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); | 337 updater->ExecuteCommand(IDC_MANAGE_PASSWORDS_FOR_PAGE); |
341 #endif | 338 #endif |
342 } | 339 } |
343 | 340 |
344 void ManagePasswordsUIController::WebContentsDestroyed() { | 341 void ManagePasswordsUIController::WebContentsDestroyed() { |
345 password_manager::PasswordStore* password_store = | 342 password_manager::PasswordStore* password_store = |
346 GetPasswordStore(web_contents()); | 343 GetPasswordStore(web_contents()); |
347 if (password_store) | 344 if (password_store) |
348 password_store->RemoveObserver(this); | 345 password_store->RemoveObserver(this); |
349 } | 346 } |
OLD | NEW |