| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/file_manager/app_installer.h" | 5 #include "chrome/browser/chromeos/file_manager/app_installer.h" |
| 6 | 6 |
| 7 #include "chrome/common/extensions/webstore_install_result.h" |
| 7 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
| 8 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
| 9 | 10 |
| 10 namespace file_manager { | 11 namespace file_manager { |
| 11 | 12 |
| 12 namespace { | 13 namespace { |
| 13 const char kWebContentsDestroyedError[] = "WebContents is destroyed."; | 14 const char kWebContentsDestroyedError[] = "WebContents is destroyed."; |
| 14 } // namespace | 15 } // namespace |
| 15 | 16 |
| 16 class AppInstaller::WebContentsObserver : public content::WebContentsObserver { | 17 class AppInstaller::WebContentsObserver : public content::WebContentsObserver { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 bool AppInstaller::CheckRequestorPermitted( | 90 bool AppInstaller::CheckRequestorPermitted( |
| 90 const base::DictionaryValue& webstore_data, | 91 const base::DictionaryValue& webstore_data, |
| 91 std::string* error) const { | 92 std::string* error) const { |
| 92 DCHECK(error != NULL); | 93 DCHECK(error != NULL); |
| 93 DCHECK(error->empty()); | 94 DCHECK(error->empty()); |
| 94 return true; | 95 return true; |
| 95 } | 96 } |
| 96 | 97 |
| 97 void AppInstaller::OnWebContentsDestroyed( | 98 void AppInstaller::OnWebContentsDestroyed( |
| 98 content::WebContents* web_contents) { | 99 content::WebContents* web_contents) { |
| 99 callback_.Run(false, kWebContentsDestroyedError); | 100 callback_.Run(false, |
| 101 kWebContentsDestroyedError, |
| 102 extensions::webstore_install::OTHER_ERROR); |
| 100 AbortInstall(); | 103 AbortInstall(); |
| 101 } | 104 } |
| 102 | 105 |
| 103 } // namespace file_manager | 106 } // namespace file_manager |
| OLD | NEW |