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

Side by Side Diff: chrome/browser/ui/webui/profiler_ui.cc

Issue 1182183003: Move EndsWith to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 (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/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
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 ProfilerWebUIDataSource() { 51 ProfilerWebUIDataSource() {
52 } 52 }
53 53
54 protected: 54 protected:
55 // content::URLDataSource implementation. 55 // content::URLDataSource implementation.
56 std::string GetSource() override { 56 std::string GetSource() override {
57 return chrome::kChromeUIProfilerHost; 57 return chrome::kChromeUIProfilerHost;
58 } 58 }
59 59
60 std::string GetMimeType(const std::string& path) const override { 60 std::string GetMimeType(const std::string& path) const override {
61 if (EndsWith(path, ".js", false)) 61 if (base::EndsWith(path, ".js", false))
62 return "application/javascript"; 62 return "application/javascript";
63 return "text/html"; 63 return "text/html";
64 } 64 }
65 65
66 void StartDataRequest( 66 void StartDataRequest(
67 const std::string& path, 67 const std::string& path,
68 bool is_incognito, 68 bool is_incognito,
69 const content::URLDataSource::GotDataCallback& callback) override { 69 const content::URLDataSource::GotDataCallback& callback) override {
70 base::FilePath base_path; 70 base::FilePath base_path;
71 PathService::Get(base::DIR_SOURCE_ROOT, &base_path); 71 PathService::Get(base::DIR_SOURCE_ROOT, &base_path);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 const metrics::ProfilerEvents& past_events) { 168 const metrics::ProfilerEvents& past_events) {
169 // Serialize the data to JSON. 169 // Serialize the data to JSON.
170 base::DictionaryValue json_data; 170 base::DictionaryValue json_data;
171 task_profiler::TaskProfilerDataSerializer::ToValue( 171 task_profiler::TaskProfilerDataSerializer::ToValue(
172 process_data_phase, attributes.process_id, attributes.process_type, 172 process_data_phase, attributes.process_id, attributes.process_type,
173 &json_data); 173 &json_data);
174 174
175 // Send the data to the renderer. 175 // Send the data to the renderer.
176 web_ui()->CallJavascriptFunction("g_browserBridge.receivedData", json_data); 176 web_ui()->CallJavascriptFunction("g_browserBridge.receivedData", json_data);
177 } 177 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/print_preview/print_preview_ui.cc ('k') | chrome/browser/web_applications/web_app_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698