| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/webui/bug_report_ui.h" | 5 #include "chrome/browser/ui/webui/bug_report_ui.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 base::Bind(&GetSavedScreenshots, | 92 base::Bind(&GetSavedScreenshots, |
| 93 saved_screenshots, &done)); | 93 saved_screenshots, &done)); |
| 94 done.Wait(); | 94 done.Wait(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 std::string GetUserEmail() { | 97 std::string GetUserEmail() { |
| 98 chromeos::UserManager* manager = chromeos::UserManager::Get(); | 98 chromeos::UserManager* manager = chromeos::UserManager::Get(); |
| 99 if (!manager) | 99 if (!manager) |
| 100 return std::string(); | 100 return std::string(); |
| 101 else | 101 else |
| 102 return manager->logged_in_user().email(); | 102 return manager->logged_in_user().display_email(); |
| 103 } | 103 } |
| 104 #endif | 104 #endif |
| 105 | 105 |
| 106 // Returns the index of the feedback tab if already open, -1 otherwise | 106 // Returns the index of the feedback tab if already open, -1 otherwise |
| 107 int GetIndexOfFeedbackTab(Browser* browser) { | 107 int GetIndexOfFeedbackTab(Browser* browser) { |
| 108 GURL bug_report_url(chrome::kChromeUIBugReportURL); | 108 GURL bug_report_url(chrome::kChromeUIBugReportURL); |
| 109 for (int i = 0; i < browser->tab_count(); ++i) { | 109 for (int i = 0; i < browser->tab_count(); ++i) { |
| 110 TabContents* tab = browser->GetTabContentsAt(i); | 110 TabContents* tab = browser->GetTabContentsAt(i); |
| 111 if (tab && tab->GetURL().GetWithEmptyPath() == bug_report_url) | 111 if (tab && tab->GetURL().GetWithEmptyPath() == bug_report_url) |
| 112 return i; | 112 return i; |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 AddMessageHandler((handler)->Attach(this)); | 620 AddMessageHandler((handler)->Attach(this)); |
| 621 | 621 |
| 622 // The handler's init will determine whether we show the error html page. | 622 // The handler's init will determine whether we show the error html page. |
| 623 ChromeWebUIDataSource* html_source = | 623 ChromeWebUIDataSource* html_source = |
| 624 CreateBugReportUIHTMLSource(handler->Init()); | 624 CreateBugReportUIHTMLSource(handler->Init()); |
| 625 | 625 |
| 626 // Set up the chrome://bugreport/ source. | 626 // Set up the chrome://bugreport/ source. |
| 627 Profile* profile = Profile::FromBrowserContext(tab->browser_context()); | 627 Profile* profile = Profile::FromBrowserContext(tab->browser_context()); |
| 628 profile->GetChromeURLDataManager()->AddDataSource(html_source); | 628 profile->GetChromeURLDataManager()->AddDataSource(html_source); |
| 629 } | 629 } |
| OLD | NEW |