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

Side by Side Diff: chrome/browser/views/options/content_page_view.cc

Issue 270081: Facelifts to sync UI (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | Annotate | Revision Log
OLDNEW
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/options/content_page_view.h" 5 #include "chrome/browser/views/options/content_page_view.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 #include <vsstyle.h> 9 #include <vsstyle.h>
10 #include <vssym32.h> 10 #include <vssym32.h>
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 gfx::Rect(), 121 gfx::Rect(),
122 new ImporterView(profile()))->Show(); 122 new ImporterView(profile()))->Show();
123 } else if (sender == clear_data_button_) { 123 } else if (sender == clear_data_button_) {
124 views::Window::CreateChromeWindow( 124 views::Window::CreateChromeWindow(
125 GetWindow()->GetNativeWindow(), 125 GetWindow()->GetNativeWindow(),
126 gfx::Rect(), 126 gfx::Rect(),
127 new ClearBrowsingDataView(profile()))->Show(); 127 new ClearBrowsingDataView(profile()))->Show();
128 #ifdef CHROME_PERSONALIZATION 128 #ifdef CHROME_PERSONALIZATION
129 } else if (sender == sync_start_stop_button_) { 129 } else if (sender == sync_start_stop_button_) {
130 DCHECK(sync_service_); 130 DCHECK(sync_service_);
131
131 if (sync_service_->HasSyncSetupCompleted()) { 132 if (sync_service_->HasSyncSetupCompleted()) {
132 sync_service_->DisableForUser(); 133 ConfirmMessageBoxDialog::RunWithCustomConfiguration(
133 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); 134 GetWindow()->GetNativeWindow(),
135 this,
136 l10n_util::GetString(IDS_SYNC_STOP_SYNCING_EXPLANATION_LABEL),
137 l10n_util::GetString(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL),
138 l10n_util::GetString(IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL),
139 l10n_util::GetString(IDS_CANCEL),
140 gfx::Size(views::Window::GetLocalizedContentsSize(
141 IDS_CONFIRM_STOP_SYNCING_DIALOG_WIDTH_CHARS,
142 IDS_CONFIRM_STOP_SYNCING_DIALOG_HEIGHT_LINES)));
143 return;
134 } else { 144 } else {
135 sync_service_->EnableForUser(); 145 sync_service_->EnableForUser();
136 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); 146 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS);
137 } 147 }
138 #endif 148 #endif
139 } 149 }
140 } 150 }
141 151
142 void ContentPageView::LinkActivated(views::Link* source, int event_flags) { 152 void ContentPageView::LinkActivated(views::Link* source, int event_flags) {
143 if (source == themes_gallery_link_) { 153 if (source == themes_gallery_link_) {
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 GridLayout::USE_PREF, 0, 0); 425 GridLayout::USE_PREF, 0, 0);
416 layout->StartRow(0, double_column_view_set_id); 426 layout->StartRow(0, double_column_view_set_id);
417 layout->AddView(import_button_); 427 layout->AddView(import_button_);
418 layout->AddView(clear_data_button_); 428 layout->AddView(clear_data_button_);
419 429
420 browsing_data_group_ = new OptionsGroupView( 430 browsing_data_group_ = new OptionsGroupView(
421 contents, l10n_util::GetString(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME), 431 contents, l10n_util::GetString(IDS_OPTIONS_BROWSING_DATA_GROUP_NAME),
422 L"", true); 432 L"", true);
423 } 433 }
424 434
435 void ContentPageView::OnConfirmMessageAccept() {
436 sync_service_->DisableForUser();
437 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS);
438 }
439
425 #ifdef CHROME_PERSONALIZATION 440 #ifdef CHROME_PERSONALIZATION
426 void ContentPageView::InitSyncGroup() { 441 void ContentPageView::InitSyncGroup() {
427 sync_status_label_ = new views::Label; 442 sync_status_label_ = new views::Label;
428 sync_status_label_->SetMultiLine(true); 443 sync_status_label_->SetMultiLine(true);
429 sync_status_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); 444 sync_status_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
430 445
431 sync_action_link_ = new views::Link(); 446 sync_action_link_ = new views::Link();
432 sync_action_link_->set_collapse_when_hidden(true); 447 sync_action_link_->set_collapse_when_hidden(true);
433 sync_action_link_->SetController(this); 448 sync_action_link_->SetController(this);
434 449
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 if (status_has_error) { 496 if (status_has_error) {
482 sync_status_label_->set_background(CreateErrorBackground()); 497 sync_status_label_->set_background(CreateErrorBackground());
483 sync_action_link_->set_background(CreateErrorBackground()); 498 sync_action_link_->set_background(CreateErrorBackground());
484 } else { 499 } else {
485 sync_status_label_->set_background(NULL); 500 sync_status_label_->set_background(NULL);
486 sync_action_link_->set_background(NULL); 501 sync_action_link_->set_background(NULL);
487 } 502 }
488 } 503 }
489 504
490 #endif 505 #endif
OLDNEW
« no previous file with comments | « chrome/browser/views/options/content_page_view.h ('k') | chrome/browser/views/sync/sync_setup_flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698