| 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/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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } else { | 137 } else { |
| 138 sync_service_->EnableForUser(); | 138 sync_service_->EnableForUser(); |
| 139 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); | 139 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 } | 142 } |
| 143 | 143 |
| 144 void ContentPageView::LinkActivated(views::Link* source, int event_flags) { | 144 void ContentPageView::LinkActivated(views::Link* source, int event_flags) { |
| 145 if (source == themes_gallery_link_) { | 145 if (source == themes_gallery_link_) { |
| 146 UserMetricsRecordAction(L"Options_ThemesGallery", profile()->GetPrefs()); | 146 UserMetricsRecordAction(L"Options_ThemesGallery", profile()->GetPrefs()); |
| 147 Browser* browser = BrowserList::GetLastActive(); | 147 BrowserList::GetLastActive()->OpenThemeGalleryTabAndActivate(); |
| 148 browser->OpenURL(GURL(l10n_util::GetString(IDS_THEMES_GALLERY_URL)), | |
| 149 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); | |
| 150 browser->window()->Activate(); | |
| 151 return; | 148 return; |
| 152 } | 149 } |
| 153 DCHECK_EQ(source, sync_action_link_); | 150 DCHECK_EQ(source, sync_action_link_); |
| 154 DCHECK(sync_service_); | 151 DCHECK(sync_service_); |
| 155 sync_service_->ShowLoginDialog(); | 152 sync_service_->ShowLoginDialog(); |
| 156 } | 153 } |
| 157 | 154 |
| 158 //////////////////////////////////////////////////////////////////////////////// | 155 //////////////////////////////////////////////////////////////////////////////// |
| 159 // ContentPageView, OptionsPageView implementation: | 156 // ContentPageView, OptionsPageView implementation: |
| 160 | 157 |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 sync_action_link_->SetText(link_label); | 474 sync_action_link_->SetText(link_label); |
| 478 sync_action_link_->SetVisible(!link_label.empty()); | 475 sync_action_link_->SetVisible(!link_label.empty()); |
| 479 if (status_has_error) { | 476 if (status_has_error) { |
| 480 sync_status_label_->set_background(CreateErrorBackground()); | 477 sync_status_label_->set_background(CreateErrorBackground()); |
| 481 sync_action_link_->set_background(CreateErrorBackground()); | 478 sync_action_link_->set_background(CreateErrorBackground()); |
| 482 } else { | 479 } else { |
| 483 sync_status_label_->set_background(NULL); | 480 sync_status_label_->set_background(NULL); |
| 484 sync_action_link_->set_background(NULL); | 481 sync_action_link_->set_background(NULL); |
| 485 } | 482 } |
| 486 } | 483 } |
| OLD | NEW |