Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: chrome/browser/chromeos/file_manager/app_installer.cc

Issue 437593006: Video Player: Install the cast API extension if it is not installed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/common/extensions/webstore_install_result.h"
8 #include "content/public/browser/web_contents.h" 8 #include "content/public/browser/web_contents.h"
9 #include "content/public/browser/web_contents_observer.h" 9 #include "content/public/browser/web_contents_observer.h"
10 10
(...skipping 18 matching lines...) Expand all
29 29
30 private: 30 private:
31 AppInstaller* parent_; 31 AppInstaller* parent_;
32 32
33 DISALLOW_IMPLICIT_CONSTRUCTORS(WebContentsObserver); 33 DISALLOW_IMPLICIT_CONSTRUCTORS(WebContentsObserver);
34 }; 34 };
35 35
36 AppInstaller::AppInstaller(content::WebContents* web_contents, 36 AppInstaller::AppInstaller(content::WebContents* web_contents,
37 const std::string& item_id, 37 const std::string& item_id,
38 Profile* profile, 38 Profile* profile,
39 bool silent_installation,
39 const Callback& callback) 40 const Callback& callback)
40 : extensions::WebstoreStandaloneInstaller(item_id, profile, callback), 41 : extensions::WebstoreStandaloneInstaller(item_id, profile, callback),
42 silent_installation_(silent_installation),
41 callback_(callback), 43 callback_(callback),
42 web_contents_(web_contents), 44 web_contents_(web_contents),
43 web_contents_observer_(new WebContentsObserver(web_contents, this)) { 45 web_contents_observer_(new WebContentsObserver(web_contents, this)) {
44 } 46 }
45 47
46 AppInstaller::~AppInstaller() {} 48 AppInstaller::~AppInstaller() {}
47 49
48 bool AppInstaller::CheckRequestorAlive() const { 50 bool AppInstaller::CheckRequestorAlive() const {
49 // The tab may have gone away - cancel installation in that case. 51 // The tab may have gone away - cancel installation in that case.
50 return web_contents_ != NULL; 52 return web_contents_ != NULL;
51 } 53 }
52 54
53 const GURL& AppInstaller::GetRequestorURL() const { 55 const GURL& AppInstaller::GetRequestorURL() const {
54 return GURL::EmptyGURL(); 56 return GURL::EmptyGURL();
55 } 57 }
56 58
57 scoped_refptr<ExtensionInstallPrompt::Prompt> 59 scoped_refptr<ExtensionInstallPrompt::Prompt>
58 AppInstaller::CreateInstallPrompt() const { 60 AppInstaller::CreateInstallPrompt() const {
61 if (silent_installation_)
62 return NULL;
63
59 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt( 64 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt(
60 new ExtensionInstallPrompt::Prompt( 65 new ExtensionInstallPrompt::Prompt(
61 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT)); 66 ExtensionInstallPrompt::INLINE_INSTALL_PROMPT));
62 67
63 prompt->SetWebstoreData(localized_user_count(), 68 prompt->SetWebstoreData(localized_user_count(),
64 show_user_count(), 69 show_user_count(),
65 average_rating(), 70 average_rating(),
66 rating_count()); 71 rating_count());
67 return prompt; 72 return prompt;
68 } 73 }
(...skipping 28 matching lines...) Expand all
97 102
98 void AppInstaller::OnWebContentsDestroyed( 103 void AppInstaller::OnWebContentsDestroyed(
99 content::WebContents* web_contents) { 104 content::WebContents* web_contents) {
100 callback_.Run(false, 105 callback_.Run(false,
101 kWebContentsDestroyedError, 106 kWebContentsDestroyedError,
102 extensions::webstore_install::OTHER_ERROR); 107 extensions::webstore_install::OTHER_ERROR);
103 AbortInstall(); 108 AbortInstall();
104 } 109 }
105 110
106 } // namespace file_manager 111 } // namespace file_manager
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/file_manager/app_installer.h ('k') | chrome/common/extensions/api/file_browser_private.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698