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

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

Issue 8983010: Convert WebContents to return a content::NavigationController instead of the implementation. Upda... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 11 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/utf_string_conversions.h" 12 #include "base/utf_string_conversions.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/download/download_util.h" 14 #include "chrome/browser/download/download_util.h"
15 #include "chrome/browser/extensions/crx_installer.h" 15 #include "chrome/browser/extensions/crx_installer.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/tabs/tab_strip_model.h" 17 #include "chrome/browser/tabs/tab_strip_model.h"
18 #include "chrome/browser/ui/browser_list.h" 18 #include "chrome/browser/ui/browser_list.h"
19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
20 #include "chrome/common/chrome_notification_types.h" 20 #include "chrome/common/chrome_notification_types.h"
21 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
22 #include "chrome/common/extensions/extension.h" 22 #include "chrome/common/extensions/extension.h"
23 #include "chrome/common/extensions/extension_constants.h" 23 #include "chrome/common/extensions/extension_constants.h"
24 #include "content/browser/download/download_types.h" 24 #include "content/browser/download/download_types.h"
25 #include "content/browser/tab_contents/navigation_controller.h"
26 #include "content/public/browser/browser_thread.h" 25 #include "content/public/browser/browser_thread.h"
27 #include "content/public/browser/download_file.h" 26 #include "content/public/browser/download_file.h"
28 #include "content/public/browser/download_manager.h" 27 #include "content/public/browser/download_manager.h"
28 #include "content/public/browser/navigation_controller.h"
29 #include "content/public/browser/navigation_entry.h" 29 #include "content/public/browser/navigation_entry.h"
30 #include "content/public/browser/notification_details.h" 30 #include "content/public/browser/notification_details.h"
31 #include "content/public/browser/notification_source.h" 31 #include "content/public/browser/notification_source.h"
32 #include "googleurl/src/gurl.h" 32 #include "googleurl/src/gurl.h"
33 #include "net/base/escape.h" 33 #include "net/base/escape.h"
34 34
35 using content::BrowserThread; 35 using content::BrowserThread;
36 using content::DownloadFile; 36 using content::DownloadFile;
37 37
38 namespace { 38 namespace {
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 98 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
99 base::Bind(callback, file)); 99 base::Bind(callback, file));
100 } 100 }
101 101
102 } // namespace 102 } // namespace
103 103
104 104
105 WebstoreInstaller::WebstoreInstaller(Profile* profile, 105 WebstoreInstaller::WebstoreInstaller(Profile* profile,
106 Delegate* delegate, 106 Delegate* delegate,
107 NavigationController* controller, 107 content::NavigationController* controller,
108 const std::string& id, 108 const std::string& id,
109 int flags) 109 int flags)
110 : profile_(profile), 110 : profile_(profile),
111 delegate_(delegate), 111 delegate_(delegate),
112 controller_(controller), 112 controller_(controller),
113 id_(id), 113 id_(id),
114 flags_(flags) { 114 flags_(flags) {
115 download_url_ = GetWebstoreInstallURL(id, flags & FLAG_INLINE_INSTALL ? 115 download_url_ = GetWebstoreInstallURL(id, flags & FLAG_INLINE_INSTALL ?
116 kInlineInstallSource : kDefaultInstallSource); 116 kInlineInstallSource : kDefaultInstallSource);
117 117
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 Release(); // Balanced in Start(). 211 Release(); // Balanced in Start().
212 } 212 }
213 213
214 void WebstoreInstaller::ReportSuccess() { 214 void WebstoreInstaller::ReportSuccess() {
215 if (delegate_) 215 if (delegate_)
216 delegate_->OnExtensionInstallSuccess(id_); 216 delegate_->OnExtensionInstallSuccess(id_);
217 217
218 Release(); // Balanced in Start(). 218 Release(); // Balanced in Start().
219 } 219 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698