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

Side by Side Diff: ash/mus/shelf_delegate_mus.cc

Issue 1725353003: Eliminate mojo::Shell client lib class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@15connector
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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/mus/shelf_delegate_mus.h" 5 #include "ash/mus/shelf_delegate_mus.h"
6 6
7 #include "ash/shelf/shelf_item_delegate.h" 7 #include "ash/shelf/shelf_item_delegate.h"
8 #include "ash/shelf/shelf_item_delegate_manager.h" 8 #include "ash/shelf/shelf_item_delegate_manager.h"
9 #include "ash/shelf/shelf_model.h" 9 #include "ash/shelf/shelf_model.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "mojo/common/common_type_converters.h" 12 #include "mojo/common/common_type_converters.h"
13 #include "mojo/shell/public/cpp/shell.h" 13 #include "mojo/shell/public/cpp/connector.h"
14 #include "ui/base/resource/resource_bundle.h" 14 #include "ui/base/resource/resource_bundle.h"
15 #include "ui/resources/grit/ui_resources.h" 15 #include "ui/resources/grit/ui_resources.h"
16 #include "ui/views/mus/window_manager_connection.h" 16 #include "ui/views/mus/window_manager_connection.h"
17 17
18 using mash::wm::mojom::UserWindowController; 18 using mash::wm::mojom::UserWindowController;
19 19
20 namespace ash { 20 namespace ash {
21 namespace sysui { 21 namespace sysui {
22 22
23 namespace { 23 namespace {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 base::string16 title_; 76 base::string16 title_;
77 UserWindowController* user_window_controller_; 77 UserWindowController* user_window_controller_;
78 78
79 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateMus); 79 DISALLOW_COPY_AND_ASSIGN(ShelfItemDelegateMus);
80 }; 80 };
81 81
82 } // namespace 82 } // namespace
83 83
84 ShelfDelegateMus::ShelfDelegateMus(ShelfModel* model) 84 ShelfDelegateMus::ShelfDelegateMus(ShelfModel* model)
85 : model_(model), binding_(this) { 85 : model_(model), binding_(this) {
86 mojo::Shell* shell = views::WindowManagerConnection::Get()->shell(); 86 mojo::Connector* connector =
87 shell->ConnectToInterface("mojo:desktop_wm", &user_window_controller_); 87 views::WindowManagerConnection::Get()->connector();
88 connector->ConnectToInterface("mojo:desktop_wm", &user_window_controller_);
88 user_window_controller_->AddUserWindowObserver( 89 user_window_controller_->AddUserWindowObserver(
89 binding_.CreateInterfacePtrAndBind()); 90 binding_.CreateInterfacePtrAndBind());
90 } 91 }
91 92
92 ShelfDelegateMus::~ShelfDelegateMus() {} 93 ShelfDelegateMus::~ShelfDelegateMus() {}
93 94
94 void ShelfDelegateMus::OnShelfCreated(Shelf* shelf) { 95 void ShelfDelegateMus::OnShelfCreated(Shelf* shelf) {
95 NOTIMPLEMENTED(); 96 NOTIMPLEMENTED();
96 } 97 }
97 98
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 DCHECK_GE(index, 0); 192 DCHECK_GE(index, 0);
192 ShelfItems::const_iterator iter = model_->ItemByID(shelf_id); 193 ShelfItems::const_iterator iter = model_->ItemByID(shelf_id);
193 DCHECK(iter != model_->items().end()); 194 DCHECK(iter != model_->items().end());
194 ShelfItem item = *iter; 195 ShelfItem item = *iter;
195 item.status = has_focus ? STATUS_ACTIVE : STATUS_RUNNING; 196 item.status = has_focus ? STATUS_ACTIVE : STATUS_RUNNING;
196 model_->Set(index, item); 197 model_->Set(index, item);
197 } 198 }
198 199
199 } // namespace sysui 200 } // namespace sysui
200 } // namespace ash 201 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698