Commit ad8514c0 authored by mukai@chromium.org's avatar mukai@chromium.org

Load the calculator app by default

BUG=None
R=oshima@chromium.org
TEST=manually

Review URL: https://codereview.chromium.org/349493003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278673 0039d316-1c4b-4281-b951-d872f2087c98
parent 5abdd03c
...@@ -21,7 +21,12 @@ ...@@ -21,7 +21,12 @@
#include "ui/wm/core/visibility_controller.h" #include "ui/wm/core/visibility_controller.h"
namespace { namespace {
const std::string kAppSwitch = "app"; const char kAppSwitch[] = "app";
// We want to load the sample calculator app by default, for a while. Expecting
// to run athena_main at src/
const char kDefaultAppPath[] =
"chrome/common/extensions/docs/examples/apps/calculator/app";
} // namespace } // namespace
class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate {
...@@ -32,9 +37,13 @@ class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { ...@@ -32,9 +37,13 @@ class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate {
// apps::ShellBrowserMainDelegate: // apps::ShellBrowserMainDelegate:
virtual void Start(content::BrowserContext* context) OVERRIDE { virtual void Start(content::BrowserContext* context) OVERRIDE {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(kAppSwitch)) { base::FilePath app_dir = base::FilePath::FromUTF8Unsafe(
base::FilePath app_dir(command_line->GetSwitchValueNative(kAppSwitch)); command_line->HasSwitch(kAppSwitch) ?
base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir); command_line->GetSwitchValueNative(kAppSwitch) :
kDefaultAppPath);
base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir);
if (base::DirectoryExists(app_absolute_dir)) {
extensions::ShellExtensionSystem* extension_system = extensions::ShellExtensionSystem* extension_system =
static_cast<extensions::ShellExtensionSystem*>( static_cast<extensions::ShellExtensionSystem*>(
extensions::ExtensionSystem::Get(context)); extensions::ExtensionSystem::Get(context));
......
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