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

Side by Side Diff: ash/wm/caption_buttons/maximize_bubble_controller_bubble.cc

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further renaming Created 6 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/wm/caption_buttons/maximize_bubble_controller_bubble.h" 5 #include "ash/wm/caption_buttons/maximize_bubble_controller_bubble.h"
6 6
7 #include "ash/metrics/user_metrics_recorder.h" 7 #include "ash/metrics/user_metrics_recorder.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "ash/wm/caption_buttons/bubble_contents_button_row.h" 10 #include "ash/wm/caption_buttons/bubble_contents_button_row.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 buttons_view_ = new BubbleContentsButtonRow(bubble); 69 buttons_view_ = new BubbleContentsButtonRow(bubble);
70 AddChildView(buttons_view_); 70 AddChildView(buttons_view_);
71 71
72 label_view_ = new views::Label(); 72 label_view_ = new views::Label();
73 SetSnapType(initial_snap_type); 73 SetSnapType(initial_snap_type);
74 label_view_->SetBackgroundColor( 74 label_view_->SetBackgroundColor(
75 MaximizeBubbleControllerBubble::kBubbleBackgroundColor); 75 MaximizeBubbleControllerBubble::kBubbleBackgroundColor);
76 const SkColor kBubbleTextColor = SK_ColorWHITE; 76 const SkColor kBubbleTextColor = SK_ColorWHITE;
77 label_view_->SetEnabledColor(kBubbleTextColor); 77 label_view_->SetEnabledColor(kBubbleTextColor);
78 const int kLabelSpacing = 4; 78 const int kLabelSpacing = 4;
79 label_view_->set_border(views::Border::CreateEmptyBorder( 79 label_view_->SetBorder(views::Border::CreateEmptyBorder(
80 kLabelSpacing, 0, kLabelSpacing, 0)); 80 kLabelSpacing, 0, kLabelSpacing, 0));
81 AddChildView(label_view_); 81 AddChildView(label_view_);
82 } 82 }
83 83
84 BubbleContentsView::~BubbleContentsView() { 84 BubbleContentsView::~BubbleContentsView() {
85 } 85 }
86 86
87 // Set the label content to reflect the currently selected |snap_type|. 87 // Set the label content to reflect the currently selected |snap_type|.
88 // This function can be executed through the frame maximize button as well as 88 // This function can be executed through the frame maximize button as well as
89 // through hover operations. 89 // through hover operations.
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 371
372 // Note that the returned widget has an observer which points to our 372 // Note that the returned widget has an observer which points to our
373 // functions. 373 // functions.
374 bubble_widget_ = views::BubbleDelegateView::CreateBubble(this); 374 bubble_widget_ = views::BubbleDelegateView::CreateBubble(this);
375 bubble_widget_->set_focus_on_creation(false); 375 bubble_widget_->set_focus_on_creation(false);
376 376
377 SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); 377 SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
378 bubble_widget_->non_client_view()->frame_view()->set_background(NULL); 378 bubble_widget_->non_client_view()->frame_view()->set_background(NULL);
379 379
380 bubble_border_ = new MaximizeBubbleBorder(this, GetAnchorView()); 380 bubble_border_ = new MaximizeBubbleBorder(this, GetAnchorView());
381 GetBubbleFrameView()->SetBubbleBorder(bubble_border_); 381 GetBubbleFrameView()->SetBubbleBorder(
382 scoped_ptr<views::BubbleBorder>(bubble_border_));
382 GetBubbleFrameView()->set_background(NULL); 383 GetBubbleFrameView()->set_background(NULL);
383 384
384 // Recalculate size with new border. 385 // Recalculate size with new border.
385 SizeToContents(); 386 SizeToContents();
386 387
387 if (!appearance_delay_ms_) 388 if (!appearance_delay_ms_)
388 GetWidget()->Show(); 389 GetWidget()->Show();
389 else 390 else
390 StartFade(true); 391 StartFade(true);
391 392
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 if (contents_view_) 524 if (contents_view_)
524 contents_view_->SetSnapType(snap_type); 525 contents_view_->SetSnapType(snap_type);
525 } 526 }
526 527
527 views::CustomButton* MaximizeBubbleControllerBubble::GetButtonForUnitTest( 528 views::CustomButton* MaximizeBubbleControllerBubble::GetButtonForUnitTest(
528 SnapType state) { 529 SnapType state) {
529 return contents_view_->GetButtonForUnitTest(state); 530 return contents_view_->GetButtonForUnitTest(state);
530 } 531 }
531 532
532 } // namespace ash 533 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698