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

Unified Diff: chrome/browser/ui/cocoa/app_list/app_list_controller_cocoa.mm

Issue 12207104: Refactor app_list_util.h into AppListService abstract base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix some obvious dumbs Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/app_list/app_list_controller_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/app_list/app_list_controller_cocoa.mm b/chrome/browser/ui/cocoa/app_list/app_list_controller_cocoa.mm
index 3580de6ee685fb2e675a29ea5898bf937d063986..a56a6c2367bee6244fb45f9d7235043170e6a883 100644
--- a/chrome/browser/ui/cocoa/app_list/app_list_controller_cocoa.mm
+++ b/chrome/browser/ui/cocoa/app_list/app_list_controller_cocoa.mm
@@ -8,7 +8,7 @@
#include "base/message_loop.h"
#include "base/time.h"
#include "base/timer.h"
-#include "chrome/browser/ui/app_list/app_list_util.h"
+#include "chrome/browser/ui/app_list_service.h"
#include "ui/app_list/cocoa/app_list_view.h"
#include "ui/app_list/cocoa/app_list_view_window.h"
@@ -20,25 +20,28 @@ namespace {
// The AppListController class manages global resources needed for the app
// list to operate, and controls when the app list is opened and closed.
-class AppListController {
+class AppListControllerCocoa : public AppListService {
tapted 2013/02/11 04:04:20 should perhaps be in its own header, and use Singl
tapted 2013/02/19 03:15:32 Done.
public:
- AppListController() {}
- ~AppListController() {}
+ AppListControllerCocoa() {}
+ ~AppListControllerCocoa() {}
void CreateAppList();
- void ShowAppList();
- void DismissAppList();
+
+ // AppListService overrides:
+ virtual void ShowAppList(Profile* profile) OVERRIDE;
+ virtual void DismissAppList() OVERRIDE;
+
private:
scoped_nsobject<AppListViewWindow> current_window_;
- base::OneShotTimer<AppListController> timer_;
+ base::OneShotTimer<AppListControllerCocoa> timer_;
- DISALLOW_COPY_AND_ASSIGN(AppListController);
+ DISALLOW_COPY_AND_ASSIGN(AppListControllerCocoa);
};
-base::LazyInstance<AppListController>::Leaky g_app_list_controller =
+base::LazyInstance<AppListControllerCocoa>::Leaky g_app_list_controller =
LAZY_INSTANCE_INITIALIZER;
-void AppListController::CreateAppList() {
+void AppListControllerCocoa::CreateAppList() {
current_window_.reset([[AppListViewWindow alloc] initAsBubble]);
scoped_nsobject<AppListView> contentView(
[[AppListView alloc] initWithViewDelegate:NULL]);
@@ -46,7 +49,7 @@ void AppListController::CreateAppList() {
[current_window_ setAppListView:contentView];
}
-void AppListController::ShowAppList() {
+void AppListControllerCocoa::ShowAppList(Profile* profile) {
const int kLifetimeIntervalMS = 1000;
if (!current_window_)
@@ -54,11 +57,11 @@ void AppListController::ShowAppList() {
timer_.Start(FROM_HERE,
base::TimeDelta::FromMilliseconds(kLifetimeIntervalMS), this,
- &AppListController::DismissAppList);
+ &AppListControllerCocoa::DismissAppList);
[current_window_ makeKeyAndOrderFront:nil];
}
-void AppListController::DismissAppList() {
+void AppListControllerCocoa::DismissAppList() {
if (!current_window_)
return;
@@ -68,29 +71,6 @@ void AppListController::DismissAppList() {
} // namespace
-
-namespace chrome {
-
-void InitAppList(Profile* profile) {
- // TODO(tapted): AppList warmup code coes here.
-}
-
-void ShowAppList(Profile* profile) {
- // Create the App list.
- g_app_list_controller.Get().ShowAppList();
+AppListService* AppListService::Get() {
+ return &g_app_list_controller.Get();
}
-
-void NotifyAppListOfBeginExtensionInstall(
- Profile* profile,
- const std::string& extension_id,
- const std::string& extension_name,
- const gfx::ImageSkia& installing_icon) {
-}
-
-void NotifyAppListOfDownloadProgress(
- Profile* profile,
- const std::string& extension_id,
- int percent_downloaded) {
-}
-
-} // namespace chrome

Powered by Google App Engine
This is Rietveld 408576698