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 "components/infobars/core/infobar_manager.h" | 5 #include "components/infobars/core/infobar_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "components/infobars/core/infobar.h" | 10 #include "components/infobars/core/infobar.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 | 94 |
| 95 void InfoBarManager::AddObserver(Observer* obs) { | 95 void InfoBarManager::AddObserver(Observer* obs) { |
| 96 observer_list_.AddObserver(obs); | 96 observer_list_.AddObserver(obs); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void InfoBarManager::RemoveObserver(Observer* obs) { | 99 void InfoBarManager::RemoveObserver(Observer* obs) { |
| 100 observer_list_.RemoveObserver(obs); | 100 observer_list_.RemoveObserver(obs); |
| 101 } | 101 } |
| 102 | 102 |
| 103 InfoBarManager::InfoBarManager() | 103 InfoBarManager::InfoBarManager() |
| 104 : infobars_enabled_(true) { | 104 : infobars_enabled_(true), animations_enabled_(true) { |
|
Peter Kasting
2017/02/23 00:33:56
Nit: You're welcome to move these initializations
samuong
2017/02/23 00:45:26
Done. Just to confirm, you meant using brace-initi
Peter Kasting
2017/02/23 00:51:34
I would use "= true" in preference to "{true}", si
| |
| 105 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 105 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 106 switches::kDisableInfoBars)) | 106 switches::kDisableInfoBars)) |
| 107 infobars_enabled_ = false; | 107 infobars_enabled_ = false; |
| 108 } | 108 } |
| 109 | 109 |
| 110 InfoBarManager::~InfoBarManager() {} | 110 InfoBarManager::~InfoBarManager() {} |
| 111 | 111 |
| 112 void InfoBarManager::ShutDown() { | 112 void InfoBarManager::ShutDown() { |
| 113 // Destroy all remaining InfoBars. It's important to not animate here so that | 113 // Destroy all remaining InfoBars. It's important to not animate here so that |
| 114 // we guarantee that we'll delete all delegates before we do anything else. | 114 // we guarantee that we'll delete all delegates before we do anything else. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 infobars_.erase(i); | 154 infobars_.erase(i); |
| 155 | 155 |
| 156 // This notification must happen before the call to CloseSoon() below, since | 156 // This notification must happen before the call to CloseSoon() below, since |
| 157 // observers may want to access |infobar| and that call can delete it. | 157 // observers may want to access |infobar| and that call can delete it. |
| 158 NotifyInfoBarRemoved(infobar, animate); | 158 NotifyInfoBarRemoved(infobar, animate); |
| 159 | 159 |
| 160 infobar->CloseSoon(); | 160 infobar->CloseSoon(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace infobars | 163 } // namespace infobars |
| OLD | NEW |