project
string
commit_id
string
target
int64
func
string
cwe
string
big_vul_idx
string
idx
int64
hash
string
size
float64
message
string
dataset
string
Chrome
6d067124e87295721c62a77f0610e4b37f6098ad
0
v8::Handle<v8::Value> V8ThrowException::throwDOMException(int ec, const String& sanitizedMessage, const String& unsanitizedMessage, const v8::Handle<v8::Object>& creationContext, v8::Isolate* isolate) { ASSERT(ec == SecurityError || unsanitizedMessage.isEmpty()); v8::Handle<v8::Value> exception = createDOMException(isolate, ec, sanitizedMessage, unsanitizedMessage, creationContext); if (exception.IsEmpty()) return v8Undefined(); return V8ThrowException::throwException(exception, isolate); }
140871
125,906
83282090160072350649440660819587619629
null
null
null
Chrome
6d067124e87295721c62a77f0610e4b37f6098ad
0
v8::Handle<v8::Value> V8ThrowException::throwReferenceError(v8::Isolate* isolate, const String& message) { v8::Handle<v8::Value> exception = V8ThrowException::createReferenceError(isolate, message); return V8ThrowException::throwException(exception, isolate); }
140875
125,907
210038859775056790799252890856783423769
null
null
null
Chrome
6d067124e87295721c62a77f0610e4b37f6098ad
0
v8::Handle<v8::Value> V8ThrowException::throwSyntaxError(v8::Isolate* isolate, const String& message) { v8::Handle<v8::Value> exception = V8ThrowException::createSyntaxError(isolate, message); return V8ThrowException::throwException(exception, isolate); }
140876
125,908
182592320519854534150736309505742011121
null
null
null
Chrome
6d067124e87295721c62a77f0610e4b37f6098ad
0
v8::Handle<v8::Value> V8ThrowException::throwTypeError(v8::Isolate* isolate, const String& message) { v8::Handle<v8::Value> exception = V8ThrowException::createTypeError(isolate, message); return V8ThrowException::throwException(exception, isolate); }
140877
125,909
252353560046613871116836431592557385901
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
gfx::Rect OverlayWindowViews::CalculateAndUpdateWindowBounds() { gfx::Rect work_area = display::Screen::GetScreen() ->GetDisplayNearestWindow( controller_->GetInitiatorWebContents()->GetTopLevelNativeWindow()) .work_area(); max_size_ = gfx::Size(work_area.width() / 2, work_area.height() / 2); min_size_ = kMinWindowSize; gfx::Size window_size = window_bounds_.size(); if (!has_been_shown_) { window_size = gfx::Size(work_area.width() / 5, work_area.height() / 5); window_size.set_width(std::min( max_size_.width(), std::max(min_size_.width(), window_size.width()))); window_size.set_height( std::min(max_size_.height(), std::max(min_size_.height(), window_size.height()))); } if (!window_size.IsEmpty() && !natural_size_.IsEmpty()) { float aspect_ratio = (float)natural_size_.width() / natural_size_.height(); gfx::Rect window_rect(GetBounds().origin(), window_size); views::WindowResizeUtils::SizeRectToAspectRatio( views::HitTest::kBottomRight, aspect_ratio, min_size_, max_size_, &window_rect); window_size.SetSize(window_rect.width(), window_rect.height()); UpdateLayerBoundsWithLetterboxing(window_size); } gfx::Point origin = window_bounds_.origin(); int window_diff_width = work_area.right() - window_size.width(); int window_diff_height = work_area.bottom() - window_size.height(); int buffer = (window_diff_width + window_diff_height) / 2 * 0.02; gfx::Point default_origin = gfx::Point(window_diff_width - buffer, window_diff_height - buffer); if (has_been_shown_) { origin.SetToMin(default_origin); } else { origin = default_origin; } window_bounds_ = gfx::Rect(origin, window_size); return window_bounds_; }
156010
139,210
78404058547357704725886679484529893159
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
gfx::Rect OverlayWindowViews::CalculateControlsBounds(int x, const gfx::Size& size) { return gfx::Rect( gfx::Point(x, (GetBounds().size().height() - size.height()) / 2), size); }
156011
139,211
209341576784638749885885978290955569205
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::Close() { views::Widget::Close(); }
156012
139,212
180777529460939945745968534661236227414
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
std::unique_ptr<content::OverlayWindow> content::OverlayWindow::Create( content::PictureInPictureWindowController* controller) { return base::WrapUnique(new OverlayWindowViews(controller)); }
156013
139,213
159436890699736153632108138147977557834
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::CreateCustomControl( std::unique_ptr<views::ControlImageButton>& control_button, const blink::PictureInPictureControlInfo& info, ControlPosition position) { control_button = std::make_unique<views::ControlImageButton>(this); controls_parent_view_->AddChildView(control_button.get()); control_button->set_id(info.id); control_button->set_owned_by_client(); control_button->SetImageAlignment(views::ImageButton::ALIGN_CENTER, views::ImageButton::ALIGN_MIDDLE); UpdateCustomControlsSize(control_button.get()); UpdateControlsBounds(); base::string16 custom_button_label = base::UTF8ToUTF16(info.label); control_button->SetAccessibleName(custom_button_label); control_button->SetTooltipText(custom_button_label); control_button->SetInstallFocusRingOnFocus(true); control_button->SetFocusForPlatform(); }
156014
139,214
265641277797393735591817559887893711589
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
gfx::Rect OverlayWindowViews::GetBounds() const { return views::Widget::GetRestoredBounds(); }
156015
139,215
256146453129838049558024602102570437285
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
gfx::Rect OverlayWindowViews::GetCloseControlsBounds() { return close_controls_view_->GetMirroredBounds(); }
156016
139,216
71556621328162249607161740910536540356
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
ui::Layer* OverlayWindowViews::GetControlsParentLayer() { return controls_parent_view_->layer(); }
156018
139,217
314357757137584127483324095442306589449
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
ui::Layer* OverlayWindowViews::GetControlsScrimLayer() { return controls_scrim_view_->layer(); }
156019
139,218
201133684729613746846747125115322785278
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
OverlayWindowViews::WindowQuadrant GetCurrentWindowQuadrant( const gfx::Rect window_bounds, content::PictureInPictureWindowController* controller) { gfx::Rect work_area = display::Screen::GetScreen() ->GetDisplayNearestWindow( controller->GetInitiatorWebContents()->GetTopLevelNativeWindow()) .work_area(); gfx::Point window_center = window_bounds.CenterPoint(); if (window_center.x() < work_area.width() / 2) { return (window_center.y() < work_area.height() / 2) ? OverlayWindowViews::WindowQuadrant::kTopLeft : OverlayWindowViews::WindowQuadrant::kBottomLeft; } return (window_center.y() < work_area.height() / 2) ? OverlayWindowViews::WindowQuadrant::kTopRight : OverlayWindowViews::WindowQuadrant::kBottomRight; }
156020
139,219
302736870146830004844462183615948287956
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
gfx::Rect OverlayWindowViews::GetFirstCustomControlsBounds() { if (!first_custom_controls_view_) return gfx::Rect(); return first_custom_controls_view_->GetMirroredBounds(); }
156021
139,220
301120450789669239444216016296921335123
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
ui::Layer* OverlayWindowViews::GetLayer() { return views::Widget::GetLayer(); }
156022
139,221
278898250700352402080781625999842378188
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
gfx::Size OverlayWindowViews::GetMaximumSize() const { return max_size_; }
156023
139,222
268814949695381845574725978064797062631
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
gfx::Rect OverlayWindowViews::GetPlayPauseControlsBounds() { return play_pause_controls_view_->GetMirroredBounds(); }
156025
139,223
94006868834590268190907719020475686182
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
ui::Layer* OverlayWindowViews::GetResizeHandleLayer() { return resize_handle_view_->layer(); }
156026
139,224
326719211097409904458445305655540233774
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
gfx::Rect OverlayWindowViews::GetSecondCustomControlsBounds() { if (!second_custom_controls_view_) return gfx::Rect(); return second_custom_controls_view_->GetMirroredBounds(); }
156027
139,225
261657669366456276034520103319243000639
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
gfx::Rect OverlayWindowViews::GetVideoBounds() { return video_bounds_; }
156028
139,226
278409812106868434795206954043467735867
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
ui::Layer* OverlayWindowViews::GetVideoLayer() { return video_view_->layer(); }
156029
139,227
139947515706974484563025595230489461506
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
ui::Layer* OverlayWindowViews::GetWindowBackgroundLayer() { return window_background_view_->layer(); }
156030
139,228
123642330652134161831493576719727268210
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
bool OverlayWindowViews::HasOnlyOneCustomControl() { return first_custom_controls_view_ && !second_custom_controls_view_; }
156031
139,229
91672753910484838432972837183624954932
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::Hide() { views::Widget::Hide(); }
156032
139,230
174953382116643611740880538115422403504
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
bool OverlayWindowViews::IsActive() const { return views::Widget::IsActive(); }
156033
139,231
122144379943129526263972600109784868615
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
bool OverlayWindowViews::IsAlwaysOnTop() const { return true; }
156034
139,232
208395108423013585144754348201991689094
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
bool OverlayWindowViews::IsVisible() const { return views::Widget::IsVisible(); }
156035
139,233
327842768056721897979651867307621749823
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::OnKeyEvent(ui::KeyEvent* event) { hide_controls_timer_.Reset(); if (event->type() == ui::ET_KEY_PRESSED || event->key_code() == ui::VKEY_TAB) { UpdateControlsVisibility(true); } #if defined(OS_MACOSX) if (event->type() == ui::ET_KEY_PRESSED && event->key_code() == ui::VKEY_SPACE) { TogglePlayPause(); event->SetHandled(); } #endif // OS_MACOSX #if defined(OS_WIN) if (event->type() == ui::ET_KEY_PRESSED && event->IsAltDown() && event->key_code() == ui::VKEY_F4) { controller_->Close(true /* should_pause_video */, true /* should_reset_pip_player */); event->SetHandled(); } #endif // OS_WIN views::Widget::OnKeyEvent(event); }
156036
139,234
12578411226628927336415100030845490548
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::OnNativeBlur() { if (is_initialized_) UpdateControlsVisibility(false); views::Widget::OnNativeBlur(); }
156037
139,235
230933097199477431973798159630830401496
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::OnNativeWidgetDestroyed() { controller_->OnWindowDestroyed(); }
156038
139,236
182949044766287284473959192993922888809
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::OnNativeWidgetMove() { if (is_initialized_) UpdateControlsVisibility(false); window_bounds_ = GetBounds(); #if defined(OS_CHROMEOS) WindowQuadrant quadrant = GetCurrentWindowQuadrant(GetBounds(), controller_); close_controls_view_->SetPosition(GetBounds().size(), quadrant); resize_handle_view_->SetPosition(GetBounds().size(), quadrant); #endif }
156039
139,237
82189719343077977667532883714911179865
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::OnNativeWidgetWorkspaceChanged() { }
156040
139,238
145694512239431049295664777512298048759
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
explicit OverlayWindowFrameView(views::Widget* widget) : widget_(widget) {}
156041
139,239
40754719712651241103020832998596435234
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
explicit OverlayWindowWidgetDelegate(views::Widget* widget) : widget_(widget) { DCHECK(widget_); }
156043
139,240
228729371324982084471285181681077071045
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::SetAlwaysHidePlayPauseButton(bool is_visible) { always_hide_play_pause_button_ = !is_visible; }
156044
139,241
329562621277167591557356992052996587872
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::SetPictureInPictureCustomControls( const std::vector<blink::PictureInPictureControlInfo>& controls) { first_custom_controls_view_.reset(); second_custom_controls_view_.reset(); if (controls.size() > 0) CreateCustomControl(first_custom_controls_view_, controls[0], ControlPosition::kLeft); if (controls.size() > 1) CreateCustomControl(second_custom_controls_view_, controls[1], ControlPosition::kRight); }
156045
139,242
309360453868501288952684750383017377073
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::SetPlaybackState(PlaybackState playback_state) { bool controls_parent_layer_visible = GetControlsParentLayer()->visible(); playback_state_ = playback_state; switch (playback_state_) { case kPlaying: play_pause_controls_view_->SetToggled(true); controls_parent_view_->SetVisible(true); video_view_->SetVisible(true); GetControlsParentLayer()->SetVisible(controls_parent_layer_visible); break; case kPaused: play_pause_controls_view_->SetToggled(false); controls_parent_view_->SetVisible(true); video_view_->SetVisible(true); GetControlsParentLayer()->SetVisible(controls_parent_layer_visible); break; case kNoVideo: controls_scrim_view_->SetVisible(false); controls_parent_view_->SetVisible(false); video_view_->SetVisible(false); GetControlsParentLayer()->SetVisible(false); break; } }
156046
139,243
77990553001859885902376411052557186929
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::SetUpViews() { gfx::Rect larger_window_bounds = GetBounds(); larger_window_bounds.Inset(-1, -1); window_background_view_->SetSize(larger_window_bounds.size()); window_background_view_->SetPaintToLayer(ui::LAYER_SOLID_COLOR); GetWindowBackgroundLayer()->SetColor(SK_ColorBLACK); controls_scrim_view_->SetSize(GetBounds().size()); controls_scrim_view_->SetPaintToLayer(ui::LAYER_SOLID_COLOR); GetControlsScrimLayer()->SetColor(gfx::kGoogleGrey900); GetControlsScrimLayer()->SetOpacity(0.43f); controls_parent_view_->SetPaintToLayer(ui::LAYER_TEXTURED); controls_parent_view_->SetSize(GetBounds().size()); controls_parent_view_->layer()->SetFillsBoundsOpaquely(false); controls_parent_view_->set_owned_by_client(); close_controls_view_->SetPaintToLayer(ui::LAYER_TEXTURED); close_controls_view_->layer()->SetFillsBoundsOpaquely(false); close_controls_view_->set_owned_by_client(); video_view_->SetPaintToLayer(ui::LAYER_TEXTURED); play_pause_controls_view_->SetImageAlignment( views::ImageButton::ALIGN_CENTER, views::ImageButton::ALIGN_MIDDLE); play_pause_controls_view_->SetToggled(controller_->IsPlayerActive()); play_pause_controls_view_->set_owned_by_client(); #if defined(OS_CHROMEOS) resize_handle_view_->SetPaintToLayer(ui::LAYER_TEXTURED); resize_handle_view_->layer()->SetFillsBoundsOpaquely(false); resize_handle_view_->set_owned_by_client(); #endif play_pause_controls_view_->SetFocusForPlatform(); // Make button focusable. const base::string16 play_pause_accessible_button_label( l10n_util::GetStringUTF16( IDS_PICTURE_IN_PICTURE_PLAY_PAUSE_CONTROL_ACCESSIBLE_TEXT)); play_pause_controls_view_->SetAccessibleName( play_pause_accessible_button_label); const base::string16 play_button_label( l10n_util::GetStringUTF16(IDS_PICTURE_IN_PICTURE_PLAY_CONTROL_TEXT)); play_pause_controls_view_->SetTooltipText(play_button_label); const base::string16 pause_button_label( l10n_util::GetStringUTF16(IDS_PICTURE_IN_PICTURE_PAUSE_CONTROL_TEXT)); play_pause_controls_view_->SetToggledTooltipText(pause_button_label); play_pause_controls_view_->SetInstallFocusRingOnFocus(true); controls_parent_view_->AddChildView(play_pause_controls_view_.get()); GetContentsView()->AddChildView(controls_scrim_view_.get()); GetContentsView()->AddChildView(controls_parent_view_.get()); GetContentsView()->AddChildView(close_controls_view_.get()); #if defined(OS_CHROMEOS) GetContentsView()->AddChildView(resize_handle_view_.get()); #endif UpdatePlayPauseControlsSize(); UpdateControlsVisibility(false); }
156047
139,244
53313990378663632616210196455083591474
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::Show() { views::Widget::Show(); has_been_shown_ = true; }
156048
139,245
83032280430612891971786830694025285817
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::TogglePlayPause() { bool is_active = controller_->TogglePlayPause(); play_pause_controls_view_->SetToggled(is_active); }
156049
139,246
187264438110589997663232529122624549444
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::UpdateButtonSize() { const gfx::Size window_size = GetBounds().size(); int scaled_button_dimension = window_size.width() < window_size.height() ? window_size.width() * kControlRatioToWindow : window_size.height() * kControlRatioToWindow; int new_button_dimension = std::max(kMinControlButtonSize, scaled_button_dimension); button_size_.SetSize(new_button_dimension, new_button_dimension); }
156050
139,247
9425993194693268532218932197755830618
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::UpdateControlsBounds() { gfx::Rect larger_window_bounds = GetBounds(); larger_window_bounds.Inset(-1, -1); controls_scrim_view_->SetBoundsRect( gfx::Rect(gfx::Point(0, 0), larger_window_bounds.size())); WindowQuadrant quadrant = GetCurrentWindowQuadrant(GetBounds(), controller_); close_controls_view_->SetPosition(GetBounds().size(), quadrant); #if defined(OS_CHROMEOS) resize_handle_view_->SetPosition(GetBounds().size(), quadrant); #endif controls_parent_view_->SetBoundsRect( gfx::Rect(gfx::Point(0, 0), GetBounds().size())); UpdateControlsPositions(); }
156051
139,248
37978632559101286639193585142236048344
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::UpdateControlsPositions() { int mid_window_x = GetBounds().size().width() / 2; if (HasOnlyOneCustomControl()) { play_pause_controls_view_->SetBoundsRect( CalculateControlsBounds(mid_window_x, button_size_)); first_custom_controls_view_->SetBoundsRect(CalculateControlsBounds( mid_window_x - button_size_.width(), button_size_)); return; } play_pause_controls_view_->SetBoundsRect(CalculateControlsBounds( mid_window_x - button_size_.width() / 2, button_size_)); if (first_custom_controls_view_ && second_custom_controls_view_) { first_custom_controls_view_->SetBoundsRect(CalculateControlsBounds( mid_window_x - button_size_.width() / 2 - button_size_.width(), button_size_)); second_custom_controls_view_->SetBoundsRect(CalculateControlsBounds( mid_window_x + button_size_.width() / 2, button_size_)); } }
156052
139,249
175764936815197555216617254987523637023
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::UpdateControlsVisibility(bool is_visible) { if (always_hide_play_pause_button_ && is_visible) play_pause_controls_view_->SetVisible(false); GetCloseControlsLayer()->SetVisible(is_visible); #if defined(OS_CHROMEOS) GetResizeHandleLayer()->SetVisible(is_visible); #endif GetControlsScrimLayer()->SetVisible( (playback_state_ == kNoVideo) ? false : is_visible); GetControlsParentLayer()->SetVisible( (playback_state_ == kNoVideo) ? false : is_visible); }
156053
139,250
105586072765703410437875484664351246970
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::UpdateCustomControlsSize( views::ControlImageButton* control_button) { if (!control_button) return; UpdateButtonSize(); control_button->SetSize(button_size_); if (control_button == first_custom_controls_view_.get()) { first_custom_controls_view_->SetImage( views::Button::STATE_NORMAL, gfx::CreateVectorIcon(vector_icons::kPlayArrowIcon, button_size_.width() / 2, kControlIconColor)); } if (control_button == second_custom_controls_view_.get()) { second_custom_controls_view_->SetImage( views::Button::STATE_NORMAL, gfx::CreateVectorIcon(vector_icons::kPauseIcon, button_size_.width() / 2, kControlIconColor)); } const gfx::ImageSkia control_background = gfx::CreateVectorIcon( kPictureInPictureControlBackgroundIcon, button_size_.width(), kBgColor); control_button->SetBackgroundImage(kBgColor, &control_background, &control_background); }
156054
139,251
295427637911053551225136020369886556579
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::UpdateLayerBoundsWithLetterboxing( gfx::Size window_size) { if (window_bounds_.size().IsEmpty() || natural_size_.IsEmpty()) return; gfx::Rect letterbox_region = media::ComputeLetterboxRegion( gfx::Rect(gfx::Point(0, 0), window_size), natural_size_); if (letterbox_region.IsEmpty()) return; gfx::Size letterbox_size = letterbox_region.size(); gfx::Point origin = gfx::Point((window_size.width() - letterbox_size.width()) / 2, (window_size.height() - letterbox_size.height()) / 2); video_bounds_.set_origin(origin); video_bounds_.set_size(letterbox_region.size()); UpdateControlsBounds(); controller_->UpdateLayerBounds(); }
156055
139,252
103593278941862061952320186483297401019
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::UpdatePlayPauseControlsSize() { UpdateButtonSize(); play_pause_controls_view_->SetSize(button_size_); play_pause_controls_view_->SetImage( views::Button::STATE_NORMAL, gfx::CreateVectorIcon(vector_icons::kPlayArrowIcon, button_size_.width() / 2, kControlIconColor)); gfx::ImageSkia pause_icon = gfx::CreateVectorIcon( vector_icons::kPauseIcon, button_size_.width() / 2, kControlIconColor); play_pause_controls_view_->SetToggledImage(views::Button::STATE_NORMAL, &pause_icon); const gfx::ImageSkia play_pause_background = gfx::CreateVectorIcon( kPictureInPictureControlBackgroundIcon, button_size_.width(), kBgColor); play_pause_controls_view_->SetBackgroundImage( kBgColor, &play_pause_background, &play_pause_background); }
156056
139,253
320629130648991479275117593830291594941
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::UpdateVideoSize(const gfx::Size& natural_size) { DCHECK(!natural_size.IsEmpty()); natural_size_ = natural_size; SetAspectRatio(gfx::SizeF(natural_size_)); SetBounds(CalculateAndUpdateWindowBounds()); }
156057
139,254
52186466942124240413164214316681567021
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
views::View* OverlayWindowViews::controls_parent_view_for_testing() const { return controls_parent_view_.get(); }
156059
139,255
221247355258925619604880879050473673014
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
OverlayWindowViews::play_pause_controls_view_for_testing() const { return play_pause_controls_view_.get(); }
156060
139,256
259446990466895062489909445465264979525
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
OverlayWindowViews::playback_state_for_testing() const { return playback_state_; }
156061
139,257
296533191758991171518087969552465310449
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
gfx::Point OverlayWindowViews::resize_handle_position_for_testing() const { return resize_handle_view_->origin(); }
156062
139,258
193008068634421069088550146452075574470
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
void UpdateNetworkManagerStatus() { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, NewRunnableMethod(this, &NetworkLibraryImpl::UpdateNetworkManagerStatus)); return; } SystemInfo* system = GetSystemInfo(); if (!system) return; std::string prev_cellular_service_path = cellular_ ? cellular_->service_path() : std::string(); ClearNetworks(); ParseSystem(system, &ethernet_, &wifi_networks_, &cellular_networks_, &remembered_wifi_networks_); wifi_ = NULL; for (size_t i = 0; i < wifi_networks_.size(); i++) { if (wifi_networks_[i]->connecting_or_connected()) { wifi_ = wifi_networks_[i]; break; // There is only one connected or connecting wifi network. } } cellular_ = NULL; for (size_t i = 0; i < cellular_networks_.size(); i++) { if (cellular_networks_[i]->connecting_or_connected()) { cellular_ = cellular_networks_[i]; // If new cellular, then request update of the data plan list. if (cellular_networks_[i]->service_path() != prev_cellular_service_path) { RefreshCellularDataPlans(cellular_); } break; // There is only one connected or connecting cellular network. } } available_devices_ = system->available_technologies; enabled_devices_ = system->enabled_technologies; connected_devices_ = system->connected_technologies; offline_mode_ = system->offline_mode; NotifyNetworkManagerChanged(); FreeSystemInfo(system); }
183616
161,819
92997797723041762508904764591667886709
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
int64 ClientUsageTracker::GetCachedHostUsage(const std::string& host) { int64 ClientUsageTracker::GetCachedHostUsage(const std::string& host) const { HostUsageMap::const_iterator found = cached_usage_.find(host); if (found == cached_usage_.end()) return 0; int64 usage = 0; const UsageMap& map = found->second; for (UsageMap::const_iterator iter = map.begin(); iter != map.end(); ++iter) { usage += iter->second; } return usage; }
183644
161,841
24354693861516917416012794700730845981
null
null
null
Chrome
45bae236b03f577ed6682ef4c7ef3ee006de5e5a
0
void AddInstallerCopyTasks(const InstallerState& installer_state, const FilePath& setup_path, const FilePath& archive_path, const FilePath& temp_path, const Version& new_version, WorkItemList* install_list) { DCHECK(install_list); FilePath installer_dir(installer_state.GetInstallerDirectory(new_version)); install_list->AddCreateDirWorkItem(installer_dir); FilePath exe_dst(installer_dir.Append(setup_path.BaseName())); FilePath archive_dst(installer_dir.Append(archive_path.BaseName())); install_list->AddCopyTreeWorkItem(setup_path.value(), exe_dst.value(), temp_path.value(), WorkItem::ALWAYS); // otherwise), there is no need to do this for the archive. Setup.exe, on // the other hand, is created elsewhere so it must always be copied. install_list->AddMoveTreeWorkItem(archive_path.value(), archive_dst.value(), temp_path.value(), WorkItem::ALWAYS_MOVE); }
184084
162,224
84288856139483710775440958819699261404
null
null
null
Chrome
3c1864079c441ea2e08f882acaaf441f78a6de3d
0
bool decode(ArgumentDecoder* decoder, RetainPtr<CFURLRef>& result) { RetainPtr<CFURLRef> baseURL; bool hasBaseURL; if (!decoder->decodeBool(hasBaseURL)) return false; if (hasBaseURL) { if (!decode(decoder, baseURL)) return false; } RetainPtr<CFStringRef> string; if (!decode(decoder, string)) return false; #if PLATFORM(MAC) // FIXME: Move this to ArgumentCodersCFMac.mm and change this file back to be C++ // instead of Objective-C++. if (!CFStringGetLength(string.get())) { // CFURL can't hold an empty URL, unlike NSURL. result = reinterpret_cast<CFURLRef>([NSURL URLWithString:@""]); return true; } #endif CFURLRef url = CFURLCreateWithString(0, string.get(), baseURL.get()); if (!url) return false; result.adoptCF(url); return true; }
184202
162,322
315018138351705334660192363324138616137
null
null
null
Chrome
2bfb2b8299e2fb6a432390a93a99a85fed1d29c9
0
void WebProcessProxy::addExistingWebPage(WebPageProxy* webPage, uint64_t pageID) { m_pageMap.set(pageID, webPage); globalPageMap().set(pageID, webPage); #if PLATFORM(MAC) if (pageIsProcessSuppressible(webPage)) m_processSuppressiblePages.add(pageID); updateProcessSuppressionState(); #endif }
184482
162,556
338971982493218642816785510823451581642
null
null
null
Chrome
6d067124e87295721c62a77f0610e4b37f6098ad
0
v8::Handle<v8::Value> V8ThrowException::createDOMException(v8::Isolate* isolate, int ec, const String& sanitizedMessage, const String& unsanitizedMessage, const v8::Handle<v8::Object>& creationContext) { if (ec <= 0 || v8::V8::IsExecutionTerminating()) return v8Undefined(); ASSERT(ec == SecurityError || unsanitizedMessage.isEmpty()); if (ec == V8GeneralError) return V8ThrowException::createGeneralError(isolate, sanitizedMessage); if (ec == V8TypeError) return V8ThrowException::createTypeError(isolate, sanitizedMessage); if (ec == V8RangeError) return V8ThrowException::createRangeError(isolate, sanitizedMessage); if (ec == V8SyntaxError) return V8ThrowException::createSyntaxError(isolate, sanitizedMessage); if (ec == V8ReferenceError) return V8ThrowException::createReferenceError(isolate, sanitizedMessage); v8::Handle<v8::Object> sanitizedCreationContext = creationContext; // FIXME: Is the current context always the right choice? Frame* frame = toFrameIfNotDetached(creationContext->CreationContext()); if (!frame || !BindingSecurity::shouldAllowAccessToFrame(isolate, frame, DoNotReportSecurityError)) sanitizedCreationContext = isolate->GetCurrentContext()->Global(); RefPtrWillBeRawPtr<DOMException> domException = DOMException::create(ec, sanitizedMessage, unsanitizedMessage); v8::Handle<v8::Value> exception = toV8(domException.get(), sanitizedCreationContext, isolate); if (exception.IsEmpty()) return v8Undefined(); v8::Handle<v8::Value> error = v8::Exception::Error(v8String(isolate, domException->message())); ASSERT(!error.IsEmpty()); ASSERT(exception->IsObject()); exception->ToObject(isolate)->SetAccessor(v8AtomicString(isolate, "stack"), domExceptionStackGetter, domExceptionStackSetter, error); V8HiddenValue::setHiddenValue(isolate, exception->ToObject(isolate), V8HiddenValue::error(isolate), error); return exception; }
185956
163,835
168935182956535440218897240793107318772
null
null
null
Chrome
fb83de09f2c986ee91741f3a2776feea0e18e3f6
0
void OverlayWindowViews::OnGestureEvent(ui::GestureEvent* event) { if (event->type() != ui::ET_GESTURE_TAP) return; hide_controls_timer_.Reset(); if (!GetControlsScrimLayer()->visible()) { UpdateControlsVisibility(true); return; } if (GetCloseControlsBounds().Contains(event->location())) { controller_->Close(true /* should_pause_video */, true /* should_reset_pip_player */); event->SetHandled(); } else if (GetPlayPauseControlsBounds().Contains(event->location())) { TogglePlayPause(); event->SetHandled(); } }
186551
164,358
144250131866569235676960859246226596147
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual void ConnectToCellularNetwork(const CellularNetwork* network) { DCHECK(network); if (!EnsureCrosLoaded()) return; if (network && ConnectToNetwork(network->service_path().c_str(), NULL)) { CellularNetwork* cellular = GetWirelessNetworkByPath( cellular_networks_, network->service_path()); if (cellular) { cellular->set_connecting(true); cellular_ = cellular; } NotifyNetworkManagerChanged(); } }
100218
175,684
154015343367838118332234176506534315968
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual void ConnectToCellularNetwork(const CellularNetwork* network) {}
100219
175,685
194767427183664606535857643999672776330
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
static void DataPlanUpdateHandler(void* object, const char* modem_service_path, const CellularDataPlanList* dataplan) { NetworkLibraryImpl* networklib = static_cast<NetworkLibraryImpl*>(object); if (!networklib || !networklib->cellular_network()) { return; } if (networklib->cellular_network()->service_path() .compare(modem_service_path) == 0) { if (dataplan != NULL) { networklib->UpdateCellularDataPlan(dataplan); } } }
100228
175,686
121642011470862428037157259309646961413
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual void EnableCellularNetworkDevice(bool enable) {}
100232
175,687
318559210196545053550426577046655964312
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual void EnableWifiNetworkDevice(bool enable) {}
100239
175,688
145055075868060404088435281603403491116
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
static bool EnsureCrosLoaded() { if (!CrosLibrary::Get()->EnsureLoaded()) { return false; } else { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { LOG(ERROR) << "chromeos_library calls made from non UI thread!"; NOTREACHED(); } return true; } }
100240
175,689
319280450458319887695824118496801952259
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual CellularNetwork* FindCellularNetworkByPath( const std::string& path) { return GetWirelessNetworkByPath(cellular_networks_, path); }
100241
175,690
188423655336578037438204252327430285062
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual void ForgetWifiNetwork(const std::string& service_path) {}
100246
175,691
301328038796336754244959432557991017246
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
std::string CellularNetwork::GetNetworkTechnologyString() const { switch (network_technology_) { case NETWORK_TECHNOLOGY_1XRTT: return "1xRTT"; break; case NETWORK_TECHNOLOGY_EVDO: return "EVDO"; break; case NETWORK_TECHNOLOGY_GPRS: return "GPRS"; break; case NETWORK_TECHNOLOGY_EDGE: return "EDGE"; break; case NETWORK_TECHNOLOGY_UMTS: return "UMTS"; break; case NETWORK_TECHNOLOGY_HSPA: return "HSPA"; break; case NETWORK_TECHNOLOGY_HSPA_PLUS: return "HSPA Plus"; break; case NETWORK_TECHNOLOGY_LTE: return "LTE"; break; case NETWORK_TECHNOLOGY_LTE_ADVANCED: return "LTE Advanced"; break; default: return l10n_util::GetStringUTF8( IDS_CHROMEOS_NETWORK_CELLULAR_TECHNOLOGY_UNKNOWN); break; } }
100255
175,692
302159635392747760879387960645829412092
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
NetworkLibraryStubImpl() : ip_address_("1.1.1.1"), ethernet_(new EthernetNetwork()), wifi_(NULL), cellular_(NULL) { }
100271
175,693
219990994074732580547047648316848347240
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
static void NetworkManagerStatusChangedHandler(void* object, const char* path, const char* key, const Value* value) { NetworkLibraryImpl* networklib = static_cast<NetworkLibraryImpl*>(object); DCHECK(networklib); networklib->UpdateNetworkManagerStatus(); }
100272
175,694
25939430257759684267331715543734890272
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
void NotifyCellularDataPlanChanged() { FOR_EACH_OBSERVER(CellularDataPlanObserver, data_plan_observers_, OnCellularDataPlanChanged(this)); }
100275
175,695
178554474636187225066924065552108129888
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
void NotifyNetworkManagerChanged() { FOR_EACH_OBSERVER(NetworkManagerObserver, network_manager_observers_, OnNetworkManagerChanged(this)); }
100277
175,696
7509973013266865459398133813556184073
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual void UpdateSystemInfo() {}
100306
175,697
274675798593492238376005335658074197744
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
WifiNetwork::WifiNetwork(const ServiceInfo* service) : WirelessNetwork(service) { encryption_ = service->security; passphrase_ = SafeString(service->passphrase); identity_ = SafeString(service->identity); cert_path_ = SafeString(service->cert_path); type_ = TYPE_WIFI; }
100309
175,698
290212674503579945290341770792308508513
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool cellular_enabled() const { return false; }
100323
175,699
136981732712477451181117132354670548841
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool ethernet_available() const { return available_devices_ & (1 << TYPE_ETHERNET); }
100328
175,700
277781391952026651694213737398716981494
null
null
null
Chrome
a3e2afaedd8190398ae45ccef34fcdee00fb19aa
0
virtual bool ethernet_connecting() const { return ethernet_ ? ethernet_->connecting() : false; }
100332
175,701
104345964690876714203701984309902775942
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
AvailableSpaceQueryTask( QuotaManager* manager, scoped_refptr<base::MessageLoopProxy> db_message_loop, const FilePath& profile_path, AvailableSpaceCallback* callback) : QuotaThreadTask(manager, db_message_loop), profile_path_(profile_path), space_(-1), callback_(callback) {}
100988
175,771
211985763294167133268443076395574361343
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
explicit DatabaseTaskBase(QuotaManager* manager) : QuotaThreadTask(manager, manager->db_thread_), manager_(manager), database_(manager->database_.get()), db_disabled_(false) { DCHECK(manager_); DCHECK(database_); }
100993
175,772
198036692682274565839404209412573071572
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DeleteOriginFromDatabase( const GURL& origin, StorageType type) { LazyInitialize(); if (db_disabled_) return; scoped_refptr<DeleteOriginInfo> task = new DeleteOriginInfo(this, origin, type); task->Start(); }
100996
175,773
183970606539078291997017941513425737752
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::DidOriginDataEvicted( QuotaStatusCode status) { DCHECK(io_thread_->BelongsToCurrentThread()); if (status != kQuotaStatusOk) origins_in_error_[eviction_context_.evicted_origin]++; eviction_context_.evict_origin_data_callback->Run(status); eviction_context_.evict_origin_data_callback.reset(); }
101009
175,774
246304036513108749683336281165410980070
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void QuotaManager::GetPersistentHostQuota(const std::string& host, HostQuotaCallback* callback_ptr) { scoped_ptr<HostQuotaCallback> callback(callback_ptr); LazyInitialize(); if (host.empty()) { callback->Run(kQuotaStatusOk, host, kStorageTypePersistent, 0); return; } scoped_refptr<GetPersistentHostQuotaTask> task( new GetPersistentHostQuotaTask(this, host, callback.release())); task->Start(); }
101025
175,775
212765394731179774269437680376185393889
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
bool QuotaManager::ResetUsageTracker(StorageType type) { switch (type) { case kStorageTypeTemporary: if (temporary_usage_tracker_->IsWorking()) return false; temporary_usage_tracker_.reset( new UsageTracker(clients_, kStorageTypeTemporary, special_storage_policy_)); return true; case kStorageTypePersistent: if (persistent_usage_tracker_->IsWorking()) return false; persistent_usage_tracker_.reset( new UsageTracker(clients_, kStorageTypePersistent, special_storage_policy_)); return true; default: NOTREACHED(); } return true; }
101054
175,776
75369376878479949719838004021014322961
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
UpdateTemporaryGlobalQuotaTask( QuotaManager* manager, int64 new_quota, QuotaCallback* callback) : DatabaseTaskBase(manager), new_quota_(new_quota), callback_(callback) { DCHECK_GE(new_quota, 0); }
101061
175,777
284498882787933902366722999148027833315
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
CallbackList& unlimited_callbacks() { return unlimited_callbacks_; }
101079
175,778
231963882533551881723525797898594838646
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void DumpQuotaTable() { quota_entries_.clear(); quota_manager_->DumpQuotaTable( callback_factory_.NewCallback( &QuotaManagerTest::DidDumpQuotaTable)); }
101101
175,779
54406400444356089936689851436133760354
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
base::Time IncrementMockTime() { ++mock_time_counter_; return base::Time::FromDoubleT(mock_time_counter_ * 10.0); }
101113
175,780
318917545314630711827659368300457671051
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
const std::string& host() const { return host_; }
101126
175,781
71259187843575028790844082763857855886
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
const OriginInfoTableEntries& origin_info_entries() const { return origin_info_entries_; }
101131
175,782
184788120462472738425014534313182734032
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
FilePath profile_path() const { return data_dir_.path(); }
101132
175,783
203178897443126858650826327170042739249
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
const QuotaTableEntries& quota_entries() const { return quota_entries_; }
101133
175,784
27619654243171716925074403764115755606
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void set_quota_manager(QuotaManager* quota_manager) { quota_manager_ = quota_manager; }
101137
175,785
329932957120960214447861709452091832221
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
QuotaStatusCode status() const { return quota_status_; }
101138
175,786
90289551554898650162445916271542203203
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
GatherGlobalUsageTask( UsageTracker* tracker, QuotaClient* client) : GatherUsageTaskBase(tracker, client), client_(client), callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { DCHECK(tracker); DCHECK(client); }
101150
175,787
105422086900871838118890638890411723610
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
GatherUsageTaskBase( UsageTracker* tracker, QuotaClient* client) : QuotaTask(tracker), client_(client), tracker_(tracker), callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { DCHECK(tracker_); DCHECK(client_); client_tracker_ = tracker_->GetClientTracker(client_->id()); DCHECK(client_tracker_); }
101153
175,788
110122810717529841415666624879439744998
null
null
null
Chrome
610f904d8215075c4681be4eb413f4348860bf9f
0
void ClientUsageTracker::GetHostUsage( const std::string& host, HostUsageCallback* callback) { HostSet::const_iterator found = cached_hosts_.find(host); if (found != cached_hosts_.end()) { callback->Run(host, type_, GetCachedHostUsage(host)); delete callback; return; } if (!host_usage_callbacks_.Add(host, callback) || global_usage_task_) return; GatherHostUsageTask* task = new GatherHostUsageTask(tracker_, client_, host); host_usage_tasks_[host] = task; task->Start(); }
101161
175,789
146729197223426821017605547407570337732
null
null
null
Chrome
45bae236b03f577ed6682ef4c7ef3ee006de5e5a
0
void AddDeleteUninstallShortcutsForMSIWorkItems( const InstallerState& installer_state, const Product& product, const FilePath& temp_path, WorkItemList* work_item_list) { DCHECK(installer_state.is_msi()) << "This must only be called for MSI installations!"; HKEY reg_root = installer_state.root_key(); std::wstring uninstall_reg(product.distribution()->GetUninstallRegPath()); WorkItem* delete_reg_key = work_item_list->AddDeleteRegKeyWorkItem( reg_root, uninstall_reg); delete_reg_key->set_ignore_failure(true); FilePath uninstall_link; if (installer_state.system_install()) { PathService::Get(base::DIR_COMMON_START_MENU, &uninstall_link); } else { PathService::Get(base::DIR_START_MENU, &uninstall_link); } if (uninstall_link.empty()) { LOG(ERROR) << "Failed to get location for shortcut."; } else { uninstall_link = uninstall_link.Append( product.distribution()->GetAppShortCutName()); uninstall_link = uninstall_link.Append( product.distribution()->GetUninstallLinkName() + L".lnk"); VLOG(1) << "Deleting old uninstall shortcut (if present): " << uninstall_link.value(); WorkItem* delete_link = work_item_list->AddDeleteTreeWorkItem( uninstall_link, temp_path); delete_link->set_ignore_failure(true); delete_link->set_log_message( "Failed to delete old uninstall shortcut."); } }
106796
176,403
204840863584258047852537690933239743192
null
null
null
Chrome
45bae236b03f577ed6682ef4c7ef3ee006de5e5a
0
void AddQuickEnableWorkItems(const InstallerState& installer_state, const InstallationState& machine_state, const FilePath* setup_path, const Version* new_version, WorkItemList* work_item_list) { DCHECK(setup_path || installer_state.operation() == InstallerState::UNINSTALL); DCHECK(new_version || installer_state.operation() == InstallerState::UNINSTALL); DCHECK(work_item_list); const bool system_install = installer_state.system_install(); bool have_multi_chrome = false; bool have_chrome_frame = false; const ProductState* product_state = NULL; product_state = machine_state.GetProductState(system_install, BrowserDistribution::CHROME_BROWSER); if (product_state != NULL && product_state->is_multi_install()) have_multi_chrome = true; product_state = machine_state.GetProductState(system_install, BrowserDistribution::CHROME_FRAME); if (product_state != NULL && !product_state->uninstall_command().HasSwitch( switches::kChromeFrameReadyMode)) have_chrome_frame = true; const Product* product = NULL; if (installer_state.operation() == InstallerState::UNINSTALL) { product = installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); if (product != NULL && installer_state.is_multi_install()) have_multi_chrome = false; if (installer_state.FindProduct(BrowserDistribution::CHROME_FRAME) != NULL) have_chrome_frame = false; } else { product = installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); if (product != NULL && installer_state.is_multi_install()) have_multi_chrome = true; product = installer_state.FindProduct(BrowserDistribution::CHROME_FRAME); if (product != NULL && !product->HasOption(kOptionReadyMode)) have_chrome_frame = true; } enum QuickEnableOperation { DO_NOTHING, ADD_COMMAND, REMOVE_COMMAND } operation = DO_NOTHING; FilePath binaries_setup_path; if (have_chrome_frame) { operation = REMOVE_COMMAND; } else if (have_multi_chrome) { operation = ADD_COMMAND; if (installer_state.operation() == InstallerState::UNINSTALL) { product_state = machine_state.GetProductState(system_install, BrowserDistribution::CHROME_BROWSER); DCHECK(product_state); binaries_setup_path = product_state->uninstall_command().GetProgram(); } else { DCHECK(installer_state.is_multi_install()); binaries_setup_path = installer_state.GetInstallerDirectory(*new_version).Append( setup_path->BaseName()); } } if (operation != DO_NOTHING) { BrowserDistribution* binaries = BrowserDistribution::GetSpecificDistribution( BrowserDistribution::CHROME_BINARIES); std::wstring cmd_key(binaries->GetVersionKey()); cmd_key.append(1, L'\\').append(google_update::kRegCommandsKey) .append(1, L'\\').append(kCmdQuickEnableCf); if (operation == ADD_COMMAND) { DCHECK(!binaries_setup_path.empty()); CommandLine cmd_line(binaries_setup_path); cmd_line.AppendSwitch(switches::kMultiInstall); if (installer_state.system_install()) cmd_line.AppendSwitch(switches::kSystemLevel); if (installer_state.verbose_logging()) cmd_line.AppendSwitch(switches::kVerboseLogging); cmd_line.AppendSwitch(switches::kChromeFrameQuickEnable); AppCommand cmd(cmd_line.command_line_string(), true, true); cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); } else { DCHECK(operation == REMOVE_COMMAND); work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), cmd_key)->set_log_message( "removing quick-enable-cf command"); } } }
106801
176,404
42128149065272116756947380511788764669
null
null
null
Chrome
2bfb2b8299e2fb6a432390a93a99a85fed1d29c9
0
bool WebProcessProxy::canCreateFrame(uint64_t frameID) const { return isGoodKey<WebFrameProxyMap>(frameID) && !m_frameMap.contains(frameID); }
113371
177,168
333079500053539543106806801454510652116
null
null
null