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

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

Issue 10959045: Switch WebIntentPickerController to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 887
888 // Indicate if dialog should display its own close button. 888 // Indicate if dialog should display its own close button.
889 // TODO(groby): Only relevant until new ConstrainedWindow is implemented, 889 // TODO(groby): Only relevant until new ConstrainedWindow is implemented,
890 // from then on always true. 890 // from then on always true.
891 bool use_close_button_; 891 bool use_close_button_;
892 892
893 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerViews); 893 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerViews);
894 }; 894 };
895 895
896 // static 896 // static
897 WebIntentPicker* WebIntentPicker::Create(TabContents* tab_contents, 897 WebIntentPicker* WebIntentPicker::Create(content::WebContents* web_contents,
898 WebIntentPickerDelegate* delegate, 898 WebIntentPickerDelegate* delegate,
899 WebIntentPickerModel* model) { 899 WebIntentPickerModel* model) {
900 TabContents* tab_contents = TabContents::FromWebContents(web_contents);
900 return new WebIntentPickerViews(tab_contents, delegate, model); 901 return new WebIntentPickerViews(tab_contents, delegate, model);
901 } 902 }
902 903
903 WebIntentPickerViews::WebIntentPickerViews(TabContents* tab_contents, 904 WebIntentPickerViews::WebIntentPickerViews(TabContents* tab_contents,
904 WebIntentPickerDelegate* delegate, 905 WebIntentPickerDelegate* delegate,
905 WebIntentPickerModel* model) 906 WebIntentPickerModel* model)
906 : delegate_(delegate), 907 : delegate_(delegate),
907 model_(model), 908 model_(model),
908 action_label_(NULL), 909 action_label_(NULL),
909 suggestions_label_(NULL), 910 suggestions_label_(NULL),
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 SizeToContents(); 1334 SizeToContents();
1334 } 1335 }
1335 1336
1336 void WebIntentPickerViews::SizeToContents() { 1337 void WebIntentPickerViews::SizeToContents() {
1337 gfx::Size client_size = contents_->GetPreferredSize(); 1338 gfx::Size client_size = contents_->GetPreferredSize();
1338 gfx::Rect client_bounds(client_size); 1339 gfx::Rect client_bounds(client_size);
1339 gfx::Rect new_window_bounds = window_->non_client_view()->frame_view()-> 1340 gfx::Rect new_window_bounds = window_->non_client_view()->frame_view()->
1340 GetWindowBoundsForClientBounds(client_bounds); 1341 GetWindowBoundsForClientBounds(client_bounds);
1341 window_->CenterWindow(new_window_bounds.size()); 1342 window_->CenterWindow(new_window_bounds.size());
1342 } 1343 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698