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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_view_views.cc

Issue 273223002: views: Make view::Views::GetPreferredSize() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More compile fix for ToT Created 6 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/views/extensions/extension_view_views.h" 5 #include "chrome/browser/ui/views/extensions/extension_view_views.h"
6 6
7 #include "chrome/browser/ui/views/extensions/extension_popup.h" 7 #include "chrome/browser/ui/views/extensions/extension_popup.h"
8 #include "content/public/browser/content_browser_client.h" 8 #include "content/public/browser/content_browser_client.h"
9 #include "content/public/browser/render_view_host.h" 9 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/render_widget_host_view.h" 10 #include "content/public/browser/render_widget_host_view.h"
(...skipping 19 matching lines...) Expand all
30 // called so the tab key events are forwarded to the renderer. 30 // called so the tab key events are forwarded to the renderer.
31 SetFocusable(true); 31 SetFocusable(true);
32 } 32 }
33 33
34 ExtensionViewViews::~ExtensionViewViews() { 34 ExtensionViewViews::~ExtensionViewViews() {
35 if (parent()) 35 if (parent())
36 parent()->RemoveChildView(this); 36 parent()->RemoveChildView(this);
37 CleanUp(); 37 CleanUp();
38 } 38 }
39 39
40 gfx::Size ExtensionViewViews::GetMinimumSize() { 40 gfx::Size ExtensionViewViews::GetMinimumSize() const {
41 // If the minimum size has never been set, returns the preferred size (same 41 // If the minimum size has never been set, returns the preferred size (same
42 // behavior as views::View). 42 // behavior as views::View).
43 return (minimum_size_ == gfx::Size()) ? GetPreferredSize() : minimum_size_; 43 return (minimum_size_ == gfx::Size()) ? GetPreferredSize() : minimum_size_;
44 } 44 }
45 45
46 void ExtensionViewViews::SetVisible(bool is_visible) { 46 void ExtensionViewViews::SetVisible(bool is_visible) {
47 if (is_visible != visible()) { 47 if (is_visible != visible()) {
48 NativeViewHost::SetVisible(is_visible); 48 NativeViewHost::SetVisible(is_visible);
49 49
50 // Also tell RenderWidgetHostView the new visibility. Despite its name, it 50 // Also tell RenderWidgetHostView the new visibility. Despite its name, it
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 } 157 }
158 158
159 void ExtensionViewViews::CleanUp() { 159 void ExtensionViewViews::CleanUp() {
160 if (!initialized_) 160 if (!initialized_)
161 return; 161 return;
162 if (native_view()) 162 if (native_view())
163 Detach(); 163 Detach();
164 initialized_ = false; 164 initialized_ = false;
165 } 165 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_view_views.h ('k') | chrome/browser/ui/views/find_bar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698