forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ExtensionsBrowserClient and AppSorting to app_shell
This lets it run a little further when attempting to run an app. BUG=None TEST=None Review URL: https://codereview.chromium.org/106033002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239311 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
jamescook@chromium.org
committed
Dec 7, 2013
1 parent
7eb7dc4
commit da762a8
Showing
13 changed files
with
363 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "apps/shell/app_shell_app_sorting.h" | ||
|
||
#include "sync/api/string_ordinal.h" | ||
|
||
namespace { | ||
|
||
// Ordinals for a single app on a single page. | ||
const char kFirstApp[] = "a"; | ||
const char kNextApp[] = "b"; | ||
const char kFirstPage[] = "a"; | ||
|
||
} // namespace | ||
|
||
namespace apps { | ||
|
||
AppShellAppSorting::AppShellAppSorting() { | ||
} | ||
|
||
AppShellAppSorting::~AppShellAppSorting() { | ||
} | ||
|
||
void AppShellAppSorting::SetExtensionScopedPrefs( | ||
extensions::ExtensionScopedPrefs* prefs) { | ||
} | ||
|
||
void AppShellAppSorting::SetExtensionSyncService( | ||
ExtensionSyncService* extension_sync_service) { | ||
} | ||
|
||
void AppShellAppSorting::Initialize( | ||
const extensions::ExtensionIdList& extension_ids) { | ||
} | ||
|
||
void AppShellAppSorting::FixNTPOrdinalCollisions() { | ||
} | ||
|
||
void AppShellAppSorting::EnsureValidOrdinals( | ||
const std::string& extension_id, | ||
const syncer::StringOrdinal& suggested_page) { | ||
} | ||
|
||
void AppShellAppSorting::OnExtensionMoved( | ||
const std::string& moved_extension_id, | ||
const std::string& predecessor_extension_id, | ||
const std::string& successor_extension_id) { | ||
} | ||
|
||
syncer::StringOrdinal AppShellAppSorting::GetAppLaunchOrdinal( | ||
const std::string& extension_id) const { | ||
return syncer::StringOrdinal(kFirstApp); | ||
} | ||
|
||
void AppShellAppSorting::SetAppLaunchOrdinal( | ||
const std::string& extension_id, | ||
const syncer::StringOrdinal& new_app_launch_ordinal) { | ||
} | ||
|
||
syncer::StringOrdinal AppShellAppSorting::CreateFirstAppLaunchOrdinal( | ||
const syncer::StringOrdinal& page_ordinal) const { | ||
return syncer::StringOrdinal(kFirstApp); | ||
} | ||
|
||
syncer::StringOrdinal AppShellAppSorting::CreateNextAppLaunchOrdinal( | ||
const syncer::StringOrdinal& page_ordinal) const { | ||
return syncer::StringOrdinal(kNextApp); | ||
} | ||
|
||
syncer::StringOrdinal AppShellAppSorting::CreateFirstAppPageOrdinal() const { | ||
return syncer::StringOrdinal(kFirstPage); | ||
} | ||
|
||
syncer::StringOrdinal AppShellAppSorting::GetNaturalAppPageOrdinal() const { | ||
return syncer::StringOrdinal(kFirstPage); | ||
} | ||
|
||
syncer::StringOrdinal AppShellAppSorting::GetPageOrdinal( | ||
const std::string& extension_id) const { | ||
return syncer::StringOrdinal(kFirstPage); | ||
} | ||
|
||
void AppShellAppSorting::SetPageOrdinal( | ||
const std::string& extension_id, | ||
const syncer::StringOrdinal& new_page_ordinal) { | ||
} | ||
|
||
void AppShellAppSorting::ClearOrdinals(const std::string& extension_id) { | ||
} | ||
|
||
int AppShellAppSorting::PageStringOrdinalAsInteger( | ||
const syncer::StringOrdinal& page_ordinal) const { | ||
return 0; | ||
} | ||
|
||
syncer::StringOrdinal AppShellAppSorting::PageIntegerAsStringOrdinal( | ||
size_t page_index) { | ||
return syncer::StringOrdinal(kFirstPage); | ||
} | ||
|
||
void AppShellAppSorting::MarkExtensionAsHidden( | ||
const std::string& extension_id) { | ||
} | ||
|
||
} // namespace apps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright 2013 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef APPS_SHELL_APP_SHELL_APP_SORTING_H_ | ||
#define APPS_SHELL_APP_SHELL_APP_SORTING_H_ | ||
|
||
#include "base/compiler_specific.h" | ||
#include "extensions/browser/app_sorting.h" | ||
|
||
namespace apps { | ||
|
||
// A stub AppSorting. Since app_shell only runs a single app we don't need to | ||
// sort them. | ||
class AppShellAppSorting : public extensions::AppSorting { | ||
public: | ||
AppShellAppSorting(); | ||
virtual ~AppShellAppSorting(); | ||
|
||
// extensions::AppSorting overrides: | ||
virtual void SetExtensionScopedPrefs(extensions::ExtensionScopedPrefs* prefs) | ||
OVERRIDE; | ||
virtual void SetExtensionSyncService( | ||
ExtensionSyncService* extension_sync_service) OVERRIDE; | ||
virtual void Initialize( | ||
const extensions::ExtensionIdList& extension_ids) OVERRIDE; | ||
virtual void FixNTPOrdinalCollisions() OVERRIDE; | ||
virtual void EnsureValidOrdinals( | ||
const std::string& extension_id, | ||
const syncer::StringOrdinal& suggested_page) OVERRIDE; | ||
virtual void OnExtensionMoved( | ||
const std::string& moved_extension_id, | ||
const std::string& predecessor_extension_id, | ||
const std::string& successor_extension_id) OVERRIDE; | ||
virtual syncer::StringOrdinal GetAppLaunchOrdinal( | ||
const std::string& extension_id) const OVERRIDE; | ||
virtual void SetAppLaunchOrdinal( | ||
const std::string& extension_id, | ||
const syncer::StringOrdinal& new_app_launch_ordinal) OVERRIDE; | ||
virtual syncer::StringOrdinal CreateFirstAppLaunchOrdinal( | ||
const syncer::StringOrdinal& page_ordinal) const OVERRIDE; | ||
virtual syncer::StringOrdinal CreateNextAppLaunchOrdinal( | ||
const syncer::StringOrdinal& page_ordinal) const OVERRIDE; | ||
virtual syncer::StringOrdinal CreateFirstAppPageOrdinal() const OVERRIDE; | ||
virtual syncer::StringOrdinal GetNaturalAppPageOrdinal() const OVERRIDE; | ||
virtual syncer::StringOrdinal GetPageOrdinal( | ||
const std::string& extension_id) const OVERRIDE; | ||
virtual void SetPageOrdinal( | ||
const std::string& extension_id, | ||
const syncer::StringOrdinal& new_page_ordinal) OVERRIDE; | ||
virtual void ClearOrdinals(const std::string& extension_id) OVERRIDE; | ||
virtual int PageStringOrdinalAsInteger( | ||
const syncer::StringOrdinal& page_ordinal) const OVERRIDE; | ||
virtual syncer::StringOrdinal PageIntegerAsStringOrdinal( | ||
size_t page_index) OVERRIDE; | ||
virtual void MarkExtensionAsHidden(const std::string& extension_id) OVERRIDE; | ||
|
||
private: | ||
DISALLOW_COPY_AND_ASSIGN(AppShellAppSorting); | ||
}; | ||
|
||
} // namespace apps | ||
|
||
#endif // APPS_SHELL_APP_SHELL_APP_SORTING_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.