OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiler_ui.h" | 5 #include "chrome/browser/ui/webui/profiler_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 // When testing the javacript code, it is cumbersome to have to keep | 9 // When testing the javacript code, it is cumbersome to have to keep |
10 // re-building the resouces package and reloading the browser. To solve | 10 // re-building the resouces package and reloading the browser. To solve |
11 // this, enable the following flag to read the webapp's source files | 11 // this, enable the following flag to read the webapp's source files |
12 // directly off disk, so all you have to do is refresh the page to | 12 // directly off disk, so all you have to do is refresh the page to |
13 // test the modifications. | 13 // test the modifications. |
14 //#define USE_SOURCE_FILES_DIRECTLY | 14 //#define USE_SOURCE_FILES_DIRECTLY |
15 | 15 |
16 #include "base/bind.h" | 16 #include "base/bind.h" |
17 #include "base/tracked_objects.h" | 17 #include "base/tracked_objects.h" |
18 #include "chrome/browser/metrics/tracking_synchronizer.h" | 18 #include "chrome/browser/metrics/tracking_synchronizer.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 20 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
21 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
22 #include "content/browser/trace_controller.h" | |
23 #include "content/public/browser/browser_thread.h" | 22 #include "content/public/browser/browser_thread.h" |
24 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
25 #include "content/public/browser/web_ui.h" | 24 #include "content/public/browser/web_ui.h" |
26 #include "content/public/browser/web_ui_message_handler.h" | 25 #include "content/public/browser/web_ui_message_handler.h" |
27 #include "grit/browser_resources.h" | 26 #include "grit/browser_resources.h" |
28 #include "grit/generated_resources.h" | 27 #include "grit/generated_resources.h" |
29 | 28 |
30 #ifdef USE_SOURCE_FILES_DIRECTLY | 29 #ifdef USE_SOURCE_FILES_DIRECTLY |
31 #include "base/base_paths.h" | 30 #include "base/base_paths.h" |
32 #include "base/file_util.h" | 31 #include "base/file_util.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 TrackingSynchronizer::FetchProfilerDataAsynchronously(ui_weak_ptr_); | 162 TrackingSynchronizer::FetchProfilerDataAsynchronously(ui_weak_ptr_); |
164 } | 163 } |
165 | 164 |
166 void ProfilerUI::ReceivedData(base::Value* value) { | 165 void ProfilerUI::ReceivedData(base::Value* value) { |
167 // Send the data to the renderer. | 166 // Send the data to the renderer. |
168 scoped_ptr<Value> data_values(value); | 167 scoped_ptr<Value> data_values(value); |
169 web_ui()->CallJavascriptFunction( | 168 web_ui()->CallJavascriptFunction( |
170 "g_browserBridge.receivedData", *data_values.get()); | 169 "g_browserBridge.receivedData", *data_values.get()); |
171 } | 170 } |
172 | 171 |
OLD | NEW |