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

Unified Diff: athena/main/athena_main.cc

Issue 349493003: Load the calculator app by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/main/athena_main.cc
diff --git a/athena/main/athena_main.cc b/athena/main/athena_main.cc
index 6ac6efc6fd013b384a08bf48a9a20ef721942fa1..71eb0b5c90f5dd30c685b56a82e4c0d163f1037b 100644
--- a/athena/main/athena_main.cc
+++ b/athena/main/athena_main.cc
@@ -21,7 +21,12 @@
#include "ui/wm/core/visibility_controller.h"
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
class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate {
@@ -32,14 +37,16 @@ class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate {
// apps::ShellBrowserMainDelegate:
virtual void Start(content::BrowserContext* context) OVERRIDE {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(kAppSwitch)) {
- base::FilePath app_dir(command_line->GetSwitchValueNative(kAppSwitch));
- base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir);
- extensions::ShellExtensionSystem* extension_system =
- static_cast<extensions::ShellExtensionSystem*>(
- extensions::ExtensionSystem::Get(context));
- extension_system->LoadApp(app_absolute_dir);
- }
+ base::FilePath app_dir = base::FilePath::FromUTF8Unsafe(
+ command_line->HasSwitch(kAppSwitch) ?
+ command_line->GetSwitchValueNative(kAppSwitch) :
+ kDefaultAppPath);
oshima 2014/06/19 23:28:27 what if the directory does not exist? Just want to
Jun Mukai 2014/06/19 23:34:18 Oops, didn't notice shell_extension_system has a C
+
+ base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir);
+ extensions::ShellExtensionSystem* extension_system =
+ static_cast<extensions::ShellExtensionSystem*>(
+ extensions::ExtensionSystem::Get(context));
+ extension_system->LoadApp(app_absolute_dir);
athena::StartAthena(
apps::ShellDesktopController::instance()->host()->window(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698