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

Side by Side Diff: ui/aura_shell/examples/aura_shell_main.cc

Issue 8247012: Positions the launcher in the bottom left corner. Adds ShellDelegate (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix TestDesktopDelegate Created 9 years, 2 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/i18n/icu_util.h" 7 #include "base/i18n/icu_util.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "ui/aura/desktop.h" 10 #include "ui/aura/desktop.h"
11 #include "ui/aura_shell/examples/toplevel_window.h" 11 #include "ui/aura_shell/examples/toplevel_window.h"
12 #include "ui/aura_shell/launcher/launcher_model.h"
12 #include "ui/aura_shell/shell.h" 13 #include "ui/aura_shell/shell.h"
13 #include "ui/aura_shell/shell_delegate.h" 14 #include "ui/aura_shell/shell_delegate.h"
14 #include "ui/aura_shell/shell_factory.h" 15 #include "ui/aura_shell/shell_factory.h"
15 #include "ui/base/resource/resource_bundle.h" 16 #include "ui/base/resource/resource_bundle.h"
16 #include "ui/base/ui_base_paths.h" 17 #include "ui/base/ui_base_paths.h"
17 18
18 namespace { 19 namespace {
19 20
20 class ShellDelegateImpl : public aura_shell::ShellDelegate { 21 class ShellDelegateImpl : public aura_shell::ShellDelegate {
21 public: 22 public:
22 ShellDelegateImpl() { 23 ShellDelegateImpl() {
23 } 24 }
24 25
25 virtual void CreateNewWindow() OVERRIDE { 26 virtual void CreateNewWindow() OVERRIDE {
26 aura_shell::examples::ToplevelWindow::CreateParams create_params; 27 aura_shell::examples::ToplevelWindow::CreateParams create_params;
27 create_params.can_resize = true; 28 create_params.can_resize = true;
28 create_params.can_maximize = true; 29 create_params.can_maximize = true;
29 aura_shell::examples::ToplevelWindow::CreateToplevelWindow(create_params); 30 aura_shell::examples::ToplevelWindow::CreateToplevelWindow(create_params);
30 } 31 }
31 32
32 virtual void ShowApps() OVERRIDE { 33 virtual void ShowApps() OVERRIDE {
33 NOTIMPLEMENTED(); 34 NOTIMPLEMENTED();
34 } 35 }
36
37 virtual void LauncherItemClicked(
38 const aura_shell::LauncherItem& item) OVERRIDE {
39 item.window->Activate();
40 }
41
42 virtual bool ConfigureLauncherItem(aura_shell::LauncherItem* item) OVERRIDE {
43 return true; // Makes the entry show up in the launcher.
44 }
35 }; 45 };
36 46
37 } // namesapce 47 } // namesapce
38 48
39 int main(int argc, char** argv) { 49 int main(int argc, char** argv) {
40 CommandLine::Init(argc, argv); 50 CommandLine::Init(argc, argv);
41 51
42 // The exit manager is in charge of calling the dtors of singleton objects. 52 // The exit manager is in charge of calling the dtors of singleton objects.
43 base::AtExitManager exit_manager; 53 base::AtExitManager exit_manager;
44 54
45 ui::RegisterPathProvider(); 55 ui::RegisterPathProvider();
46 icu_util::Initialize(); 56 icu_util::Initialize();
47 ResourceBundle::InitSharedInstance("en-US"); 57 ResourceBundle::InitSharedInstance("en-US");
48 58
49 // Create the message-loop here before creating the desktop. 59 // Create the message-loop here before creating the desktop.
50 MessageLoop message_loop(MessageLoop::TYPE_UI); 60 MessageLoop message_loop(MessageLoop::TYPE_UI);
51 61
52 aura_shell::Shell::GetInstance()->SetDelegate(new ShellDelegateImpl);; 62 aura_shell::Shell::GetInstance()->SetDelegate(new ShellDelegateImpl);;
53 63
54 aura_shell::examples::InitWindowTypeLauncher(); 64 aura_shell::examples::InitWindowTypeLauncher();
55 65
56 aura::Desktop::GetInstance()->Run(); 66 aura::Desktop::GetInstance()->Run();
57 67
58 delete aura::Desktop::GetInstance(); 68 delete aura::Desktop::GetInstance();
59 69
60 return 0; 70 return 0;
61 } 71 }
62 72
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698