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

Side by Side Diff: mash/task_viewer/task_viewer_application_delegate.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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
« no previous file with comments | « mash/task_viewer/task_viewer_application_delegate.h ('k') | mash/wallpaper/wallpaper.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mash/task_viewer/task_viewer_application_delegate.h" 5 #include "mash/task_viewer/task_viewer_application_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/process/process.h" 12 #include "base/process/process.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "mojo/public/cpp/bindings/binding.h" 15 #include "mojo/public/cpp/bindings/binding.h"
16 #include "mojo/shell/public/cpp/application_connection.h" 16 #include "mojo/shell/public/cpp/application_connection.h"
17 #include "mojo/shell/public/cpp/application_impl.h" 17 #include "mojo/shell/public/cpp/shell.h"
18 #include "mojo/shell/public/interfaces/application_manager.mojom.h" 18 #include "mojo/shell/public/interfaces/application_manager.mojom.h"
19 #include "ui/base/models/table_model.h" 19 #include "ui/base/models/table_model.h"
20 #include "ui/views/background.h" 20 #include "ui/views/background.h"
21 #include "ui/views/controls/button/label_button.h" 21 #include "ui/views/controls/button/label_button.h"
22 #include "ui/views/controls/table/table_view.h" 22 #include "ui/views/controls/table/table_view.h"
23 #include "ui/views/controls/table/table_view_observer.h" 23 #include "ui/views/controls/table/table_view_observer.h"
24 #include "ui/views/mus/aura_init.h" 24 #include "ui/views/mus/aura_init.h"
25 #include "ui/views/mus/window_manager_connection.h" 25 #include "ui/views/mus/window_manager_connection.h"
26 #include "ui/views/widget/widget_delegate.h" 26 #include "ui/views/widget/widget_delegate.h"
27 27
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 DISALLOW_COPY_AND_ASSIGN(TaskViewer); 229 DISALLOW_COPY_AND_ASSIGN(TaskViewer);
230 }; 230 };
231 231
232 } // namespace 232 } // namespace
233 233
234 TaskViewerApplicationDelegate::TaskViewerApplicationDelegate() {} 234 TaskViewerApplicationDelegate::TaskViewerApplicationDelegate() {}
235 235
236 TaskViewerApplicationDelegate::~TaskViewerApplicationDelegate() {} 236 TaskViewerApplicationDelegate::~TaskViewerApplicationDelegate() {}
237 237
238 void TaskViewerApplicationDelegate::Initialize(mojo::ApplicationImpl* app) { 238 void TaskViewerApplicationDelegate::Initialize(mojo::Shell* shell,
239 tracing_.Initialize(app); 239 const std::string& url,
240 uint32_t id) {
241 tracing_.Initialize(shell, url);
240 242
241 aura_init_.reset(new views::AuraInit(app, "views_mus_resources.pak")); 243 aura_init_.reset(new views::AuraInit(shell, "views_mus_resources.pak"));
242 views::WindowManagerConnection::Create(app); 244 views::WindowManagerConnection::Create(shell);
243 245
244 mojo::shell::mojom::ApplicationManagerPtr application_manager; 246 mojo::shell::mojom::ApplicationManagerPtr application_manager;
245 app->ConnectToService("mojo:shell", &application_manager); 247 shell->ConnectToService("mojo:shell", &application_manager);
246 248
247 mojo::shell::mojom::ApplicationManagerListenerPtr listener; 249 mojo::shell::mojom::ApplicationManagerListenerPtr listener;
248 ListenerRequest request = GetProxy(&listener); 250 ListenerRequest request = GetProxy(&listener);
249 application_manager->AddListener(std::move(listener)); 251 application_manager->AddListener(std::move(listener));
250 252
251 TaskViewer* task_viewer = new TaskViewer( 253 TaskViewer* task_viewer = new TaskViewer(
252 std::move(request), app->app_lifetime_helper()->CreateAppRefCount()); 254 std::move(request), shell->CreateAppRefCount());
253 views::Widget* window = views::Widget::CreateWindowWithBounds( 255 views::Widget* window = views::Widget::CreateWindowWithBounds(
254 task_viewer, gfx::Rect(10, 10, 500, 500)); 256 task_viewer, gfx::Rect(10, 10, 500, 500));
255 window->Show(); 257 window->Show();
256 } 258 }
257 259
258 } // namespace task_viewer 260 } // namespace task_viewer
259 } // namespace main 261 } // namespace main
OLDNEW
« no previous file with comments | « mash/task_viewer/task_viewer_application_delegate.h ('k') | mash/wallpaper/wallpaper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698