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

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

Issue 276072: The login dialog was being opened with the main browser window as a parent in... (Closed) Base URL: http://src.chromium.org/svn/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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 this, 135 this,
136 l10n_util::GetString(IDS_SYNC_STOP_SYNCING_EXPLANATION_LABEL), 136 l10n_util::GetString(IDS_SYNC_STOP_SYNCING_EXPLANATION_LABEL),
137 l10n_util::GetString(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL), 137 l10n_util::GetString(IDS_SYNC_STOP_SYNCING_BUTTON_LABEL),
138 l10n_util::GetString(IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL), 138 l10n_util::GetString(IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL),
139 l10n_util::GetString(IDS_CANCEL), 139 l10n_util::GetString(IDS_CANCEL),
140 gfx::Size(views::Window::GetLocalizedContentsSize( 140 gfx::Size(views::Window::GetLocalizedContentsSize(
141 IDS_CONFIRM_STOP_SYNCING_DIALOG_WIDTH_CHARS, 141 IDS_CONFIRM_STOP_SYNCING_DIALOG_WIDTH_CHARS,
142 IDS_CONFIRM_STOP_SYNCING_DIALOG_HEIGHT_LINES))); 142 IDS_CONFIRM_STOP_SYNCING_DIALOG_HEIGHT_LINES)));
143 return; 143 return;
144 } else { 144 } else {
145 sync_service_->EnableForUser(); 145 sync_service_->EnableForUser(GetWindow()->GetNativeWindow());
146 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); 146 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS);
147 } 147 }
148 #endif 148 #endif
149 } 149 }
150 } 150 }
151 151
152 void ContentPageView::LinkActivated(views::Link* source, int event_flags) { 152 void ContentPageView::LinkActivated(views::Link* source, int event_flags) {
153 if (source == themes_gallery_link_) { 153 if (source == themes_gallery_link_) {
154 UserMetricsRecordAction(L"Options_ThemesGallery", profile()->GetPrefs()); 154 UserMetricsRecordAction(L"Options_ThemesGallery", profile()->GetPrefs());
155 BrowserList::GetLastActive()->OpenURL( 155 BrowserList::GetLastActive()->OpenURL(
156 GURL(l10n_util::GetString(IDS_THEMES_GALLERY_URL)), 156 GURL(l10n_util::GetString(IDS_THEMES_GALLERY_URL)),
157 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK); 157 GURL(), NEW_FOREGROUND_TAB, PageTransition::LINK);
158 return; 158 return;
159 } 159 }
160 #ifdef CHROME_PERSONALIZATION 160 #ifdef CHROME_PERSONALIZATION
161 DCHECK_EQ(source, sync_action_link_); 161 DCHECK_EQ(source, sync_action_link_);
162 DCHECK(sync_service_); 162 DCHECK(sync_service_);
163 sync_service_->ShowLoginDialog(); 163 sync_service_->ShowLoginDialog(GetWindow()->GetNativeWindow());
164 #endif 164 #endif
165 } 165 }
166 166
167 //////////////////////////////////////////////////////////////////////////////// 167 ////////////////////////////////////////////////////////////////////////////////
168 // ContentPageView, OptionsPageView implementation: 168 // ContentPageView, OptionsPageView implementation:
169 169
170 void ContentPageView::InitControlLayout() { 170 void ContentPageView::InitControlLayout() {
171 using views::GridLayout; 171 using views::GridLayout;
172 using views::ColumnSet; 172 using views::ColumnSet;
173 173
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 if (status_has_error) { 496 if (status_has_error) {
497 sync_status_label_->set_background(CreateErrorBackground()); 497 sync_status_label_->set_background(CreateErrorBackground());
498 sync_action_link_->set_background(CreateErrorBackground()); 498 sync_action_link_->set_background(CreateErrorBackground());
499 } else { 499 } else {
500 sync_status_label_->set_background(NULL); 500 sync_status_label_->set_background(NULL);
501 sync_action_link_->set_background(NULL); 501 sync_action_link_->set_background(NULL);
502 } 502 }
503 } 503 }
504 504
505 #endif 505 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698