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

Side by Side Diff: athena/main/athena_main_delegate.cc

Issue 727963004: app_shell: Change flag for loading apps to --load-app and only launch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix athena build Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « athena/main/DEPS ('k') | extensions/common/switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "athena/main/athena_main_delegate.h" 5 #include "athena/main/athena_main_delegate.h"
6 6
7 #include "athena/content/public/web_contents_view_delegate_creator.h" 7 #include "athena/content/public/web_contents_view_delegate_creator.h"
8 #include "athena/env/public/athena_env.h" 8 #include "athena/env/public/athena_env.h"
9 #include "athena/main/athena_content_client.h" 9 #include "athena/main/athena_content_client.h"
10 #include "athena/main/athena_renderer_pdf_helper.h" 10 #include "athena/main/athena_renderer_pdf_helper.h"
11 #include "athena/main/public/athena_launcher.h" 11 #include "athena/main/public/athena_launcher.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/files/file_util.h" 13 #include "base/files/file_util.h"
14 #include "base/path_service.h" 14 #include "base/path_service.h"
15 #include "components/pdf/renderer/ppb_pdf_impl.h" 15 #include "components/pdf/renderer/ppb_pdf_impl.h"
16 #include "content/public/app/content_main.h" 16 #include "content/public/app/content_main.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "extensions/common/switches.h"
18 #include "extensions/shell/browser/desktop_controller.h" 19 #include "extensions/shell/browser/desktop_controller.h"
19 #include "extensions/shell/browser/shell_browser_main_delegate.h" 20 #include "extensions/shell/browser/shell_browser_main_delegate.h"
20 #include "extensions/shell/browser/shell_content_browser_client.h" 21 #include "extensions/shell/browser/shell_content_browser_client.h"
21 #include "extensions/shell/browser/shell_extension_system.h" 22 #include "extensions/shell/browser/shell_extension_system.h"
22 #include "extensions/shell/common/shell_content_client.h" 23 #include "extensions/shell/common/shell_content_client.h"
23 #include "extensions/shell/common/switches.h" 24 #include "extensions/shell/common/switches.h"
24 #include "extensions/shell/renderer/shell_content_renderer_client.h" 25 #include "extensions/shell/renderer/shell_content_renderer_client.h"
25 #include "ppapi/c/private/ppb_pdf.h" 26 #include "ppapi/c/private/ppb_pdf.h"
26 #include "ui/base/resource/resource_bundle.h" 27 #include "ui/base/resource/resource_bundle.h"
27 28
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate { 69 class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate {
69 public: 70 public:
70 AthenaBrowserMainDelegate() {} 71 AthenaBrowserMainDelegate() {}
71 ~AthenaBrowserMainDelegate() override {} 72 ~AthenaBrowserMainDelegate() override {}
72 73
73 // extensions::ShellBrowserMainDelegate: 74 // extensions::ShellBrowserMainDelegate:
74 virtual void Start(content::BrowserContext* context) override { 75 virtual void Start(content::BrowserContext* context) override {
75 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 76 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
76 77
77 base::FilePath app_dir = base::FilePath::FromUTF8Unsafe( 78 base::FilePath app_dir = base::FilePath::FromUTF8Unsafe(
78 command_line->HasSwitch(extensions::switches::kAppShellAppPath) 79 command_line->HasSwitch(extensions::switches::kLoadApps)
79 ? command_line->GetSwitchValueNative( 80 ? command_line->GetSwitchValueNative(
80 extensions::switches::kAppShellAppPath) 81 extensions::switches::kLoadApps)
81 : kDefaultAppPath); 82 : kDefaultAppPath);
82 83
83 base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir); 84 base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir);
84 if (base::DirectoryExists(app_absolute_dir)) { 85 if (base::DirectoryExists(app_absolute_dir)) {
85 extensions::ShellExtensionSystem* extension_system = 86 extensions::ShellExtensionSystem* extension_system =
86 static_cast<extensions::ShellExtensionSystem*>( 87 static_cast<extensions::ShellExtensionSystem*>(
87 extensions::ExtensionSystem::Get(context)); 88 extensions::ExtensionSystem::Get(context));
88 extension_system->LoadApp(app_absolute_dir); 89 extension_system->LoadApp(app_absolute_dir);
89 } 90 }
90 91
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 167
167 void AthenaMainDelegate::InitializeResourceBundle() { 168 void AthenaMainDelegate::InitializeResourceBundle() {
168 base::FilePath pak_dir; 169 base::FilePath pak_dir;
169 PathService::Get(base::DIR_MODULE, &pak_dir); 170 PathService::Get(base::DIR_MODULE, &pak_dir);
170 base::FilePath pak_file = 171 base::FilePath pak_file =
171 pak_dir.Append(FILE_PATH_LITERAL("athena_resources.pak")); 172 pak_dir.Append(FILE_PATH_LITERAL("athena_resources.pak"));
172 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); 173 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file);
173 } 174 }
174 175
175 } // namespace athena 176 } // namespace athena
OLDNEW
« no previous file with comments | « athena/main/DEPS ('k') | extensions/common/switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698