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

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

Issue 105193002: Replace string16 with base::string16. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | Annotate | Revision Log
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/android/dev_tools_server.h" 5 #include "chrome/browser/android/dev_tools_server.h"
6 6
7 #include <pwd.h> 7 #include <pwd.h>
8 #include <cstring> 8 #include <cstring>
9 9
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 protected: 84 protected:
85 explicit TargetBase(WebContents* web_contents) 85 explicit TargetBase(WebContents* web_contents)
86 : title_(UTF16ToUTF8(web_contents->GetTitle())), 86 : title_(UTF16ToUTF8(web_contents->GetTitle())),
87 url_(web_contents->GetURL()), 87 url_(web_contents->GetURL()),
88 favicon_url_(GetFaviconURL(web_contents)), 88 favicon_url_(GetFaviconURL(web_contents)),
89 last_activity_time_(web_contents->GetLastSelectedTime()) { 89 last_activity_time_(web_contents->GetLastSelectedTime()) {
90 } 90 }
91 91
92 TargetBase(const string16& title, const GURL& url) 92 TargetBase(const base::string16& title, const GURL& url)
93 : title_(UTF16ToUTF8(title)), 93 : title_(UTF16ToUTF8(title)),
94 url_(url) 94 url_(url)
95 {} 95 {}
96 96
97 private: 97 private:
98 const std::string title_; 98 const std::string title_;
99 const GURL url_; 99 const GURL url_;
100 const GURL favicon_url_; 100 const GURL favicon_url_;
101 const base::TimeTicks last_activity_time_; 101 const base::TimeTicks last_activity_time_;
102 }; 102 };
103 103
104 class TabTarget : public TargetBase { 104 class TabTarget : public TargetBase {
105 public: 105 public:
106 static TabTarget* CreateForWebContents(int tab_id, 106 static TabTarget* CreateForWebContents(int tab_id,
107 WebContents* web_contents) { 107 WebContents* web_contents) {
108 return new TabTarget(tab_id, web_contents); 108 return new TabTarget(tab_id, web_contents);
109 } 109 }
110 110
111 static TabTarget* CreateForUnloadedTab(int tab_id, 111 static TabTarget* CreateForUnloadedTab(int tab_id,
112 const string16& title, 112 const base::string16& title,
113 const GURL& url) { 113 const GURL& url) {
114 return new TabTarget(tab_id, title, url); 114 return new TabTarget(tab_id, title, url);
115 } 115 }
116 116
117 // content::DevToolsTarget implementation: 117 // content::DevToolsTarget implementation:
118 virtual std::string GetId() const OVERRIDE { 118 virtual std::string GetId() const OVERRIDE {
119 return base::IntToString(tab_id_); 119 return base::IntToString(tab_id_);
120 } 120 }
121 121
122 virtual std::string GetType() const OVERRIDE { return kTargetTypePage; } 122 virtual std::string GetType() const OVERRIDE { return kTargetTypePage; }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 model->CloseTabAt(index); 167 model->CloseTabAt(index);
168 return true; 168 return true;
169 } 169 }
170 170
171 private: 171 private:
172 TabTarget(int tab_id, WebContents* web_contents) 172 TabTarget(int tab_id, WebContents* web_contents)
173 : TargetBase(web_contents), 173 : TargetBase(web_contents),
174 tab_id_(tab_id) { 174 tab_id_(tab_id) {
175 } 175 }
176 176
177 TabTarget(int tab_id, const string16& title, const GURL& url) 177 TabTarget(int tab_id, const base::string16& title, const GURL& url)
178 : TargetBase(title, url), 178 : TargetBase(title, url),
179 tab_id_(tab_id) { 179 tab_id_(tab_id) {
180 } 180 }
181 181
182 bool FindTab(TabModel** model_result, int* index_result) const { 182 bool FindTab(TabModel** model_result, int* index_result) const {
183 for (TabModelList::const_iterator iter = TabModelList::begin(); 183 for (TabModelList::const_iterator iter = TabModelList::begin();
184 iter != TabModelList::end(); ++iter) { 184 iter != TabModelList::end(); ++iter) {
185 TabModel* model = *iter; 185 TabModel* model = *iter;
186 for (int i = 0; i < model->GetTabCount(); ++i) { 186 for (int i = 0; i < model->GetTabCount(); ++i) {
187 TabAndroid* tab = model->GetTabAt(i); 187 TabAndroid* tab = model->GetTabAt(i);
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 jobject obj, 463 jobject obj,
464 jint server, 464 jint server,
465 jboolean enabled) { 465 jboolean enabled) {
466 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); 466 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server);
467 if (enabled) { 467 if (enabled) {
468 devtools_server->Start(); 468 devtools_server->Start();
469 } else { 469 } else {
470 devtools_server->Stop(); 470 devtools_server->Stop();
471 } 471 }
472 } 472 }
OLDNEW
« no previous file with comments | « chrome/browser/android/bookmarks/partner_bookmarks_shim_unittest.cc ('k') | chrome/browser/android/intent_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698