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

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

Issue 2159323003: [MD Feedback] Add placeholder feedback entry point. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h" 9 #include "chrome/browser/extensions/api/feedback_private/feedback_private_api.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/profiles/profile_manager.h" 11 #include "chrome/browser/profiles/profile_manager.h"
12 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 12 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
13 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" 13 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
14 #include "chrome/browser/ui/browser_finder.h" 14 #include "chrome/browser/ui/browser_finder.h"
15 #include "chrome/browser/ui/browser_window.h" 15 #include "chrome/browser/ui/browser_window.h"
16 #include "chrome/browser/ui/tabs/tab_strip_model.h" 16 #include "chrome/browser/ui/tabs/tab_strip_model.h"
17 #include "chrome/browser/ui/webui/md_feedback/md_feedback_dialog_controller.h"
18 #include "chrome/common/chrome_switches.h"
17 #include "components/signin/core/account_id/account_id.h" 19 #include "components/signin/core/account_id/account_id.h"
18 #include "content/public/browser/web_contents.h" 20 #include "content/public/browser/web_contents.h"
19 #include "url/gurl.h" 21 #include "url/gurl.h"
20 22
21 namespace { 23 namespace {
22 24
23 GURL GetTargetTabUrl(int session_id, int index) { 25 GURL GetTargetTabUrl(int session_id, int index) {
24 Browser* browser = chrome::FindBrowserWithID(session_id); 26 Browser* browser = chrome::FindBrowserWithID(session_id);
25 // Sanity checks. 27 // Sanity checks.
26 if (!browser || index >= browser->tab_strip_model()->count()) 28 if (!browser || index >= browser->tab_strip_model()->count())
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 const AccountId display_account_id = 73 const AccountId display_account_id =
72 window_manager && browser 74 window_manager && browser
73 ? window_manager->GetUserPresentingWindow( 75 ? window_manager->GetUserPresentingWindow(
74 browser->window()->GetNativeWindow()) 76 browser->window()->GetNativeWindow())
75 : EmptyAccountId(); 77 : EmptyAccountId();
76 profile = display_account_id.is_valid() 78 profile = display_account_id.is_valid()
77 ? multi_user_util::GetProfileFromAccountId(display_account_id) 79 ? multi_user_util::GetProfileFromAccountId(display_account_id)
78 : profile; 80 : profile;
79 #endif 81 #endif
80 82
83 if (::switches::MdFeedbackEnabled()) {
84 MdFeedbackDialogController* controller =
85 MdFeedbackDialogController::GetOrCreate();
afakhry 2016/08/02 22:15:56 It's actually GetOrCreateAndGet() ;) To be consist
apacible 2016/08/09 22:11:13 Done.
86 controller->Show(profile);
87 return;
88 }
89
81 extensions::FeedbackPrivateAPI* api = 90 extensions::FeedbackPrivateAPI* api =
82 extensions::FeedbackPrivateAPI::GetFactoryInstance()->Get(profile); 91 extensions::FeedbackPrivateAPI::GetFactoryInstance()->Get(profile);
83 92
84 api->RequestFeedback(description_template, 93 api->RequestFeedback(description_template,
85 category_tag, 94 category_tag,
86 page_url); 95 page_url);
87 } 96 }
88 97
89 } // namespace chrome 98 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698