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

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

Issue 11411286: Decouple IsMetroProcess() calls, introducing IsSingleWindowMetroMode(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: keep base/win/metro.h in omnibox_view_win.cc for IsTSFAwareRequired() 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/tabs/tab_strip.cc ('k') | chrome/chrome_browser.gypi » ('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/task_manager/task_manager.h" 5 #include "chrome/browser/task_manager/task_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/metrics/stats_table.h" 9 #include "base/metrics/stats_table.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 20 matching lines...) Expand all
31 #include "ui/views/controls/link_listener.h" 31 #include "ui/views/controls/link_listener.h"
32 #include "ui/views/controls/menu/menu.h" 32 #include "ui/views/controls/menu/menu.h"
33 #include "ui/views/controls/table/group_table_model.h" 33 #include "ui/views/controls/table/group_table_model.h"
34 #include "ui/views/controls/table/group_table_view.h" 34 #include "ui/views/controls/table/group_table_view.h"
35 #include "ui/views/controls/table/table_view_observer.h" 35 #include "ui/views/controls/table/table_view_observer.h"
36 #include "ui/views/layout/layout_constants.h" 36 #include "ui/views/layout/layout_constants.h"
37 #include "ui/views/widget/widget.h" 37 #include "ui/views/widget/widget.h"
38 #include "ui/views/window/dialog_delegate.h" 38 #include "ui/views/window/dialog_delegate.h"
39 39
40 #if defined(OS_WIN) 40 #if defined(OS_WIN)
41 #include "base/win/metro.h" 41 #include "win8/util/win8_util.h"
42 #endif 42 #endif
43 43
44 // The task manager window default size. 44 // The task manager window default size.
45 static const int kDefaultWidth = 460; 45 static const int kDefaultWidth = 460;
46 static const int kDefaultHeight = 270; 46 static const int kDefaultHeight = 270;
47 47
48 // Yellow highlight used when highlighting background resources. 48 // Yellow highlight used when highlighting background resources.
49 static const SkColor kBackgroundResourceHighlight = 49 static const SkColor kBackgroundResourceHighlight =
50 SkColorSetRGB(0xff, 0xf1, 0xcd); 50 SkColorSetRGB(0xff, 0xf1, 0xcd);
51 51
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 link_prefered_height); 579 link_prefered_height);
580 } 580 }
581 581
582 gfx::Size TaskManagerView::GetPreferredSize() { 582 gfx::Size TaskManagerView::GetPreferredSize() {
583 return gfx::Size(kDefaultWidth, kDefaultHeight); 583 return gfx::Size(kDefaultWidth, kDefaultHeight);
584 } 584 }
585 585
586 // static 586 // static
587 void TaskManagerView::Show(bool highlight_background_resources) { 587 void TaskManagerView::Show(bool highlight_background_resources) {
588 // In Windows Metro it's not good to open this native window. 588 // In Windows Metro it's not good to open this native window.
589 DCHECK(!base::win::IsMetroProcess()); 589 DCHECK(!win8::IsSingleWindowMetroMode());
590 590
591 if (instance_) { 591 if (instance_) {
592 if (instance_->highlight_background_resources_ != 592 if (instance_->highlight_background_resources_ !=
593 highlight_background_resources) { 593 highlight_background_resources) {
594 instance_->GetWidget()->Close(); 594 instance_->GetWidget()->Close();
595 } else { 595 } else {
596 // If there's a Task manager window open already, just activate it. 596 // If there's a Task manager window open already, just activate it.
597 instance_->GetWidget()->Activate(); 597 instance_->GetWidget()->Activate();
598 return; 598 return;
599 } 599 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 // Declared in browser_dialogs.h so others don't need to depend on our header. 807 // Declared in browser_dialogs.h so others don't need to depend on our header.
808 void ShowTaskManager() { 808 void ShowTaskManager() {
809 TaskManagerView::Show(false); 809 TaskManagerView::Show(false);
810 } 810 }
811 811
812 void ShowBackgroundPages() { 812 void ShowBackgroundPages() {
813 TaskManagerView::Show(true); 813 TaskManagerView::Show(true);
814 } 814 }
815 815
816 } // namespace chrome 816 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698