Chromium Code Reviews| Index: chrome/browser/ui/tab_contents/tab_contents.cc |
| diff --git a/chrome/browser/ui/tab_contents/tab_contents.cc b/chrome/browser/ui/tab_contents/tab_contents.cc |
| index 3c4a81fe08186078f3d6e461b76bc0f5984172e3..2253675ce40721f6d352a3d2b6c4370628c56007 100644 |
| --- a/chrome/browser/ui/tab_contents/tab_contents.cc |
| +++ b/chrome/browser/ui/tab_contents/tab_contents.cc |
| @@ -28,6 +28,8 @@ |
| #include "chrome/browser/printing/print_view_manager.h" |
| #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
| #include "chrome/browser/sessions/restore_tab_helper.h" |
| +#include "chrome/browser/sessions/session_service.h" |
| +#include "chrome/browser/sessions/session_service_factory.h" |
| #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" |
| #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" |
| #include "chrome/browser/tab_contents/thumbnail_generator.h" |
| @@ -251,3 +253,15 @@ void TabContents::WebContentsDestroyed(WebContents* tab) { |
| // will attempt to access the WebContents and we'll crash. |
| DCHECK(in_destructor_); |
| } |
| + |
| +void TabContents::UserAgentOverrideSet(const std::string& user_agent) { |
| +#if defined(ENABLE_SESSION_SERVICE) |
| + SessionService* session = |
| + SessionServiceFactory::GetForProfile(profile()); |
| + if (session) { |
| + session->SetTabUserAgentOverride(restore_tab_helper()->window_id(), |
| + restore_tab_helper()->session_id(), |
| + user_agent); |
| + } |
| +#endif |
|
Avi (use Gerrit)
2012/08/29 21:01:22
NO.
TabContents is not the place for random overr
gone
2012/08/29 21:10:01
Er, alright. How should this change then? I move
|
| +} |