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

Side by Side Diff: chrome/browser/ui/apps/chrome_app_delegate.cc

Issue 2824363002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/ui (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/apps/chrome_app_delegate.h" 5 #include "chrome/browser/ui/apps/chrome_app_delegate.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 is_hidden_ = true; 329 is_hidden_ = true;
330 if (has_been_shown_) { 330 if (has_been_shown_) {
331 keep_alive_.reset(); 331 keep_alive_.reset();
332 return; 332 return;
333 } 333 }
334 334
335 // Hold on to the keep alive for some time to give the app a chance to show 335 // Hold on to the keep alive for some time to give the app a chance to show
336 // the window. 336 // the window.
337 content::BrowserThread::PostDelayedTask( 337 content::BrowserThread::PostDelayedTask(
338 content::BrowserThread::UI, FROM_HERE, 338 content::BrowserThread::UI, FROM_HERE,
339 base::Bind(&ChromeAppDelegate::RelinquishKeepAliveAfterTimeout, 339 base::BindOnce(&ChromeAppDelegate::RelinquishKeepAliveAfterTimeout,
340 weak_factory_.GetWeakPtr()), 340 weak_factory_.GetWeakPtr()),
341 base::TimeDelta::FromSeconds(kAppWindowFirstShowTimeoutSeconds)); 341 base::TimeDelta::FromSeconds(kAppWindowFirstShowTimeoutSeconds));
342 } 342 }
343 343
344 void ChromeAppDelegate::OnShow() { 344 void ChromeAppDelegate::OnShow() {
345 has_been_shown_ = true; 345 has_been_shown_ = true;
346 is_hidden_ = false; 346 is_hidden_ = false;
347 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::CHROME_APP_DELEGATE, 347 keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::CHROME_APP_DELEGATE,
348 KeepAliveRestartOption::DISABLED)); 348 KeepAliveRestartOption::DISABLED));
349 } 349 }
350 350
351 void ChromeAppDelegate::Observe(int type, 351 void ChromeAppDelegate::Observe(int type,
352 const content::NotificationSource& source, 352 const content::NotificationSource& source,
353 const content::NotificationDetails& details) { 353 const content::NotificationDetails& details) {
354 DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type); 354 DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type);
355 if (!terminating_callback_.is_null()) 355 if (!terminating_callback_.is_null())
356 terminating_callback_.Run(); 356 terminating_callback_.Run();
357 } 357 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/autofill/card_unmask_prompt_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698