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

Side by Side Diff: chrome/browser/extensions/webstore_installer.cc

Issue 10703142: Move WebstoreInstaller, WebstoreInlineInstaller, related in extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest merge with master for cq Created 8 years, 5 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
OLDNEW
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/webstore_installer.h" 5 #include "chrome/browser/extensions/webstore_installer.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 using content::BrowserContext; 45 using content::BrowserContext;
46 using content::BrowserThread; 46 using content::BrowserThread;
47 using content::DownloadId; 47 using content::DownloadId;
48 using content::DownloadItem; 48 using content::DownloadItem;
49 using content::DownloadManager; 49 using content::DownloadManager;
50 using content::NavigationController; 50 using content::NavigationController;
51 using content::DownloadUrlParameters; 51 using content::DownloadUrlParameters;
52 52
53 namespace { 53 namespace {
54 54
55 using extensions::Extension;
56
57 // Key used to attach the Approval to the DownloadItem. 55 // Key used to attach the Approval to the DownloadItem.
58 const char kApprovalKey[] = "extensions.webstore_installer"; 56 const char kApprovalKey[] = "extensions.webstore_installer";
59 57
60 const char kInvalidIdError[] = "Invalid id"; 58 const char kInvalidIdError[] = "Invalid id";
61 const char kNoBrowserError[] = "No browser found"; 59 const char kNoBrowserError[] = "No browser found";
62 const char kDownloadDirectoryError[] = "Could not create download directory"; 60 const char kDownloadDirectoryError[] = "Could not create download directory";
63 const char kDownloadCanceledError[] = "Download canceled"; 61 const char kDownloadCanceledError[] = "Download canceled";
64 const char kInstallCanceledError[] = "Install canceled"; 62 const char kInstallCanceledError[] = "Install canceled";
65 const char kDownloadInterruptedError[] = "Download interrupted"; 63 const char kDownloadInterruptedError[] = "Download interrupted";
66 const char kInvalidDownloadError[] = "Download was not a CRX"; 64 const char kInvalidDownloadError[] = "Download was not a CRX";
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 int uniquifier = file_util::GetUniquePathNumber(file, FILE_PATH_LITERAL("")); 126 int uniquifier = file_util::GetUniquePathNumber(file, FILE_PATH_LITERAL(""));
129 if (uniquifier > 0) 127 if (uniquifier > 0)
130 file = file.InsertBeforeExtensionASCII(StringPrintf(" (%d)", uniquifier)); 128 file = file.InsertBeforeExtensionASCII(StringPrintf(" (%d)", uniquifier));
131 129
132 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 130 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
133 base::Bind(callback, file)); 131 base::Bind(callback, file));
134 } 132 }
135 133
136 } // namespace 134 } // namespace
137 135
136 namespace extensions {
137
138 WebstoreInstaller::Approval::Approval() 138 WebstoreInstaller::Approval::Approval()
139 : profile(NULL), 139 : profile(NULL),
140 use_app_installed_bubble(false), 140 use_app_installed_bubble(false),
141 skip_post_install_ui(false), 141 skip_post_install_ui(false),
142 skip_install_dialog(false), 142 skip_install_dialog(false),
143 record_oauth2_grant(false) { 143 record_oauth2_grant(false) {
144 } 144 }
145 145
146 scoped_ptr<WebstoreInstaller::Approval> 146 scoped_ptr<WebstoreInstaller::Approval>
147 WebstoreInstaller::Approval::CreateWithInstallPrompt(Profile* profile) { 147 WebstoreInstaller::Approval::CreateWithInstallPrompt(Profile* profile) {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 } 351 }
352 352
353 void WebstoreInstaller::ReportSuccess() { 353 void WebstoreInstaller::ReportSuccess() {
354 if (delegate_) { 354 if (delegate_) {
355 delegate_->OnExtensionInstallSuccess(id_); 355 delegate_->OnExtensionInstallSuccess(id_);
356 delegate_ = NULL; 356 delegate_ = NULL;
357 } 357 }
358 358
359 Release(); // Balanced in Start(). 359 Release(); // Balanced in Start().
360 } 360 }
361
362 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/webstore_installer.h ('k') | chrome/browser/ui/intents/web_intent_picker_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698