Commit b2e07038 authored by michaelpg's avatar michaelpg Committed by Commit bot

Move CustomLauncherPageContents from apps to c/b/ui/app_list

This is the most Chrome-dependent part of //apps, and is only used for the app
list in Chrome, so why not move it to chrome/browser/ui/app_list?

This enables us to make the rest of the //apps code independent of Chrome so it
can be used for app_shell.

Alternatively, we could make custom_launcher_page_contents.cc not depend on
Chrome (it's mostly for extensions::ChromeExtensionWebContentsObserver), but
that's probably better off being lumped into a larger task to move app_list out
of chrome if that should become a goal.

BUG=679971
R=benwells@chromium.org

Review-Url: https://codereview.chromium.org/2628883002
Cr-Commit-Position: refs/heads/master@{#443286}
parent e424e1f9
...@@ -27,8 +27,6 @@ static_library("apps") { ...@@ -27,8 +27,6 @@ static_library("apps") {
"app_restore_service_factory.h", "app_restore_service_factory.h",
"browser_context_keyed_service_factories.cc", "browser_context_keyed_service_factories.cc",
"browser_context_keyed_service_factories.h", "browser_context_keyed_service_factories.h",
"custom_launcher_page_contents.cc",
"custom_launcher_page_contents.h",
"launcher.cc", "launcher.cc",
"launcher.h", "launcher.h",
"metrics_names.h", "metrics_names.h",
......
...@@ -3162,6 +3162,8 @@ split_static_library("ui") { ...@@ -3162,6 +3162,8 @@ split_static_library("ui") {
"app_list/app_list_view_delegate.h", "app_list/app_list_view_delegate.h",
"app_list/chrome_app_list_item.cc", "app_list/chrome_app_list_item.cc",
"app_list/chrome_app_list_item.h", "app_list/chrome_app_list_item.h",
"app_list/custom_launcher_page_contents.cc",
"app_list/custom_launcher_page_contents.h",
"app_list/extension_app_context_menu.cc", "app_list/extension_app_context_menu.cc",
"app_list/extension_app_context_menu.h", "app_list/extension_app_context_menu.h",
"app_list/extension_app_item.cc", "app_list/extension_app_item.cc",
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <vector> #include <vector>
#include "apps/custom_launcher_page_contents.h"
#include "base/callback.h" #include "base/callback.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
...@@ -29,6 +28,7 @@ ...@@ -29,6 +28,7 @@
#include "chrome/browser/ui/app_list/app_list_service.h" #include "chrome/browser/ui/app_list/app_list_service.h"
#include "chrome/browser/ui/app_list/app_list_syncable_service.h" #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
#include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
#include "chrome/browser/ui/app_list/custom_launcher_page_contents.h"
#include "chrome/browser/ui/app_list/launcher_page_event_dispatcher.h" #include "chrome/browser/ui/app_list/launcher_page_event_dispatcher.h"
#include "chrome/browser/ui/app_list/search/search_controller_factory.h" #include "chrome/browser/ui/app_list/search/search_controller_factory.h"
#include "chrome/browser/ui/app_list/search/search_resource_manager.h" #include "chrome/browser/ui/app_list/search/search_resource_manager.h"
...@@ -316,7 +316,7 @@ void AppListViewDelegate::SetUpCustomLauncherPages() { ...@@ -316,7 +316,7 @@ void AppListViewDelegate::SetUpCustomLauncherPages() {
for (auto it = custom_launcher_page_urls.begin(); for (auto it = custom_launcher_page_urls.begin();
it != custom_launcher_page_urls.end(); ++it) { it != custom_launcher_page_urls.end(); ++it) {
std::string extension_id = it->host(); std::string extension_id = it->host();
auto page_contents = base::MakeUnique<apps::CustomLauncherPageContents>( auto page_contents = base::MakeUnique<app_list::CustomLauncherPageContents>(
base::MakeUnique<ChromeAppDelegate>(false), extension_id); base::MakeUnique<ChromeAppDelegate>(false), extension_id);
page_contents->Initialize(profile_, *it); page_contents->Initialize(profile_, *it);
custom_page_contents_.push_back(std::move(page_contents)); custom_page_contents_.push_back(std::move(page_contents));
......
...@@ -30,11 +30,8 @@ ...@@ -30,11 +30,8 @@
class AppListControllerDelegate; class AppListControllerDelegate;
class Profile; class Profile;
namespace apps {
class CustomLauncherPageContents;
}
namespace app_list { namespace app_list {
class CustomLauncherPageContents;
class LauncherPageEventDispatcher; class LauncherPageEventDispatcher;
class SearchController; class SearchController;
class SearchResourceManager; class SearchResourceManager;
...@@ -193,7 +190,7 @@ class AppListViewDelegate : public app_list::AppListViewDelegate, ...@@ -193,7 +190,7 @@ class AppListViewDelegate : public app_list::AppListViewDelegate,
ScopedObserver<SigninManagerBase, AppListViewDelegate> scoped_observer_; ScopedObserver<SigninManagerBase, AppListViewDelegate> scoped_observer_;
// Window contents of additional custom launcher pages. // Window contents of additional custom launcher pages.
std::vector<std::unique_ptr<apps::CustomLauncherPageContents>> std::vector<std::unique_ptr<app_list::CustomLauncherPageContents>>
custom_page_contents_; custom_page_contents_;
// Registers for NOTIFICATION_APP_TERMINATING to unload custom launcher pages. // Registers for NOTIFICATION_APP_TERMINATING to unload custom launcher pages.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "apps/custom_launcher_page_contents.h" #include "chrome/browser/ui/app_list/custom_launcher_page_contents.h"
#include <string> #include <string>
#include <utility> #include <utility>
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "extensions/browser/view_type_utils.h" #include "extensions/browser/view_type_utils.h"
#include "extensions/common/extension_messages.h" #include "extensions/common/extension_messages.h"
namespace apps { namespace app_list {
CustomLauncherPageContents::CustomLauncherPageContents( CustomLauncherPageContents::CustomLauncherPageContents(
std::unique_ptr<extensions::AppDelegate> app_delegate, std::unique_ptr<extensions::AppDelegate> app_delegate,
...@@ -131,4 +131,4 @@ bool CustomLauncherPageContents::CheckMediaAccessPermission( ...@@ -131,4 +131,4 @@ bool CustomLauncherPageContents::CheckMediaAccessPermission(
return helper_->CheckMediaAccessPermission(security_origin, type); return helper_->CheckMediaAccessPermission(security_origin, type);
} }
} // namespace apps } // namespace app_list
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef APPS_CUSTOM_LAUNCHER_PAGE_CONTENTS_H_ #ifndef CHROME_BROWSER_UI_APP_LIST_CUSTOM_LAUNCHER_PAGE_CONTENTS_H_
#define APPS_CUSTOM_LAUNCHER_PAGE_CONTENTS_H_ #define CHROME_BROWSER_UI_APP_LIST_CUSTOM_LAUNCHER_PAGE_CONTENTS_H_
#include <memory> #include <memory>
...@@ -20,7 +20,7 @@ class AppDelegate; ...@@ -20,7 +20,7 @@ class AppDelegate;
class AppWebContentsHelper; class AppWebContentsHelper;
} }
namespace apps { namespace app_list {
// Manages the web contents for extension-hosted launcher pages. The // Manages the web contents for extension-hosted launcher pages. The
// implementation for this class should create and maintain the WebContents for // implementation for this class should create and maintain the WebContents for
...@@ -79,6 +79,6 @@ class CustomLauncherPageContents : public content::WebContentsDelegate { ...@@ -79,6 +79,6 @@ class CustomLauncherPageContents : public content::WebContentsDelegate {
DISALLOW_COPY_AND_ASSIGN(CustomLauncherPageContents); DISALLOW_COPY_AND_ASSIGN(CustomLauncherPageContents);
}; };
} // namespace apps } // namespace app_list
#endif // APPS_CUSTOM_LAUNCHER_PAGE_CONTENTS_H_ #endif // CHROME_BROWSER_UI_APP_LIST_CUSTOM_LAUNCHER_PAGE_CONTENTS_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment