| 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 "components/translate/content/browser/content_translate_driver.h" | 5 #include "components/translate/content/browser/content_translate_driver.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "components/translate/content/common/translate_messages.h" | 8 #include "components/translate/content/common/translate_messages.h" |
| 9 #include "content/public/browser/browser_context.h" | 9 #include "content/public/browser/browser_context.h" |
| 10 #include "content/public/browser/navigation_controller.h" | 10 #include "content/public/browser/navigation_controller.h" |
| 11 #include "content/public/browser/navigation_entry.h" | 11 #include "content/public/browser/navigation_entry.h" |
| 12 #include "content/public/browser/page_navigator.h" | 12 #include "content/public/browser/page_navigator.h" |
| 13 #include "content/public/browser/render_view_host.h" | 13 #include "content/public/browser/render_view_host.h" |
| 14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 #include "content/public/common/referrer.h" | 15 #include "content/public/common/referrer.h" |
| 16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 17 | 17 |
| 18 namespace translate { |
| 19 |
| 18 ContentTranslateDriver::ContentTranslateDriver( | 20 ContentTranslateDriver::ContentTranslateDriver( |
| 19 content::NavigationController* nav_controller) | 21 content::NavigationController* nav_controller) |
| 20 : navigation_controller_(nav_controller), | 22 : navigation_controller_(nav_controller), |
| 21 observer_(NULL) { | 23 observer_(NULL) { |
| 22 DCHECK(navigation_controller_); | 24 DCHECK(navigation_controller_); |
| 23 } | 25 } |
| 24 | 26 |
| 25 ContentTranslateDriver::~ContentTranslateDriver() {} | 27 ContentTranslateDriver::~ContentTranslateDriver() {} |
| 26 | 28 |
| 27 // TranslateDriver methods | 29 // TranslateDriver methods |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 100 } |
| 99 | 101 |
| 100 void ContentTranslateDriver::OpenUrlInNewTab(const GURL& url) { | 102 void ContentTranslateDriver::OpenUrlInNewTab(const GURL& url) { |
| 101 content::OpenURLParams params(url, | 103 content::OpenURLParams params(url, |
| 102 content::Referrer(), | 104 content::Referrer(), |
| 103 NEW_FOREGROUND_TAB, | 105 NEW_FOREGROUND_TAB, |
| 104 content::PAGE_TRANSITION_LINK, | 106 content::PAGE_TRANSITION_LINK, |
| 105 false); | 107 false); |
| 106 navigation_controller_->GetWebContents()->OpenURL(params); | 108 navigation_controller_->GetWebContents()->OpenURL(params); |
| 107 } | 109 } |
| 110 |
| 111 } // namespace translate |
| OLD | NEW |