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

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

Issue 404563002: Athena's FocusRules (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « athena/home/home_card_impl.cc ('k') | athena/main/debug/debug_window.cc » ('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 "apps/shell/app/shell_main_delegate.h" 5 #include "apps/shell/app/shell_main_delegate.h"
6 #include "apps/shell/browser/shell_browser_main_delegate.h" 6 #include "apps/shell/browser/shell_browser_main_delegate.h"
7 #include "apps/shell/browser/shell_content_browser_client.h" 7 #include "apps/shell/browser/shell_content_browser_client.h"
8 #include "apps/shell/browser/shell_desktop_controller.h" 8 #include "apps/shell/browser/shell_desktop_controller.h"
9 #include "apps/shell/browser/shell_extension_system.h" 9 #include "apps/shell/browser/shell_extension_system.h"
10 #include "apps/shell/common/switches.h" 10 #include "apps/shell/common/switches.h"
11 #include "apps/shell/renderer/shell_renderer_main_delegate.h" 11 #include "apps/shell/renderer/shell_renderer_main_delegate.h"
12 #include "athena/content/public/content_activity_factory.h" 12 #include "athena/content/public/content_activity_factory.h"
13 #include "athena/content/public/content_app_model_builder.h" 13 #include "athena/content/public/content_app_model_builder.h"
14 #include "athena/home/public/home_card.h" 14 #include "athena/home/public/home_card.h"
15 #include "athena/main/athena_app_window_controller.h" 15 #include "athena/main/athena_app_window_controller.h"
16 #include "athena/main/athena_launcher.h" 16 #include "athena/main/athena_launcher.h"
17 #include "athena/main/debug/debug_window.h" 17 #include "athena/main/debug/debug_window.h"
18 #include "athena/main/placeholder.h" 18 #include "athena/main/placeholder.h"
19 #include "athena/main/url_search_provider.h" 19 #include "athena/main/url_search_provider.h"
20 #include "athena/screen/public/screen_manager.h"
20 #include "athena/virtual_keyboard/public/virtual_keyboard_bindings.h" 21 #include "athena/virtual_keyboard/public/virtual_keyboard_bindings.h"
21 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" 22 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h"
22 #include "base/command_line.h" 23 #include "base/command_line.h"
23 #include "base/file_util.h" 24 #include "base/file_util.h"
24 #include "base/path_service.h" 25 #include "base/path_service.h"
25 #include "content/public/app/content_main.h" 26 #include "content/public/app/content_main.h"
26 #include "ui/aura/window_tree_host.h" 27 #include "ui/aura/window_tree_host.h"
27 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
28 #include "ui/keyboard/keyboard_controller.h" 29 #include "ui/keyboard/keyboard_controller.h"
29 #include "ui/keyboard/keyboard_controller_observer.h" 30 #include "ui/keyboard/keyboard_controller_observer.h"
(...skipping 21 matching lines...) Expand all
51 } 52 }
52 53
53 private: 54 private:
54 virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) OVERRIDE { 55 virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) OVERRIDE {
55 athena::HomeCard::Get()->UpdateVirtualKeyboardBounds(new_bounds); 56 athena::HomeCard::Get()->UpdateVirtualKeyboardBounds(new_bounds);
56 } 57 }
57 58
58 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardObserver); 59 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardObserver);
59 }; 60 };
60 61
62 class AthenaDesktopController : public apps::ShellDesktopController {
63 public:
64 AthenaDesktopController() {}
65 virtual ~AthenaDesktopController() {}
66
67 private:
68 // apps::ShellDesktopController:
69 virtual wm::FocusRules* CreateFocusRules() OVERRIDE {
70 return athena::ScreenManager::CreateFocusRules();
71 }
72
73 DISALLOW_COPY_AND_ASSIGN(AthenaDesktopController);
74 };
75
61 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { 76 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate {
62 public: 77 public:
63 AthenaBrowserMainDelegate() {} 78 AthenaBrowserMainDelegate() {}
64 virtual ~AthenaBrowserMainDelegate() {} 79 virtual ~AthenaBrowserMainDelegate() {}
65 80
66 // apps::ShellBrowserMainDelegate: 81 // apps::ShellBrowserMainDelegate:
67 virtual void Start(content::BrowserContext* context) OVERRIDE { 82 virtual void Start(content::BrowserContext* context) OVERRIDE {
68 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 83 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
69 base::FilePath app_dir = base::FilePath::FromUTF8Unsafe( 84 base::FilePath app_dir = base::FilePath::FromUTF8Unsafe(
70 command_line->HasSwitch(apps::switches::kAppShellAppPath) ? 85 command_line->HasSwitch(apps::switches::kAppShellAppPath) ?
(...skipping 22 matching lines...) Expand all
93 } 108 }
94 109
95 virtual void Shutdown() OVERRIDE { 110 virtual void Shutdown() OVERRIDE {
96 keyboard_observer_.reset(); 111 keyboard_observer_.reset();
97 athena::ShutdownAthena(); 112 athena::ShutdownAthena();
98 } 113 }
99 114
100 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { 115 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE {
101 // TODO(mukai): create Athena's own ShellDesktopController subclass so that 116 // TODO(mukai): create Athena's own ShellDesktopController subclass so that
102 // it can initialize its own window manager logic. 117 // it can initialize its own window manager logic.
103 apps::ShellDesktopController* desktop = new apps::ShellDesktopController(); 118 apps::ShellDesktopController* desktop = new AthenaDesktopController();
104 desktop->SetAppWindowController(new athena::AthenaAppWindowController()); 119 desktop->SetAppWindowController(new athena::AthenaAppWindowController());
105 return desktop; 120 return desktop;
106 } 121 }
107 122
108 private: 123 private:
109 scoped_ptr<VirtualKeyboardObserver> keyboard_observer_; 124 scoped_ptr<VirtualKeyboardObserver> keyboard_observer_;
110 125
111 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); 126 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate);
112 }; 127 };
113 128
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 190
176 int main(int argc, const char** argv) { 191 int main(int argc, const char** argv) {
177 AthenaMainDelegate delegate; 192 AthenaMainDelegate delegate;
178 content::ContentMainParams params(&delegate); 193 content::ContentMainParams params(&delegate);
179 194
180 params.argc = argc; 195 params.argc = argc;
181 params.argv = argv; 196 params.argv = argv;
182 197
183 return content::ContentMain(params); 198 return content::ContentMain(params);
184 } 199 }
OLDNEW
« no previous file with comments | « athena/home/home_card_impl.cc ('k') | athena/main/debug/debug_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698