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

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

Issue 1864583006: Simplify BrowserContext by removing redundant methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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"
29 #include "extensions/browser/extension_registry.h" 30 #include "extensions/browser/extension_registry.h"
30 #include "extensions/browser/extension_system.h" 31 #include "extensions/browser/extension_system.h"
31 #include "extensions/browser/uninstall_reason.h" 32 #include "extensions/browser/uninstall_reason.h"
32 #include "extensions/common/constants.h" 33 #include "extensions/common/constants.h"
33 #include "extensions/common/extension.h" 34 #include "extensions/common/extension.h"
34 #include "ui/base/l10n/l10n_util.h" 35 #include "ui/base/l10n/l10n_util.h"
35 #include "ui/gfx/image/image.h" 36 #include "ui/gfx/image/image.h"
36 #include "ui/gfx/image/image_skia.h" 37 #include "ui/gfx/image/image_skia.h"
37 #include "ui/gfx/image/image_skia_operations.h" 38 #include "ui/gfx/image/image_skia_operations.h"
38 39
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 extension_id_(extension_id), 295 extension_id_(extension_id),
295 alert_type_(alert_type), 296 alert_type_(alert_type),
296 manager_(manager), 297 manager_(manager),
297 error_service_(GlobalErrorServiceFactory::GetForProfile( 298 error_service_(GlobalErrorServiceFactory::GetForProfile(
298 Profile::FromBrowserContext(browser_context_))), 299 Profile::FromBrowserContext(browser_context_))),
299 weak_factory_(this) { 300 weak_factory_(this) {
300 prompt_.reset(new ExtensionInstallPrompt::Prompt( 301 prompt_.reset(new ExtensionInstallPrompt::Prompt(
301 ExtensionInstallPrompt::EXTERNAL_INSTALL_PROMPT)); 302 ExtensionInstallPrompt::EXTERNAL_INSTALL_PROMPT));
302 303
303 webstore_data_fetcher_.reset(new WebstoreDataFetcher( 304 webstore_data_fetcher_.reset(new WebstoreDataFetcher(
304 this, browser_context_->GetRequestContext(), GURL(), extension_id_)); 305 this,
306 content::BrowserContext::GetDefaultStoragePartition(browser_context_)->
307 GetURLRequestContext(),
308 GURL(), extension_id_));
305 webstore_data_fetcher_->Start(); 309 webstore_data_fetcher_->Start();
306 } 310 }
307 311
308 ExternalInstallError::~ExternalInstallError() { 312 ExternalInstallError::~ExternalInstallError() {
309 if (global_error_.get()) 313 if (global_error_.get())
310 error_service_->RemoveGlobalError(global_error_.get()); 314 error_service_->RemoveGlobalError(global_error_.get());
311 } 315 }
312 316
313 void ExternalInstallError::OnInstallPromptDone( 317 void ExternalInstallError::OnInstallPromptDone(
314 ExtensionInstallPrompt::Result result) { 318 ExtensionInstallPrompt::Result result) {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 global_error_.reset(new ExternalInstallMenuAlert(this)); 455 global_error_.reset(new ExternalInstallMenuAlert(this));
452 error_service_->AddGlobalError(global_error_.get()); 456 error_service_->AddGlobalError(global_error_.get());
453 } 457 }
454 } 458 }
455 459
456 void ExternalInstallError::RemoveError() { 460 void ExternalInstallError::RemoveError() {
457 manager_->RemoveExternalInstallError(extension_id_); 461 manager_->RemoveExternalInstallError(extension_id_);
458 } 462 }
459 463
460 } // namespace extensions 464 } // 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