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

Side by Side Diff: chrome/browser/feedback/show_feedback_page.cc

Issue 1128173005: Clean up ProfileManager interface. Base URL: https://chromium.googlesource.com/chromium/src@issue479309
Patch Set: sync Created 5 years, 6 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 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 <string> 5 #include <string>
6 6
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h" 8 #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_manager.h" 10 #include "chrome/browser/profiles/profile_manager.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 GURL page_url; 44 GURL page_url;
45 if (browser) { 45 if (browser) {
46 page_url = GetTargetTabUrl(browser->session_id().id(), 46 page_url = GetTargetTabUrl(browser->session_id().id(),
47 browser->tab_strip_model()->active_index()); 47 browser->tab_strip_model()->active_index());
48 } 48 }
49 49
50 Profile* profile = NULL; 50 Profile* profile = NULL;
51 if (browser) { 51 if (browser) {
52 profile = browser->profile(); 52 profile = browser->profile();
53 } else { 53 } else {
54 profile = ProfileManager::GetLastUsedProfileAllowedByPolicy(); 54 profile = g_browser_process->profile_manager()
55 ->GetLastUsedProfileAllowedByPolicy();
55 } 56 }
56 if (!profile) { 57 if (!profile) {
57 LOG(ERROR) << "Cannot invoke feedback: No profile found!"; 58 LOG(ERROR) << "Cannot invoke feedback: No profile found!";
58 return; 59 return;
59 } 60 }
60 61
61 // We do not want to launch on an OTR profile. 62 // We do not want to launch on an OTR profile.
62 profile = profile->GetOriginalProfile(); 63 profile = profile->GetOriginalProfile();
63 DCHECK(profile); 64 DCHECK(profile);
64 65
(...skipping 13 matching lines...) Expand all
78 79
79 extensions::FeedbackPrivateAPI* api = 80 extensions::FeedbackPrivateAPI* api =
80 extensions::FeedbackPrivateAPI::GetFactoryInstance()->Get(profile); 81 extensions::FeedbackPrivateAPI::GetFactoryInstance()->Get(profile);
81 82
82 api->RequestFeedback(description_template, 83 api->RequestFeedback(description_template,
83 category_tag, 84 category_tag,
84 page_url); 85 page_url);
85 } 86 }
86 87
87 } // namespace chrome 88 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698