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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 494033002: Move AppWindow to extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 3 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 4
5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "apps/app_window.h"
9 #include "apps/app_window_registry.h"
10 #include "apps/saved_files_service.h" 8 #include "apps/saved_files_service.h"
11 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
12 #include "base/base64.h" 10 #include "base/base64.h"
13 #include "base/bind.h" 11 #include "base/bind.h"
14 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
15 #include "base/command_line.h" 13 #include "base/command_line.h"
16 #include "base/location.h" 14 #include "base/location.h"
17 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
18 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
19 #include "base/prefs/pref_service.h" 17 #include "base/prefs/pref_service.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include "components/pref_registry/pref_registry_syncable.h" 65 #include "components/pref_registry/pref_registry_syncable.h"
68 #include "content/public/browser/notification_service.h" 66 #include "content/public/browser/notification_service.h"
69 #include "content/public/browser/notification_source.h" 67 #include "content/public/browser/notification_source.h"
70 #include "content/public/browser/notification_types.h" 68 #include "content/public/browser/notification_types.h"
71 #include "content/public/browser/render_process_host.h" 69 #include "content/public/browser/render_process_host.h"
72 #include "content/public/browser/render_view_host.h" 70 #include "content/public/browser/render_view_host.h"
73 #include "content/public/browser/site_instance.h" 71 #include "content/public/browser/site_instance.h"
74 #include "content/public/browser/web_contents.h" 72 #include "content/public/browser/web_contents.h"
75 #include "content/public/browser/web_ui.h" 73 #include "content/public/browser/web_ui.h"
76 #include "content/public/browser/web_ui_data_source.h" 74 #include "content/public/browser/web_ui_data_source.h"
75 #include "extensions/browser/app_window/app_window.h"
76 #include "extensions/browser/app_window/app_window_registry.h"
77 #include "extensions/browser/blacklist_state.h" 77 #include "extensions/browser/blacklist_state.h"
78 #include "extensions/browser/extension_error.h" 78 #include "extensions/browser/extension_error.h"
79 #include "extensions/browser/extension_host.h" 79 #include "extensions/browser/extension_host.h"
80 #include "extensions/browser/extension_registry.h" 80 #include "extensions/browser/extension_registry.h"
81 #include "extensions/browser/extension_system.h" 81 #include "extensions/browser/extension_system.h"
82 #include "extensions/browser/lazy_background_task_queue.h" 82 #include "extensions/browser/lazy_background_task_queue.h"
83 #include "extensions/browser/management_policy.h" 83 #include "extensions/browser/management_policy.h"
84 #include "extensions/browser/pref_names.h" 84 #include "extensions/browser/pref_names.h"
85 #include "extensions/browser/uninstall_reason.h" 85 #include "extensions/browser/uninstall_reason.h"
86 #include "extensions/browser/view_type_utils.h" 86 #include "extensions/browser/view_type_utils.h"
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 host->GetRoutingID(), 1358 host->GetRoutingID(),
1359 process->GetBrowserContext()->IsOffTheRecord(), 1359 process->GetBrowserContext()->IsOffTheRecord(),
1360 is_background_page && has_generated_background_page)); 1360 is_background_page && has_generated_background_page));
1361 } 1361 }
1362 } 1362 }
1363 1363
1364 void ExtensionSettingsHandler::GetAppWindowPagesForExtensionProfile( 1364 void ExtensionSettingsHandler::GetAppWindowPagesForExtensionProfile(
1365 const Extension* extension, 1365 const Extension* extension,
1366 Profile* profile, 1366 Profile* profile,
1367 std::vector<ExtensionPage>* result) { 1367 std::vector<ExtensionPage>* result) {
1368 apps::AppWindowRegistry* registry = apps::AppWindowRegistry::Get(profile); 1368 AppWindowRegistry* registry = AppWindowRegistry::Get(profile);
1369 if (!registry) return; 1369 if (!registry) return;
1370 1370
1371 const apps::AppWindowRegistry::AppWindowList windows = 1371 const AppWindowRegistry::AppWindowList windows =
1372 registry->GetAppWindowsForApp(extension->id()); 1372 registry->GetAppWindowsForApp(extension->id());
1373 1373
1374 bool has_generated_background_page = 1374 bool has_generated_background_page =
1375 BackgroundInfo::HasGeneratedBackgroundPage(extension); 1375 BackgroundInfo::HasGeneratedBackgroundPage(extension);
1376 for (apps::AppWindowRegistry::const_iterator it = windows.begin(); 1376 for (AppWindowRegistry::const_iterator it = windows.begin();
1377 it != windows.end(); 1377 it != windows.end();
1378 ++it) { 1378 ++it) {
1379 WebContents* web_contents = (*it)->web_contents(); 1379 WebContents* web_contents = (*it)->web_contents();
1380 RenderViewHost* host = web_contents->GetRenderViewHost(); 1380 RenderViewHost* host = web_contents->GetRenderViewHost();
1381 content::RenderProcessHost* process = host->GetProcess(); 1381 content::RenderProcessHost* process = host->GetProcess();
1382 1382
1383 bool is_background_page = 1383 bool is_background_page =
1384 (web_contents->GetURL() == BackgroundInfo::GetBackgroundURL(extension)); 1384 (web_contents->GetURL() == BackgroundInfo::GetBackgroundURL(extension));
1385 result->push_back( 1385 result->push_back(
1386 ExtensionPage(web_contents->GetURL(), 1386 ExtensionPage(web_contents->GetURL(),
(...skipping 28 matching lines...) Expand all
1415 extension_service_->EnableExtension(extension_id); 1415 extension_service_->EnableExtension(extension_id);
1416 } else { 1416 } else {
1417 ExtensionErrorReporter::GetInstance()->ReportError( 1417 ExtensionErrorReporter::GetInstance()->ReportError(
1418 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1418 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1419 true); // Be noisy. 1419 true); // Be noisy.
1420 } 1420 }
1421 requirements_checker_.reset(); 1421 requirements_checker_.reset();
1422 } 1422 }
1423 1423
1424 } // namespace extensions 1424 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698