Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(625)

Side by Side Diff: chrome/browser/android/tab_android.cc

Issue 2771233002: Remove the wrapper functions content::RecordAction et al (Closed)
Patch Set: Rebased Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/metrics/histogram_macros.h" 12 #include "base/metrics/histogram_macros.h"
13 #include "base/metrics/user_metrics.h"
13 #include "base/trace_event/trace_event.h" 14 #include "base/trace_event/trace_event.h"
14 #include "cc/layers/layer.h" 15 #include "cc/layers/layer.h"
15 #include "chrome/browser/android/compositor/tab_content_manager.h" 16 #include "chrome/browser/android/compositor/tab_content_manager.h"
16 #include "chrome/browser/android/metrics/uma_utils.h" 17 #include "chrome/browser/android/metrics/uma_utils.h"
17 #include "chrome/browser/android/offline_pages/offline_page_bridge.h" 18 #include "chrome/browser/android/offline_pages/offline_page_bridge.h"
18 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" 19 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h"
19 #include "chrome/browser/android/offline_pages/offline_page_utils.h" 20 #include "chrome/browser/android/offline_pages/offline_page_utils.h"
20 #include "chrome/browser/android/tab_web_contents_delegate_android.h" 21 #include "chrome/browser/android/tab_web_contents_delegate_android.h"
21 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 22 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
22 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" 23 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "components/sessions/core/tab_restore_service.h" 64 #include "components/sessions/core/tab_restore_service.h"
64 #include "components/url_formatter/url_fixer.h" 65 #include "components/url_formatter/url_fixer.h"
65 #include "content/public/browser/android/compositor.h" 66 #include "content/public/browser/android/compositor.h"
66 #include "content/public/browser/browser_thread.h" 67 #include "content/public/browser/browser_thread.h"
67 #include "content/public/browser/interstitial_page.h" 68 #include "content/public/browser/interstitial_page.h"
68 #include "content/public/browser/navigation_entry.h" 69 #include "content/public/browser/navigation_entry.h"
69 #include "content/public/browser/notification_service.h" 70 #include "content/public/browser/notification_service.h"
70 #include "content/public/browser/render_frame_host.h" 71 #include "content/public/browser/render_frame_host.h"
71 #include "content/public/browser/render_process_host.h" 72 #include "content/public/browser/render_process_host.h"
72 #include "content/public/browser/render_view_host.h" 73 #include "content/public/browser/render_view_host.h"
73 #include "content/public/browser/user_metrics.h"
74 #include "content/public/browser/web_contents.h" 74 #include "content/public/browser/web_contents.h"
75 #include "content/public/common/browser_controls_state.h" 75 #include "content/public/common/browser_controls_state.h"
76 #include "content/public/common/resource_request_body.h" 76 #include "content/public/common/resource_request_body.h"
77 #include "jni/Tab_jni.h" 77 #include "jni/Tab_jni.h"
78 #include "net/base/escape.h" 78 #include "net/base/escape.h"
79 #include "services/service_manager/public/cpp/interface_provider.h" 79 #include "services/service_manager/public/cpp/interface_provider.h"
80 #include "skia/ext/image_operations.h" 80 #include "skia/ext/image_operations.h"
81 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" 81 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
82 #include "ui/android/view_android.h" 82 #include "ui/android/view_android.h"
83 #include "ui/android/window_android.h" 83 #include "ui/android/window_android.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 GURL fixed_url( 488 GURL fixed_url(
489 url_formatter::FixupURL(gurl.possibly_invalid_spec(), std::string())); 489 url_formatter::FixupURL(gurl.possibly_invalid_spec(), std::string()));
490 if (!fixed_url.is_valid()) 490 if (!fixed_url.is_valid())
491 return PAGE_LOAD_FAILED; 491 return PAGE_LOAD_FAILED;
492 492
493 if (!HandleNonNavigationAboutURL(fixed_url)) { 493 if (!HandleNonNavigationAboutURL(fixed_url)) {
494 // Record UMA "ShowHistory" here. That way it'll pick up both user 494 // Record UMA "ShowHistory" here. That way it'll pick up both user
495 // typing chrome://history as well as selecting from the drop down menu. 495 // typing chrome://history as well as selecting from the drop down menu.
496 if (fixed_url.spec() == chrome::kChromeUIHistoryURL) { 496 if (fixed_url.spec() == chrome::kChromeUIHistoryURL) {
497 content::RecordAction(base::UserMetricsAction("ShowHistory")); 497 base::RecordAction(base::UserMetricsAction("ShowHistory"));
498 } 498 }
499 499
500 content::NavigationController::LoadURLParams load_params(fixed_url); 500 content::NavigationController::LoadURLParams load_params(fixed_url);
501 if (j_extra_headers) { 501 if (j_extra_headers) {
502 load_params.extra_headers = base::android::ConvertJavaStringToUTF8( 502 load_params.extra_headers = base::android::ConvertJavaStringToUTF8(
503 env, 503 env,
504 j_extra_headers); 504 j_extra_headers);
505 } 505 }
506 if (j_post_data) { 506 if (j_post_data) {
507 load_params.load_type = 507 load_params.load_type =
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 795 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
796 TRACE_EVENT0("native", "TabAndroid::Init"); 796 TRACE_EVENT0("native", "TabAndroid::Init");
797 // This will automatically bind to the Java object and pass ownership there. 797 // This will automatically bind to the Java object and pass ownership there.
798 new TabAndroid(env, obj); 798 new TabAndroid(env, obj);
799 } 799 }
800 800
801 // static 801 // static
802 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { 802 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
803 return RegisterNativesImpl(env); 803 return RegisterNativesImpl(env);
804 } 804 }
OLDNEW
« no previous file with comments | « chrome/browser/android/metrics/uma_session_stats.cc ('k') | chrome/browser/android/webapps/add_to_homescreen_data_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698