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

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

Issue 1878153002: Revert of Simplify BrowserContext by removing redundant methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/external_install_error.h" 5 #include "chrome/browser/extensions/external_install_error.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/metrics/histogram_macros.h" 13 #include "base/metrics/histogram_macros.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "chrome/app/chrome_command_ids.h" 15 #include "chrome/app/chrome_command_ids.h"
16 #include "chrome/browser/extensions/extension_install_error_menu_item_id_provide r.h" 16 #include "chrome/browser/extensions/extension_install_error_menu_item_id_provide r.h"
17 #include "chrome/browser/extensions/extension_install_prompt_show_params.h" 17 #include "chrome/browser/extensions/extension_install_prompt_show_params.h"
18 #include "chrome/browser/extensions/extension_service.h" 18 #include "chrome/browser/extensions/extension_service.h"
19 #include "chrome/browser/extensions/external_install_manager.h" 19 #include "chrome/browser/extensions/external_install_manager.h"
20 #include "chrome/browser/extensions/webstore_data_fetcher.h" 20 #include "chrome/browser/extensions/webstore_data_fetcher.h"
21 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_finder.h" 23 #include "chrome/browser/ui/browser_finder.h"
24 #include "chrome/browser/ui/global_error/global_error.h" 24 #include "chrome/browser/ui/global_error/global_error.h"
25 #include "chrome/browser/ui/global_error/global_error_service.h" 25 #include "chrome/browser/ui/global_error/global_error_service.h"
26 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 26 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
27 #include "chrome/browser/ui/tabs/tab_strip_model.h" 27 #include "chrome/browser/ui/tabs/tab_strip_model.h"
28 #include "chrome/grit/generated_resources.h" 28 #include "chrome/grit/generated_resources.h"
29 #include "content/public/browser/storage_partition.h"
30 #include "extensions/browser/extension_registry.h" 29 #include "extensions/browser/extension_registry.h"
31 #include "extensions/browser/extension_system.h" 30 #include "extensions/browser/extension_system.h"
32 #include "extensions/browser/uninstall_reason.h" 31 #include "extensions/browser/uninstall_reason.h"
33 #include "extensions/common/constants.h" 32 #include "extensions/common/constants.h"
34 #include "extensions/common/extension.h" 33 #include "extensions/common/extension.h"
35 #include "ui/base/l10n/l10n_util.h" 34 #include "ui/base/l10n/l10n_util.h"
36 #include "ui/gfx/image/image.h" 35 #include "ui/gfx/image/image.h"
37 #include "ui/gfx/image/image_skia.h" 36 #include "ui/gfx/image/image_skia.h"
38 #include "ui/gfx/image/image_skia_operations.h" 37 #include "ui/gfx/image/image_skia_operations.h"
39 38
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 extension_id_(extension_id), 294 extension_id_(extension_id),
296 alert_type_(alert_type), 295 alert_type_(alert_type),
297 manager_(manager), 296 manager_(manager),
298 error_service_(GlobalErrorServiceFactory::GetForProfile( 297 error_service_(GlobalErrorServiceFactory::GetForProfile(
299 Profile::FromBrowserContext(browser_context_))), 298 Profile::FromBrowserContext(browser_context_))),
300 weak_factory_(this) { 299 weak_factory_(this) {
301 prompt_.reset(new ExtensionInstallPrompt::Prompt( 300 prompt_.reset(new ExtensionInstallPrompt::Prompt(
302 ExtensionInstallPrompt::EXTERNAL_INSTALL_PROMPT)); 301 ExtensionInstallPrompt::EXTERNAL_INSTALL_PROMPT));
303 302
304 webstore_data_fetcher_.reset(new WebstoreDataFetcher( 303 webstore_data_fetcher_.reset(new WebstoreDataFetcher(
305 this, 304 this, browser_context_->GetRequestContext(), GURL(), extension_id_));
306 content::BrowserContext::GetDefaultStoragePartition(browser_context_)->
307 GetURLRequestContext(),
308 GURL(), extension_id_));
309 webstore_data_fetcher_->Start(); 305 webstore_data_fetcher_->Start();
310 } 306 }
311 307
312 ExternalInstallError::~ExternalInstallError() { 308 ExternalInstallError::~ExternalInstallError() {
313 if (global_error_.get()) 309 if (global_error_.get())
314 error_service_->RemoveGlobalError(global_error_.get()); 310 error_service_->RemoveGlobalError(global_error_.get());
315 } 311 }
316 312
317 void ExternalInstallError::OnInstallPromptDone( 313 void ExternalInstallError::OnInstallPromptDone(
318 ExtensionInstallPrompt::Result result) { 314 ExtensionInstallPrompt::Result result) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 global_error_.reset(new ExternalInstallMenuAlert(this)); 451 global_error_.reset(new ExternalInstallMenuAlert(this));
456 error_service_->AddGlobalError(global_error_.get()); 452 error_service_->AddGlobalError(global_error_.get());
457 } 453 }
458 } 454 }
459 455
460 void ExternalInstallError::RemoveError() { 456 void ExternalInstallError::RemoveError() {
461 manager_->RemoveExternalInstallError(extension_id_); 457 manager_->RemoveExternalInstallError(extension_id_);
462 } 458 }
463 459
464 } // namespace extensions 460 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_reenabler.cc ('k') | chrome/browser/extensions/install_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698