| OLD | NEW |
| 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 "ui/oak/oak_window.h" | 5 #include "ui/oak/oak_window.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
| 9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 61 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 62 return *rb.GetImageNamed(IDR_OAK).ToImageSkia(); | 62 return *rb.GetImageNamed(IDR_OAK).ToImageSkia(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool OakWindow::ShouldShowWindowIcon() const { | 65 bool OakWindow::ShouldShowWindowIcon() const { |
| 66 return true; | 66 return true; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void OakWindow::DeleteDelegate() { | 69 void OakWindow::DeleteDelegate() { |
| 70 instance = NULL; | 70 instance = NULL; |
| 71 delete this; |
| 71 } | 72 } |
| 72 | 73 |
| 73 //////////////////////////////////////////////////////////////////////////////// | 74 //////////////////////////////////////////////////////////////////////////////// |
| 74 // OakWindow, views::View overrides: | 75 // OakWindow, views::View overrides: |
| 75 | 76 |
| 76 void OakWindow::OnPaint(gfx::Canvas* canvas) { | 77 void OakWindow::OnPaint(gfx::Canvas* canvas) { |
| 77 canvas->DrawColor(SK_ColorWHITE); | 78 canvas->DrawColor(SK_ColorWHITE); |
| 78 canvas->FillRect(separator_rect_, kBorderColor); | 79 canvas->FillRect(separator_rect_, kBorderColor); |
| 79 } | 80 } |
| 80 | 81 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // context? For now, this is OK, but if we ever use Oak outside of the ash | 153 // context? For now, this is OK, but if we ever use Oak outside of the ash |
| 153 // shell, we run into crbug.com/165759. | 154 // shell, we run into crbug.com/165759. |
| 154 internal::OakWindow::instance = | 155 internal::OakWindow::instance = |
| 155 views::Widget::CreateWindowWithContextAndBounds( | 156 views::Widget::CreateWindowWithContextAndBounds( |
| 156 new internal::OakWindow, context, gfx::Rect(10, 10, 500, 500)); | 157 new internal::OakWindow, context, gfx::Rect(10, 10, 500, 500)); |
| 157 } | 158 } |
| 158 internal::OakWindow::instance->Show(); | 159 internal::OakWindow::instance->Show(); |
| 159 } | 160 } |
| 160 | 161 |
| 161 } // namespace oak | 162 } // namespace oak |
| OLD | NEW |