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

Side by Side Diff: chrome/browser/ui/webui/task_manager/task_manager_dialog.cc

Issue 10353007: Extract a minimal subset of WebDialogUI/WebDialogDelegate from src/chrome -> src/ui/web_dialogs Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 7 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) 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/webui/task_manager/task_manager_dialog.h" 5 #include "chrome/browser/ui/webui/task_manager/task_manager_dialog.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/memory/singleton.h" 13 #include "base/memory/singleton.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
16 #include "chrome/browser/defaults.h" 16 #include "chrome/browser/defaults.h"
17 #include "chrome/browser/platform_util.h" 17 #include "chrome/browser/platform_util.h"
18 #include "chrome/browser/prefs/pref_service.h" 18 #include "chrome/browser/prefs/pref_service.h"
19 #include "chrome/browser/prefs/scoped_user_pref_update.h" 19 #include "chrome/browser/prefs/scoped_user_pref_update.h"
20 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/ui/browser.h" 21 #include "chrome/browser/ui/browser.h"
22 #include "chrome/browser/ui/browser_dialogs.h" 22 #include "chrome/browser/ui/browser_dialogs.h"
23 #include "chrome/browser/ui/browser_list.h" 23 #include "chrome/browser/ui/browser_list.h"
24 #include "chrome/browser/ui/webui/web_dialog_ui.h" 24 #include "ui/web_dialogs/web_dialog_ui.h"
25 #include "chrome/common/chrome_switches.h" 25 #include "chrome/common/chrome_switches.h"
26 #include "chrome/common/pref_names.h" 26 #include "chrome/common/pref_names.h"
27 #include "chrome/common/url_constants.h" 27 #include "chrome/common/url_constants.h"
28 #include "grit/google_chrome_strings.h" 28 #include "grit/google_chrome_strings.h"
29 #include "ui/base/l10n/l10n_util.h" 29 #include "ui/base/l10n/l10n_util.h"
30 30
31 #if defined(OS_CHROMEOS) 31 #if defined(OS_CHROMEOS)
32 #include "ui/views/widget/widget.h" 32 #include "ui/views/widget/widget.h"
33 #endif 33 #endif
34 34
35 namespace { 35 namespace {
36 36
37 // The minimum size of task manager window in px. 37 // The minimum size of task manager window in px.
38 const int kMinimumTaskManagerWidth = 640; 38 const int kMinimumTaskManagerWidth = 640;
39 const int kMinimumTaskManagerHeight = 480; 39 const int kMinimumTaskManagerHeight = 480;
40 40
41 } // namespace 41 } // namespace
42 42
43 using content::BrowserThread; 43 using content::BrowserThread;
44 using content::WebContents; 44 using content::WebContents;
45 using content::WebUIMessageHandler; 45 using content::WebUIMessageHandler;
46 46
47 class TaskManagerDialogImpl : public WebDialogDelegate { 47 class TaskManagerDialogImpl : public views::WebDialogDelegate {
48 public: 48 public:
49 TaskManagerDialogImpl(); 49 TaskManagerDialogImpl();
50 50
51 static void Show(bool is_background_page_mode); 51 static void Show(bool is_background_page_mode);
52 static TaskManagerDialogImpl* GetInstance(); 52 static TaskManagerDialogImpl* GetInstance();
53 53
54 protected: 54 protected:
55 friend struct DefaultSingletonTraits<TaskManagerDialogImpl>; 55 friend struct DefaultSingletonTraits<TaskManagerDialogImpl>;
56 virtual ~TaskManagerDialogImpl(); 56 virtual ~TaskManagerDialogImpl();
57 57
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 BrowserThread::PostTask( 210 BrowserThread::PostTask(
211 BrowserThread::UI, FROM_HERE, 211 BrowserThread::UI, FROM_HERE,
212 base::Bind(&TaskManagerDialogImpl::Show, true)); 212 base::Bind(&TaskManagerDialogImpl::Show, true));
213 } 213 }
214 214
215 // static 215 // static
216 bool TaskManagerDialog::UseWebUITaskManager() { 216 bool TaskManagerDialog::UseWebUITaskManager() {
217 return CommandLine::ForCurrentProcess()->HasSwitch( 217 return CommandLine::ForCurrentProcess()->HasSwitch(
218 switches::kWebUITaskManager); 218 switches::kWebUITaskManager);
219 } 219 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698