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

Side by Side Diff: chrome/browser/chromeos/extensions/file_manager_util.cc

Issue 10388252: Refactoring ExtenionInstallUI to abstract the Browser references. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced + mac fix Created 8 years, 6 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) 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 #include "chrome/browser/chromeos/extensions/file_manager_util.h" 4 #include "chrome/browser/chromeos/extensions/file_manager_util.h"
5 5
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/path_service.h" 12 #include "base/path_service.h"
13 #include "base/string_util.h" 13 #include "base/string_util.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/chromeos/extensions/file_handler_util.h" 16 #include "chrome/browser/chromeos/extensions/file_handler_util.h"
17 #include "chrome/browser/chromeos/gdata/gdata.pb.h" 17 #include "chrome/browser/chromeos/gdata/gdata.pb.h"
18 #include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" 18 #include "chrome/browser/chromeos/gdata/gdata_operation_registry.h"
19 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" 19 #include "chrome/browser/chromeos/gdata/gdata_system_service.h"
20 #include "chrome/browser/chromeos/gdata/gdata_util.h" 20 #include "chrome/browser/chromeos/gdata/gdata_util.h"
21 #include "chrome/browser/chromeos/media/media_player.h" 21 #include "chrome/browser/chromeos/media/media_player.h"
22 #include "chrome/browser/extensions/crx_installer.h" 22 #include "chrome/browser/extensions/crx_installer.h"
23 #include "chrome/browser/extensions/extension_install_ui.h" 23 #include "chrome/browser/extensions/extension_install_prompt.h"
24 #include "chrome/browser/extensions/extension_service.h" 24 #include "chrome/browser/extensions/extension_service.h"
25 #include "chrome/browser/plugin_prefs.h" 25 #include "chrome/browser/plugin_prefs.h"
26 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/browser/profiles/profile_manager.h" 27 #include "chrome/browser/profiles/profile_manager.h"
28 #include "chrome/browser/ui/browser.h" 28 #include "chrome/browser/ui/browser.h"
29 #include "chrome/browser/ui/browser_finder.h" 29 #include "chrome/browser/ui/browser_finder.h"
30 #include "chrome/browser/ui/browser_window.h" 30 #include "chrome/browser/ui/browser_window.h"
31 #include "chrome/browser/ui/extensions/application_launch.h" 31 #include "chrome/browser/ui/extensions/application_launch.h"
32 #include "chrome/browser/ui/simple_message_box.h" 32 #include "chrome/browser/ui/simple_message_box.h"
33 #include "chrome/browser/ui/tab_contents/tab_contents.h" 33 #include "chrome/browser/ui/tab_contents/tab_contents.h"
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 arraysize(kUMATrackingExtensions) - 1); 682 arraysize(kUMATrackingExtensions) - 1);
683 return false; 683 return false;
684 } 684 }
685 685
686 void InstallCRX(Profile* profile, const FilePath& path) { 686 void InstallCRX(Profile* profile, const FilePath& path) {
687 ExtensionService* service = profile->GetExtensionService(); 687 ExtensionService* service = profile->GetExtensionService();
688 CHECK(service); 688 CHECK(service);
689 if (!service) 689 if (!service)
690 return; 690 return;
691 691
692 scoped_refptr<CrxInstaller> installer(CrxInstaller::Create(service, 692 scoped_refptr<CrxInstaller> installer(
693 new ExtensionInstallUI(profile))); 693 CrxInstaller::Create(service, new ExtensionInstallPrompt(profile)));
694 installer->set_is_gallery_install(false); 694 installer->set_is_gallery_install(false);
695 installer->set_allow_silent_install(false); 695 installer->set_allow_silent_install(false);
696 installer->InstallCrx(path); 696 installer->InstallCrx(path);
697 } 697 }
698 698
699 // If pdf plugin is enabled, we should open pdf files in a tab. 699 // If pdf plugin is enabled, we should open pdf files in a tab.
700 bool ShouldBeOpenedWithPdfPlugin(Profile* profile, const char* file_extension) { 700 bool ShouldBeOpenedWithPdfPlugin(Profile* profile, const char* file_extension) {
701 if (base::strcasecmp(file_extension, kPdfExtension) != 0) 701 if (base::strcasecmp(file_extension, kPdfExtension) != 0)
702 return false; 702 return false;
703 703
(...skipping 19 matching lines...) Expand all
723 GDataOperationRegistry::ProgressStatus>::const_iterator iter = 723 GDataOperationRegistry::ProgressStatus>::const_iterator iter =
724 list.begin(); 724 list.begin();
725 iter != list.end(); ++iter) { 725 iter != list.end(); ++iter) {
726 result_list->Append( 726 result_list->Append(
727 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); 727 ProgessStatusToDictionaryValue(profile, origin_url, *iter));
728 } 728 }
729 return result_list.release(); 729 return result_list.release();
730 } 730 }
731 731
732 } // namespace file_manager_util 732 } // namespace file_manager_util
OLDNEW
« no previous file with comments | « chrome/browser/automation/testing_automation_provider.cc ('k') | chrome/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698