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

Unified Diff: athena/main/athena_main.cc

Issue 485183002: introduced athena_main_lib (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gyp cleanup Created 6 years, 4 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 | « athena/main/athena_launcher.cc ('k') | athena/main/athena_main.gyp » ('j') | 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 8ce723694d27aa1abb8f531b6dbbf1493f8b814c..4cd30b13a3b370160f89a5383119f9e27f50216e 100644
--- a/athena/main/athena_main.cc
+++ b/athena/main/athena_main.cc
@@ -2,17 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "athena/content/public/content_activity_factory.h"
-#include "athena/content/public/content_app_model_builder.h"
#include "athena/content/public/web_contents_view_delegate_creator.h"
-#include "athena/home/public/home_card.h"
#include "athena/main/athena_app_window_controller.h"
#include "athena/main/athena_launcher.h"
-#include "athena/main/debug/debug_window.h"
-#include "athena/main/placeholder.h"
-#include "athena/main/url_search_provider.h"
#include "athena/screen/public/screen_manager.h"
-#include "athena/virtual_keyboard/public/virtual_keyboard_manager.h"
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/path_service.h"
@@ -24,12 +17,8 @@
#include "extensions/shell/browser/shell_extension_system.h"
#include "extensions/shell/common/switches.h"
#include "extensions/shell/renderer/shell_renderer_main_delegate.h"
-#include "ui/app_list/app_list_switches.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/keyboard/keyboard_controller.h"
-#include "ui/keyboard/keyboard_controller_observer.h"
-#include "ui/native_theme/native_theme_switches.h"
#include "ui/wm/core/visibility_controller.h"
namespace {
@@ -38,28 +27,8 @@ namespace {
// to run athena_main at src/
const char kDefaultAppPath[] =
"chrome/common/extensions/docs/examples/apps/calculator/app";
-} // namespace
-// This class observes the change of the virtual keyboard and distribute the
-// change to appropriate modules of athena.
-// TODO(oshima): move the VK bounds logic to screen manager.
-class VirtualKeyboardObserver : public keyboard::KeyboardControllerObserver {
- public:
- VirtualKeyboardObserver() {
- keyboard::KeyboardController::GetInstance()->AddObserver(this);
- }
-
- virtual ~VirtualKeyboardObserver() {
- keyboard::KeyboardController::GetInstance()->RemoveObserver(this);
- }
-
- private:
- virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) OVERRIDE {
- athena::HomeCard::Get()->UpdateVirtualKeyboardBounds(new_bounds);
- }
-
- DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardObserver);
-};
+} // namespace athena
class AthenaDesktopController : public extensions::ShellDesktopController {
public:
@@ -84,10 +53,6 @@ class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate {
virtual void Start(content::BrowserContext* context) OVERRIDE {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- // Force showing in the experimental app-list view.
- command_line->AppendSwitch(app_list::switches::kEnableExperimentalAppList);
- command_line->AppendSwitch(switches::kEnableOverlayScrollbar);
-
base::FilePath app_dir = base::FilePath::FromUTF8Unsafe(
command_line->HasSwitch(extensions::switches::kAppShellAppPath)
? command_line->GetSwitchValueNative(
@@ -102,21 +67,12 @@ class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate {
extension_system->LoadApp(app_absolute_dir);
}
- athena::StartAthena(
- extensions::ShellDesktopController::instance()->host()->window(),
- new athena::ContentActivityFactory(),
- new athena::ContentAppModelBuilder(context));
- athena::HomeCard::Get()->RegisterSearchProvider(
- new athena::UrlSearchProvider(context));
- athena::VirtualKeyboardManager::Create(context);
- keyboard_observer_.reset(new VirtualKeyboardObserver());
-
- CreateTestPages(context);
- CreateDebugWindow();
+ athena::StartAthenaEnv(
+ extensions::ShellDesktopController::instance()->host()->window());
+ athena::StartAthenaSessionWithContext(context);
}
virtual void Shutdown() OVERRIDE {
- keyboard_observer_.reset();
athena::ShutdownAthena();
}
@@ -130,8 +86,6 @@ class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate {
}
private:
- scoped_ptr<VirtualKeyboardObserver> keyboard_observer_;
-
DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate);
};
« no previous file with comments | « athena/main/athena_launcher.cc ('k') | athena/main/athena_main.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698