OLD | NEW |
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 "mash/quick_launch/quick_launch_application.h" | 5 #include "mash/quick_launch/quick_launch_application.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 base::string16 working; | 118 base::string16 working; |
119 base::TrimWhitespace(input, base::TRIM_ALL, &working); | 119 base::TrimWhitespace(input, base::TRIM_ALL, &working); |
120 GURL url(working); | 120 GURL url(working); |
121 if (url.scheme() != "mojo" && url.scheme() != "exe") | 121 if (url.scheme() != "mojo" && url.scheme() != "exe") |
122 working = base::ASCIIToUTF16("mojo:") + working; | 122 working = base::ASCIIToUTF16("mojo:") + working; |
123 return base::UTF16ToUTF8(working); | 123 return base::UTF16ToUTF8(working); |
124 } | 124 } |
125 | 125 |
126 void UpdateEntries() { | 126 void UpdateEntries() { |
127 catalog_->GetEntriesProvidingClass( | 127 catalog_->GetEntriesProvidingClass( |
128 "launchable", | 128 "mash:launchable", |
129 base::Bind(&QuickLaunchUI::OnGotCatalogEntries, | 129 base::Bind(&QuickLaunchUI::OnGotCatalogEntries, |
130 base::Unretained(this))); | 130 base::Unretained(this))); |
131 } | 131 } |
132 | 132 |
133 void OnGotCatalogEntries(mojo::Array<catalog::mojom::EntryPtr> entries) { | 133 void OnGotCatalogEntries(mojo::Array<catalog::mojom::EntryPtr> entries) { |
134 for (const auto& entry : entries) | 134 for (const auto& entry : entries) |
135 app_names_.insert(base::UTF8ToUTF16(entry->name.get())); | 135 app_names_.insert(base::UTF8ToUTF16(entry->name.get())); |
136 } | 136 } |
137 | 137 |
138 void Launch(const std::string& name, bool new_window) { | 138 void Launch(const std::string& name, bool new_window) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 windows_.push_back(window); | 201 windows_.push_back(window); |
202 } | 202 } |
203 | 203 |
204 void QuickLaunchApplication::Create(shell::Connection* connection, | 204 void QuickLaunchApplication::Create(shell::Connection* connection, |
205 mojom::LaunchableRequest request) { | 205 mojom::LaunchableRequest request) { |
206 bindings_.AddBinding(this, std::move(request)); | 206 bindings_.AddBinding(this, std::move(request)); |
207 } | 207 } |
208 | 208 |
209 } // namespace quick_launch | 209 } // namespace quick_launch |
210 } // namespace mash | 210 } // namespace mash |
OLD | NEW |