OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mash/task_viewer/task_viewer.h" | 5 #include "mash/task_viewer/task_viewer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 std::string name; | 81 std::string name; |
82 }; | 82 }; |
83 | 83 |
84 | 84 |
85 // Overridden from views::WidgetDelegate: | 85 // Overridden from views::WidgetDelegate: |
86 views::View* GetContentsView() override { return this; } | 86 views::View* GetContentsView() override { return this; } |
87 base::string16 GetWindowTitle() const override { | 87 base::string16 GetWindowTitle() const override { |
88 // TODO(beng): use resources. | 88 // TODO(beng): use resources. |
89 return base::ASCIIToUTF16("Tasks"); | 89 return base::ASCIIToUTF16("Tasks"); |
90 } | 90 } |
| 91 bool CanResize() const override { return true; } |
91 | 92 |
92 gfx::ImageSkia GetWindowAppIcon() override { | 93 gfx::ImageSkia GetWindowAppIcon() override { |
93 // TODO(jamescook): Create a new .pak file for this app and make a custom | 94 // TODO(jamescook): Create a new .pak file for this app and make a custom |
94 // icon, perhaps one that looks like the Chrome OS task viewer icon. | 95 // icon, perhaps one that looks like the Chrome OS task viewer icon. |
95 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 96 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
96 return *rb.GetImageSkiaNamed(IDR_NOTIFICATION_SETTINGS); | 97 return *rb.GetImageSkiaNamed(IDR_NOTIFICATION_SETTINGS); |
97 } | 98 } |
98 | 99 |
99 // Overridden from views::View: | 100 // Overridden from views::View: |
100 void Layout() override { | 101 void Layout() override { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 288 |
288 TaskViewerContents* task_viewer = new TaskViewerContents( | 289 TaskViewerContents* task_viewer = new TaskViewerContents( |
289 std::move(request), std::move(catalog)); | 290 std::move(request), std::move(catalog)); |
290 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( | 291 views::Widget* window = views::Widget::CreateWindowWithContextAndBounds( |
291 task_viewer, nullptr, gfx::Rect(10, 10, 500, 500)); | 292 task_viewer, nullptr, gfx::Rect(10, 10, 500, 500)); |
292 window->Show(); | 293 window->Show(); |
293 } | 294 } |
294 | 295 |
295 } // namespace task_viewer | 296 } // namespace task_viewer |
296 } // namespace main | 297 } // namespace main |
OLD | NEW |