OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "stdafx.h" | 5 #include "stdafx.h" |
6 #include "secondary_tile.h" | 6 #include "secondary_tile.h" |
7 | 7 |
8 #include <windows.ui.startscreen.h> | 8 #include <windows.ui.startscreen.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // Deleted in TileRequestCompleter::Respond when the async operation | 116 // Deleted in TileRequestCompleter::Respond when the async operation |
117 // completes. | 117 // completes. |
118 TileRequestCompleter* completer = | 118 TileRequestCompleter* completer = |
119 new TileRequestCompleter(TileRequestCompleter::UNPIN, callback); | 119 new TileRequestCompleter(TileRequestCompleter::UNPIN, callback); |
120 completer->Complete(completion); | 120 completer->Complete(completion); |
121 } | 121 } |
122 | 122 |
123 void CreateTileOnStartScreen(const string16& tile_id, | 123 void CreateTileOnStartScreen(const string16& tile_id, |
124 const string16& title_str, | 124 const string16& title_str, |
125 const string16& url_str, | 125 const string16& url_str, |
126 const FilePath& logo_path, | 126 const base::FilePath& logo_path, |
127 const MetroPinUmaResultCallback& callback) { | 127 const MetroPinUmaResultCallback& callback) { |
128 VLOG(1) << __FUNCTION__; | 128 VLOG(1) << __FUNCTION__; |
129 | 129 |
130 mswr::ComPtr<winui::StartScreen::ISecondaryTileFactory> tile_factory; | 130 mswr::ComPtr<winui::StartScreen::ISecondaryTileFactory> tile_factory; |
131 HRESULT hr = winrt_utils::CreateActivationFactory( | 131 HRESULT hr = winrt_utils::CreateActivationFactory( |
132 RuntimeClass_Windows_UI_StartScreen_SecondaryTile, | 132 RuntimeClass_Windows_UI_StartScreen_SecondaryTile, |
133 tile_factory.GetAddressOf()); | 133 tile_factory.GetAddressOf()); |
134 CheckHR(hr, "Failed to create instance of ISecondaryTileFactory"); | 134 CheckHR(hr, "Failed to create instance of ISecondaryTileFactory"); |
135 | 135 |
136 winui::StartScreen::TileOptions options = | 136 winui::StartScreen::TileOptions options = |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 const MetroPinUmaResultCallback& callback) { | 208 const MetroPinUmaResultCallback& callback) { |
209 globals.appview_msg_loop->PostTask( | 209 globals.appview_msg_loop->PostTask( |
210 FROM_HERE, base::Bind(&DeleteTileFromStartScreen, | 210 FROM_HERE, base::Bind(&DeleteTileFromStartScreen, |
211 tile_id, | 211 tile_id, |
212 callback)); | 212 callback)); |
213 } | 213 } |
214 | 214 |
215 void MetroPinToStartScreen(const string16& tile_id, | 215 void MetroPinToStartScreen(const string16& tile_id, |
216 const string16& title, | 216 const string16& title, |
217 const string16& url, | 217 const string16& url, |
218 const FilePath& logo_path, | 218 const base::FilePath& logo_path, |
219 const MetroPinUmaResultCallback& callback) { | 219 const MetroPinUmaResultCallback& callback) { |
220 globals.appview_msg_loop->PostTask( | 220 globals.appview_msg_loop->PostTask( |
221 FROM_HERE, base::Bind(&CreateTileOnStartScreen, | 221 FROM_HERE, base::Bind(&CreateTileOnStartScreen, |
222 tile_id, | 222 tile_id, |
223 title, | 223 title, |
224 url, | 224 url, |
225 logo_path, | 225 logo_path, |
226 callback)); | 226 callback)); |
227 } | 227 } |
OLD | NEW |