forked from chromium/chromium
-
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.
Move app_launcher.* out of chrome/browser/extensions and into apps/
This change also moves some UI code from chrome/browser/extensions into /chrome/browser/ui/, and cleans up the app_launcher.* code. BUG=159366 Review URL: https://chromiumcodereview.appspot.com/12095052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181875 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
benwells@chromium.org
committed
Feb 12, 2013
1 parent
b1c20f5
commit dc63aab
Showing
22 changed files
with
168 additions
and
94 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
28 changes: 16 additions & 12 deletions
28
chrome/browser/extensions/app_launcher.h → apps/app_launcher.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,38 @@ | ||
// Copyright (c) 2013 The Chromium Authors. All rights reserved. | ||
// 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 CHROME_BROWSER_EXTENSIONS_APP_LAUNCHER_H_ | ||
#define CHROME_BROWSER_EXTENSIONS_APP_LAUNCHER_H_ | ||
#ifndef CHROME_APPS_APP_LAUNCHER_H_ | ||
#define CHROME_APPS_APP_LAUNCHER_H_ | ||
|
||
#include "base/basictypes.h" | ||
#include "base/callback_forward.h" | ||
|
||
class PrefRegistrySimple; | ||
|
||
namespace extensions { | ||
namespace apps { | ||
|
||
// Called on the UI thread after determining if the launcher is enabled. A | ||
// boolean flag is passed, which is true if the app launcher is enabled. | ||
typedef base::Callback<void(bool)> OnAppLauncherEnabledCompleted; | ||
|
||
// A synchronous check to determine if the app launcher is enabled. If the | ||
// registry needs to be determined to find an accurate answer, this function | ||
// will NOT do so; instead if will default to false (the app launcher is not | ||
// enabled). | ||
// This function does not use the cached preference of whether the launcher | ||
// was enabled or not. | ||
bool MaybeIsAppLauncherEnabled(); | ||
|
||
// Determine whether the app launcher is enabled or not. This may involve a trip | ||
// to a blocking thread. |completion_callback| is called when an answer is | ||
// ready. This needs to be called on the UI thread. | ||
void UpdateIsAppLauncherEnabled( | ||
void GetIsAppLauncherEnabled( | ||
const OnAppLauncherEnabledCompleted& completion_callback); | ||
|
||
// returns value of pref. 'was app launcher enabled last time i checked'. | ||
bool IsAppLauncherEnabled(); | ||
|
||
namespace app_launcher { | ||
void RegisterPrefs(PrefRegistrySimple* registry); | ||
} | ||
// Returns whether the app launcher was enabled the last time it was checked. | ||
bool WasAppLauncherEnabled(); | ||
|
||
} // namespace extensions | ||
|
||
#endif // CHROME_BROWSER_EXTENSIONS_APP_LAUNCHER_H_ | ||
#endif // CHROME_APPS_APP_LAUNCHER_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// 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/pref_names.h" | ||
|
||
namespace apps { | ||
|
||
namespace prefs { | ||
|
||
// Local state caching knowledge of whether the app launcher is installed. | ||
const char kAppLauncherIsEnabled[] = | ||
"apps.app_launcher.should_show_apps_page"; | ||
|
||
} // namespace prefs | ||
|
||
} // 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,18 @@ | ||
// 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_PREF_NAMES_H_ | ||
#define APPS_PREF_NAMES_H_ | ||
|
||
namespace apps { | ||
|
||
namespace prefs { | ||
|
||
extern const char kAppLauncherIsEnabled[]; | ||
|
||
} // namespace prefs | ||
|
||
} // namespace apps | ||
|
||
#endif // APPS_PREF_NAMES_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// 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/prefs.h" | ||
|
||
#include "apps/app_launcher.h" | ||
#include "apps/pref_names.h" | ||
#include "base/prefs/pref_registry_simple.h" | ||
|
||
namespace apps { | ||
|
||
void RegisterPrefs(PrefRegistrySimple* registry) { | ||
// This pref is a cache of the value from the registry the last time it was | ||
// checked. | ||
// | ||
// During the pref initialization, if it is impossible to synchronously | ||
// determine whether the app launcher is enabled, assume it is disabled. | ||
// Anything that needs to know the absolute truth should call | ||
// GetIsAppLauncherEnabled(). | ||
registry->RegisterBooleanPref(prefs::kAppLauncherIsEnabled, | ||
MaybeIsAppLauncherEnabled()); | ||
} | ||
|
||
} // 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,17 @@ | ||
// 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_PREFS_H_ | ||
#define APPS_PREFS_H_ | ||
|
||
class PrefRegistrySimple; | ||
|
||
namespace apps { | ||
|
||
// Register preferences for the apps system. | ||
void RegisterPrefs(PrefRegistrySimple* registry); | ||
|
||
} // namespace apps | ||
|
||
#endif // APPS_PREFS_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include_rules = [ | ||
"+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
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.