OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/translate/translate_helper.h" | 5 #include "chrome/renderer/translate/translate_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
14 #include "chrome/common/render_messages.h" | 14 #include "chrome/common/render_messages.h" |
15 #include "chrome/common/translate/translate_util.h" | 15 #include "chrome/common/translate/translate_util.h" |
16 #include "chrome/renderer/translate/translate_helper_metrics.h" | 16 #include "chrome/renderer/translate/translate_helper_metrics.h" |
17 #include "content/public/renderer/render_view.h" | 17 #include "content/public/renderer/render_view.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h" |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 | 646 |
647 WebFrame* TranslateHelper::GetMainFrame() { | 647 WebFrame* TranslateHelper::GetMainFrame() { |
648 WebView* web_view = render_view()->GetWebView(); | 648 WebView* web_view = render_view()->GetWebView(); |
649 | 649 |
650 // When the tab is going to be closed, the web_view can be NULL. | 650 // When the tab is going to be closed, the web_view can be NULL. |
651 if (!web_view) | 651 if (!web_view) |
652 return NULL; | 652 return NULL; |
653 | 653 |
654 return web_view->mainFrame(); | 654 return web_view->mainFrame(); |
655 } | 655 } |
OLD | NEW |