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/browser/ui/webui/ntp/android/context_menu_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/android/context_menu_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/android/tab_android.h" | 11 #include "chrome/browser/android/tab_android.h" |
12 #include "content/public/browser/user_metrics.h" | 12 #include "content/public/browser/user_metrics.h" |
13 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
14 #include "content/public/common/context_menu_params.h" | 14 #include "content/public/common/context_menu_params.h" |
15 #include "content/public/common/page_transition_types.h" | 15 #include "content/public/common/page_transition_types.h" |
16 | 16 |
17 ContextMenuHandler::ContextMenuHandler() | 17 ContextMenuHandler::ContextMenuHandler() |
18 : weak_ptr_factory_(this) { | 18 : weak_ptr_factory_(this) { |
19 } | 19 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 void ContextMenuHandler::OpenUrl(const ListValue* args, | 103 void ContextMenuHandler::OpenUrl(const ListValue* args, |
104 WindowOpenDisposition disposition) { | 104 WindowOpenDisposition disposition) { |
105 string16 url = ExtractStringValue(args); | 105 string16 url = ExtractStringValue(args); |
106 if (!url.empty()) { | 106 if (!url.empty()) { |
107 web_ui()->GetWebContents()->OpenURL(content::OpenURLParams( | 107 web_ui()->GetWebContents()->OpenURL(content::OpenURLParams( |
108 GURL(url), content::Referrer(), disposition, | 108 GURL(url), content::Referrer(), disposition, |
109 content::PAGE_TRANSITION_AUTO_BOOKMARK, false)); | 109 content::PAGE_TRANSITION_AUTO_BOOKMARK, false)); |
110 } | 110 } |
111 } | 111 } |
OLD | NEW |