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 "chrome/browser/ui/views/extensions/shell_window_views.h" | 5 #include "chrome/browser/ui/views/extensions/shell_window_views.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/common/extensions/draggable_region.h" | 9 #include "chrome/common/extensions/draggable_region.h" |
10 #include "chrome/common/extensions/extension.h" | 10 #include "chrome/common/extensions/extension.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // views::View implementation. | 74 // views::View implementation. |
75 virtual gfx::Size GetPreferredSize() OVERRIDE; | 75 virtual gfx::Size GetPreferredSize() OVERRIDE; |
76 virtual void Layout() OVERRIDE; | 76 virtual void Layout() OVERRIDE; |
77 virtual std::string GetClassName() const OVERRIDE; | 77 virtual std::string GetClassName() const OVERRIDE; |
78 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 78 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
79 virtual gfx::Size GetMinimumSize() OVERRIDE; | 79 virtual gfx::Size GetMinimumSize() OVERRIDE; |
80 virtual gfx::Size GetMaximumSize() OVERRIDE; | 80 virtual gfx::Size GetMaximumSize() OVERRIDE; |
81 | 81 |
82 private: | 82 private: |
83 // views::ButtonListener implementation. | 83 // views::ButtonListener implementation. |
84 virtual void ButtonPressed(views::Button* sender, const views::Event& event) | 84 virtual void ButtonPressed(views::Button* sender, const ui::Event& event) |
85 OVERRIDE; | 85 OVERRIDE; |
86 | 86 |
87 ShellWindowViews* window_; | 87 ShellWindowViews* window_; |
88 views::Widget* frame_; | 88 views::Widget* frame_; |
89 views::ImageButton* close_button_; | 89 views::ImageButton* close_button_; |
90 | 90 |
91 DISALLOW_COPY_AND_ASSIGN(ShellWindowFrameView); | 91 DISALLOW_COPY_AND_ASSIGN(ShellWindowFrameView); |
92 }; | 92 }; |
93 | 93 |
94 const char ShellWindowFrameView::kViewClassName[] = | 94 const char ShellWindowFrameView::kViewClassName[] = |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 return max_size; | 289 return max_size; |
290 | 290 |
291 if (!max_size.IsEmpty()) { | 291 if (!max_size.IsEmpty()) { |
292 gfx::Rect client_bounds = GetBoundsForClientView(); | 292 gfx::Rect client_bounds = GetBoundsForClientView(); |
293 max_size.Enlarge(0, client_bounds.y()); | 293 max_size.Enlarge(0, client_bounds.y()); |
294 } | 294 } |
295 return max_size; | 295 return max_size; |
296 } | 296 } |
297 | 297 |
298 void ShellWindowFrameView::ButtonPressed(views::Button* sender, | 298 void ShellWindowFrameView::ButtonPressed(views::Button* sender, |
299 const views::Event& event) { | 299 const ui::Event& event) { |
300 DCHECK(!window_->frameless()); | 300 DCHECK(!window_->frameless()); |
301 if (sender == close_button_) | 301 if (sender == close_button_) |
302 frame_->Close(); | 302 frame_->Close(); |
303 } | 303 } |
304 | 304 |
305 ShellWindowViews::ShellWindowViews(Profile* profile, | 305 ShellWindowViews::ShellWindowViews(Profile* profile, |
306 const extensions::Extension* extension, | 306 const extensions::Extension* extension, |
307 const GURL& url, | 307 const GURL& url, |
308 const ShellWindow::CreateParams& win_params) | 308 const ShellWindow::CreateParams& win_params) |
309 : ShellWindow(profile, extension, url), | 309 : ShellWindow(profile, extension, url), |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 OnViewWasResized(); | 579 OnViewWasResized(); |
580 } | 580 } |
581 | 581 |
582 // static | 582 // static |
583 ShellWindow* ShellWindow::CreateImpl(Profile* profile, | 583 ShellWindow* ShellWindow::CreateImpl(Profile* profile, |
584 const extensions::Extension* extension, | 584 const extensions::Extension* extension, |
585 const GURL& url, | 585 const GURL& url, |
586 const ShellWindow::CreateParams& params) { | 586 const ShellWindow::CreateParams& params) { |
587 return new ShellWindowViews(profile, extension, url, params); | 587 return new ShellWindowViews(profile, extension, url, params); |
588 } | 588 } |
OLD | NEW |