| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/bundle_installer.h" | 5 #include "chrome/browser/extensions/bundle_installer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } // namespace | 85 } // namespace |
| 86 | 86 |
| 87 // static | 87 // static |
| 88 void BundleInstaller::SetAutoApproveForTesting(bool auto_approve) { | 88 void BundleInstaller::SetAutoApproveForTesting(bool auto_approve) { |
| 89 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)); | 89 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)); |
| 90 g_auto_approve_for_test = auto_approve ? PROCEED : ABORT; | 90 g_auto_approve_for_test = auto_approve ? PROCEED : ABORT; |
| 91 } | 91 } |
| 92 | 92 |
| 93 BundleInstaller::Item::Item() : state(STATE_PENDING) {} | 93 BundleInstaller::Item::Item() : state(STATE_PENDING) {} |
| 94 | 94 |
| 95 BundleInstaller::Item::Item(const Item& other) = default; |
| 96 |
| 95 BundleInstaller::Item::~Item() {} | 97 BundleInstaller::Item::~Item() {} |
| 96 | 98 |
| 97 base::string16 BundleInstaller::Item::GetNameForDisplay() const { | 99 base::string16 BundleInstaller::Item::GetNameForDisplay() const { |
| 98 base::string16 name = base::UTF8ToUTF16(localized_name); | 100 base::string16 name = base::UTF8ToUTF16(localized_name); |
| 99 base::i18n::AdjustStringForLocaleDirection(&name); | 101 base::i18n::AdjustStringForLocaleDirection(&name); |
| 100 return name; | 102 return name; |
| 101 } | 103 } |
| 102 | 104 |
| 103 BundleInstaller::BundleInstaller(Browser* browser, | 105 BundleInstaller::BundleInstaller(Browser* browser, |
| 104 const std::string& name, | 106 const std::string& name, |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 375 |
| 374 ShowInstalledBubbleIfDone(); | 376 ShowInstalledBubbleIfDone(); |
| 375 } | 377 } |
| 376 | 378 |
| 377 void BundleInstaller::OnBrowserRemoved(Browser* browser) { | 379 void BundleInstaller::OnBrowserRemoved(Browser* browser) { |
| 378 if (browser_ == browser) | 380 if (browser_ == browser) |
| 379 browser_ = nullptr; | 381 browser_ = nullptr; |
| 380 } | 382 } |
| 381 | 383 |
| 382 } // namespace extensions | 384 } // namespace extensions |
| OLD | NEW |