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

Side by Side Diff: chrome/browser/ui/views/uninstall_view.cc

Issue 11571023: Move ash/wm's DialogFrameView to ui/views/window; etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reorder DialogDelegate functions; inline Get*Params into WidgetExample::ButtonPressed; etc. Created 8 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
« no previous file with comments | « chrome/browser/ui/views/uninstall_view.h ('k') | ui/views/examples/widget_example.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/views/uninstall_view.h" 5 #include "chrome/browser/ui/views/uninstall_view.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/process_util.h" 8 #include "base/process_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "chrome/browser/shell_integration.h" 10 #include "chrome/browser/shell_integration.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // Disable the browsers combobox if the user unchecks the checkbox. 142 // Disable the browsers combobox if the user unchecks the checkbox.
143 DCHECK(browsers_combo_); 143 DCHECK(browsers_combo_);
144 browsers_combo_->SetEnabled(change_default_browser_->checked()); 144 browsers_combo_->SetEnabled(change_default_browser_->checked());
145 } 145 }
146 } 146 }
147 147
148 string16 UninstallView::GetWindowTitle() const { 148 string16 UninstallView::GetWindowTitle() const {
149 return l10n_util::GetStringUTF16(IDS_UNINSTALL_CHROME); 149 return l10n_util::GetStringUTF16(IDS_UNINSTALL_CHROME);
150 } 150 }
151 151
152 views::View* UninstallView::GetContentsView() {
153 return this;
154 }
155
156 int UninstallView::GetItemCount() const { 152 int UninstallView::GetItemCount() const {
157 DCHECK(!browsers_->empty()); 153 DCHECK(!browsers_->empty());
158 return browsers_->size(); 154 return browsers_->size();
159 } 155 }
160 156
161 string16 UninstallView::GetItemAt(int index) { 157 string16 UninstallView::GetItemAt(int index) {
162 DCHECK_LT(index, static_cast<int>(browsers_->size())); 158 DCHECK_LT(index, static_cast<int>(browsers_->size()));
163 BrowsersMap::const_iterator i = browsers_->begin(); 159 BrowsersMap::const_iterator i = browsers_->begin();
164 std::advance(i, index); 160 std::advance(i, index);
165 return i->first; 161 return i->first;
166 } 162 }
167 163
168 namespace chrome { 164 namespace chrome {
169 165
170 int ShowUninstallBrowserPrompt(bool show_delete_profile) { 166 int ShowUninstallBrowserPrompt(bool show_delete_profile) {
171 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); 167 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
172 int result = content::RESULT_CODE_NORMAL_EXIT; 168 int result = content::RESULT_CODE_NORMAL_EXIT;
173 views::AcceleratorHandler accelerator_handler; 169 views::AcceleratorHandler accelerator_handler;
174 base::RunLoop run_loop(&accelerator_handler); 170 base::RunLoop run_loop(&accelerator_handler);
175 UninstallView* view = new UninstallView(&result, 171 UninstallView* view = new UninstallView(&result,
176 run_loop.QuitClosure(), 172 run_loop.QuitClosure(),
177 show_delete_profile); 173 show_delete_profile);
178 views::Widget::CreateWindow(view)->Show(); 174 views::Widget::CreateWindow(view)->Show();
179 run_loop.Run(); 175 run_loop.Run();
180 return result; 176 return result;
181 } 177 }
182 178
183 } // namespace chrome 179 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/uninstall_view.h ('k') | ui/views/examples/widget_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698