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

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

Issue 8894018: Move the concept of Activation to the Shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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/root_window.h" 10 #include "ui/aura/root_window.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_types.h" 12 #include "ui/aura_shell/launcher/launcher_types.h"
13 #include "ui/aura_shell/shell.h" 13 #include "ui/aura_shell/shell.h"
14 #include "ui/aura_shell/shell_delegate.h" 14 #include "ui/aura_shell/shell_delegate.h"
15 #include "ui/aura_shell/shell_factory.h" 15 #include "ui/aura_shell/shell_factory.h"
16 #include "ui/aura_shell/window_util.h"
16 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
17 #include "ui/base/ui_base_paths.h" 18 #include "ui/base/ui_base_paths.h"
18 #include "ui/gfx/canvas.h" 19 #include "ui/gfx/canvas.h"
19 #include "ui/gfx/compositor/test/compositor_test_support.h" 20 #include "ui/gfx/compositor/test/compositor_test_support.h"
20 #include "ui/views/widget/widget.h" 21 #include "ui/views/widget/widget.h"
21 #include "ui/views/widget/widget_delegate.h" 22 #include "ui/views/widget/widget_delegate.h"
22 23
23 namespace { 24 namespace {
24 25
25 class AppListWindow : public views::WidgetDelegateView { 26 class AppListWindow : public views::WidgetDelegateView {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 68 }
68 69
69 virtual void RequestAppListWidget( 70 virtual void RequestAppListWidget(
70 const gfx::Rect& bounds, 71 const gfx::Rect& bounds,
71 const SetWidgetCallback& callback) OVERRIDE { 72 const SetWidgetCallback& callback) OVERRIDE {
72 callback.Run(AppListWindow::Create(bounds)); 73 callback.Run(AppListWindow::Create(bounds));
73 } 74 }
74 75
75 virtual void LauncherItemClicked( 76 virtual void LauncherItemClicked(
76 const aura_shell::LauncherItem& item) OVERRIDE { 77 const aura_shell::LauncherItem& item) OVERRIDE {
77 item.window->Activate(); 78 aura_shell::ActivateWindow(item.window);
78 } 79 }
79 80
80 virtual bool ConfigureLauncherItem(aura_shell::LauncherItem* item) OVERRIDE { 81 virtual bool ConfigureLauncherItem(aura_shell::LauncherItem* item) OVERRIDE {
81 static int image_count = 0; 82 static int image_count = 0;
82 item->tab_images.resize(image_count + 1); 83 item->tab_images.resize(image_count + 1);
83 for (int i = 0; i < image_count + 1; ++i) { 84 for (int i = 0; i < image_count + 1; ++i) {
84 item->tab_images[i].image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); 85 item->tab_images[i].image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
85 item->tab_images[i].image.allocPixels(); 86 item->tab_images[i].image.allocPixels();
86 item->tab_images[i].image.eraseARGB(255, 87 item->tab_images[i].image.eraseARGB(255,
87 i == 0 ? 255 : 0, 88 i == 0 ? 255 : 0,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 aura::RootWindow::GetInstance()->Run(); 125 aura::RootWindow::GetInstance()->Run();
125 126
126 aura_shell::Shell::DeleteInstance(); 127 aura_shell::Shell::DeleteInstance();
127 128
128 aura::RootWindow::DeleteInstance(); 129 aura::RootWindow::DeleteInstance();
129 130
130 ui::CompositorTestSupport::Terminate(); 131 ui::CompositorTestSupport::Terminate();
131 132
132 return 0; 133 return 0;
133 } 134 }
OLDNEW
« no previous file with comments | « ui/aura_shell/default_container_layout_manager.cc ('k') | ui/aura_shell/modal_container_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698