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

Side by Side Diff: chrome/browser/android/banners/app_banner_data_fetcher_android.cc

Issue 1551033002: Convert Pass()→std::move() in //chrome (Android edition) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable RVO by making types match Created 4 years, 11 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/android/bookmarks/bookmarks_bridge.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 "chrome/browser/android/banners/app_banner_data_fetcher_android.h" 5 #include "chrome/browser/android/banners/app_banner_data_fetcher_android.h"
6 6
7 #include <utility>
8
7 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h" 9 #include "chrome/browser/android/banners/app_banner_infobar_delegate_android.h"
8 #include "chrome/browser/android/shortcut_helper.h" 10 #include "chrome/browser/android/shortcut_helper.h"
9 #include "chrome/browser/banners/app_banner_metrics.h" 11 #include "chrome/browser/banners/app_banner_metrics.h"
10 #include "chrome/browser/infobars/infobar_service.h" 12 #include "chrome/browser/infobars/infobar_service.h"
11 #include "chrome/browser/manifest/manifest_icon_selector.h" 13 #include "chrome/browser/manifest/manifest_icon_selector.h"
12 #include "chrome/browser/ui/android/infobars/app_banner_infobar_android.h" 14 #include "chrome/browser/ui/android/infobars/app_banner_infobar_android.h"
13 #include "third_party/skia/include/core/SkBitmap.h" 15 #include "third_party/skia/include/core/SkBitmap.h"
14 #include "ui/gfx/screen.h" 16 #include "ui/gfx/screen.h"
15 17
16 namespace banners { 18 namespace banners {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 content::WebContents* web_contents = GetWebContents(); 81 content::WebContents* web_contents = GetWebContents();
80 DCHECK(web_contents); 82 DCHECK(web_contents);
81 83
82 infobars::InfoBar* infobar = nullptr; 84 infobars::InfoBar* infobar = nullptr;
83 if (native_app_data_.is_null()) { 85 if (native_app_data_.is_null()) {
84 scoped_ptr<AppBannerInfoBarDelegateAndroid> delegate( 86 scoped_ptr<AppBannerInfoBarDelegateAndroid> delegate(
85 new AppBannerInfoBarDelegateAndroid( 87 new AppBannerInfoBarDelegateAndroid(
86 event_request_id(), this, title, new SkBitmap(*icon), 88 event_request_id(), this, title, new SkBitmap(*icon),
87 web_app_data())); 89 web_app_data()));
88 90
89 infobar = 91 infobar = new AppBannerInfoBarAndroid(std::move(delegate),
90 new AppBannerInfoBarAndroid(delegate.Pass(), web_app_data().start_url); 92 web_app_data().start_url);
91 if (infobar) { 93 if (infobar) {
92 RecordDidShowBanner("AppBanner.WebApp.Shown"); 94 RecordDidShowBanner("AppBanner.WebApp.Shown");
93 TrackDisplayEvent(DISPLAY_EVENT_WEB_APP_BANNER_CREATED); 95 TrackDisplayEvent(DISPLAY_EVENT_WEB_APP_BANNER_CREATED);
94 } 96 }
95 } else { 97 } else {
96 scoped_ptr<AppBannerInfoBarDelegateAndroid> delegate( 98 scoped_ptr<AppBannerInfoBarDelegateAndroid> delegate(
97 new AppBannerInfoBarDelegateAndroid( 99 new AppBannerInfoBarDelegateAndroid(
98 event_request_id(), title, new SkBitmap(*icon), native_app_data_, 100 event_request_id(), title, new SkBitmap(*icon), native_app_data_,
99 native_app_package_, referrer)); 101 native_app_package_, referrer));
100 infobar = new AppBannerInfoBarAndroid(delegate.Pass(), native_app_data_); 102 infobar =
103 new AppBannerInfoBarAndroid(std::move(delegate), native_app_data_);
101 if (infobar) { 104 if (infobar) {
102 RecordDidShowBanner("AppBanner.NativeApp.Shown"); 105 RecordDidShowBanner("AppBanner.NativeApp.Shown");
103 TrackDisplayEvent(DISPLAY_EVENT_NATIVE_APP_BANNER_CREATED); 106 TrackDisplayEvent(DISPLAY_EVENT_NATIVE_APP_BANNER_CREATED);
104 } 107 }
105 } 108 }
106 InfoBarService::FromWebContents(web_contents) 109 InfoBarService::FromWebContents(web_contents)
107 ->AddInfoBar(make_scoped_ptr(infobar)); 110 ->AddInfoBar(make_scoped_ptr(infobar));
108 } 111 }
109 112
110 } // namespace banners 113 } // namespace banners
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/bookmarks/bookmarks_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698