| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/about_network_dialog.h" | 5 #include "chrome/browser/views/about_network_dialog.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/thread.h" | 8 #include "base/thread.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
| 11 #include "net/url_request/url_request_job.h" | 11 #include "net/url_request/url_request_job.h" |
| 12 #include "net/url_request/url_request_job_tracker.h" | 12 #include "net/url_request/url_request_job_tracker.h" |
| 13 #include "views/grid_layout.h" | 13 #include "views/grid_layout.h" |
| 14 #include "views/controls/button/text_button.h" | 14 #include "views/controls/button/text_button.h" |
| 15 #include "views/controls/text_field.h" | 15 #include "views/controls/textfield/textfield.h" |
| 16 #include "views/standard_layout.h" | 16 #include "views/standard_layout.h" |
| 17 #include "views/window/window.h" | 17 #include "views/window/window.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // We don't localize this UI since this is a developer-only feature. | 21 // We don't localize this UI since this is a developer-only feature. |
| 22 const wchar_t kStartTrackingLabel[] = L"Start tracking"; | 22 const wchar_t kStartTrackingLabel[] = L"Start tracking"; |
| 23 const wchar_t kStopTrackingLabel[] = L"Stop tracking"; | 23 const wchar_t kStopTrackingLabel[] = L"Stop tracking"; |
| 24 const wchar_t kShowCurrentLabel[] = L"Show Current"; | 24 const wchar_t kShowCurrentLabel[] = L"Show Current"; |
| 25 const wchar_t kClearLabel[] = L"Clear"; | 25 const wchar_t kClearLabel[] = L"Clear"; |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 } | 293 } |
| 294 | 294 |
| 295 void AboutNetworkDialog::SetupControls() { | 295 void AboutNetworkDialog::SetupControls() { |
| 296 views::GridLayout* layout = CreatePanelGridLayout(this); | 296 views::GridLayout* layout = CreatePanelGridLayout(this); |
| 297 SetLayoutManager(layout); | 297 SetLayoutManager(layout); |
| 298 | 298 |
| 299 track_toggle_ = new views::TextButton(this, kStartTrackingLabel); | 299 track_toggle_ = new views::TextButton(this, kStartTrackingLabel); |
| 300 show_button_ = new views::TextButton(this, kShowCurrentLabel); | 300 show_button_ = new views::TextButton(this, kShowCurrentLabel); |
| 301 clear_button_ = new views::TextButton(this, kClearLabel); | 301 clear_button_ = new views::TextButton(this, kClearLabel); |
| 302 | 302 |
| 303 text_field_ = new views::TextField(static_cast<views::TextField::StyleFlags>( | 303 text_field_ = new views::Textfield(static_cast<views::Textfield::StyleFlags>( |
| 304 views::TextField::STYLE_MULTILINE)); | 304 views::Textfield::STYLE_MULTILINE)); |
| 305 text_field_->SetReadOnly(true); | 305 text_field_->SetReadOnly(true); |
| 306 | 306 |
| 307 // TODO(brettw): We may want to add this in the future. It can't be called | 307 // TODO(brettw): We may want to add this in the future. It can't be called |
| 308 // from here, though, since the hwnd for the field hasn't been created yet. | 308 // from here, though, since the hwnd for the field hasn't been created yet. |
| 309 // | 309 // |
| 310 // This raises the maximum number of chars from 32K to some large maximum, | 310 // This raises the maximum number of chars from 32K to some large maximum, |
| 311 // probably 2GB. 32K is not nearly enough for our use-case. | 311 // probably 2GB. 32K is not nearly enough for our use-case. |
| 312 //SendMessageW(text_field_->GetNativeComponent(), EM_SETLIMITTEXT, 0, 0); | 312 //SendMessageW(text_field_->GetNativeComponent(), EM_SETLIMITTEXT, 0, 0); |
| 313 | 313 |
| 314 static const int first_column_set = 1; | 314 static const int first_column_set = 1; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 tracking_ = true; | 367 tracking_ = true; |
| 368 tracker->StartTracking(); | 368 tracker->StartTracking(); |
| 369 } | 369 } |
| 370 track_toggle_->SchedulePaint(); | 370 track_toggle_->SchedulePaint(); |
| 371 } else if (button == show_button_) { | 371 } else if (button == show_button_) { |
| 372 tracker->ReportStatus(); | 372 tracker->ReportStatus(); |
| 373 } else if (button == clear_button_) { | 373 } else if (button == clear_button_) { |
| 374 text_field_->SetText(std::wstring()); | 374 text_field_->SetText(std::wstring()); |
| 375 } | 375 } |
| 376 } | 376 } |
| OLD | NEW |