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

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: DirectoryExists. ShellExtensionSystem has a CHECK for this 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..dd6673c9db46fefba214faa996fec1f4b9113051 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,9 +37,13 @@ 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);
+ base::FilePath app_dir = base::FilePath::FromUTF8Unsafe(
+ command_line->HasSwitch(kAppSwitch) ?
+ command_line->GetSwitchValueNative(kAppSwitch) :
+ kDefaultAppPath);
+
+ base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir);
+ if (base::DirectoryExists(app_absolute_dir)) {
extensions::ShellExtensionSystem* extension_system =
static_cast<extensions::ShellExtensionSystem*>(
extensions::ExtensionSystem::Get(context));
« 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