OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |